-
Notifications
You must be signed in to change notification settings - Fork 157
Caching potentially causes intermittent segfault #2774
Copy link
Copy link
Open
Description
I was seeing intermittent segfaults in this line
| dyn_cast<AutoDiffFunctionInterface>(newFunc.getOperation())) { |
The segfaults stopped if I deleted this cache fetch
Enzyme/enzyme/Enzyme/MLIR/Interfaces/EnzymeLogicReverse.cpp
Lines 219 to 223 in 9b78a1c
| { | |
| auto cachedFn = ReverseCachedFunctions.find(tup); | |
| if (cachedFn != ReverseCachedFunctions.end()) | |
| return cachedFn->second; | |
| } |
This was observed when differentiating several MLIR graphs, such as below. Each graph would be run anywhere between 2 to 400 times, each run with different constants
module @root {
func.func @main() -> tensor<f64> {
%cst = stablehlo.constant dense<1.000000e+00> : tensor<f64>
%cst_0 = stablehlo.constant dense<0.000000e+00> : tensor<f64>
%0 = enzyme.autodiff_region(%cst_0, %cst) {
^bb0(%arg0: tensor<f64>):
enzyme.yield %arg0 : tensor<f64>
} attributes {activity = [#enzyme<activity enzyme_active>], ret_activity = [#enzyme<activity enzyme_activenoneed>]} : (tensor<f64>, tensor<f64>) -> tensor<f64>
return %0 : tensor<f64>
}
}
These are my passes
{-#
external_resources: {
mlir_reproducer: {
pipeline: "builtin.module(outline-enzyme-regions, enzyme{postpasses=canonicalize,remove-unnecessary-enzyme-ops verifyPostPasses=true}, arith-raise{stablehlo=true})",
disable_threading: false,
verify_each: true
}
}
#-}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels