-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff] Assertion failure due to "Found leaked temporary" #81607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Tagging @asl @JaapWijnen |
I'm seeing different assert (though this is with
|
Hmm, it's interesting. I'm seeing that one about leaks (see initial issue description) on my machine (re-verified that right now). Just in case: I'm on commit c4b0e97 (merge PR81589). And one more thought: since I'm on Linux, arrays are implemented differently, and this might affect the observed assertion. |
With these arguments, I have the same assertion as you've mentioned |
The original SIL is as follows: sil hidden [ossa] @$s4main3sumySaySfGSf_ACtF : $@convention(thin) (Float, @guaranteed Array<Float>) -> @owned Array<Float> {
// %0 "a" // users: %24, %2
// %1 "b" // users: %15, %6, %3
bb0(%0 : $Float, %1 : @guaranteed $Array<Float>):
debug_value %0, let, name "a", argno 1 // id: %2
debug_value %1, let, name "b", argno 2 // id: %3
%4 = metatype $@thin Int.Type // user: %12
// function_ref Array.count.getter
%5 = function_ref @$sSa5countSivg : $@convention(method) <τ_0_0> (@guaranteed Array<τ_0_0>) -> Int // user: %6
%6 = apply %5<Float>(%1) : $@convention(method) <τ_0_0> (@guaranteed Array<τ_0_0>) -> Int // user: %12
%7 = integer_literal $Builtin.IntLiteral, 0 // user: %10
%8 = metatype $@thin Int.Type // user: %10
// function_ref Int.init(_builtinIntegerLiteral:)
%9 = function_ref @$sSi22_builtinIntegerLiteralSiBI_tcfC : $@convention(method) (Builtin.IntLiteral, @thin Int.Type) -> Int // user: %10
%10 = apply %9(%7, %8) : $@convention(method) (Builtin.IntLiteral, @thin Int.Type) -> Int // user: %12
// function_ref static Int.!= infix(_:_:)
%11 = function_ref @$sSi2neoiySbSi_SitFZ : $@convention(method) (Int, Int, @thin Int.Type) -> Bool // user: %12
%12 = apply %11(%6, %10, %4) : $@convention(method) (Int, Int, @thin Int.Type) -> Bool // user: %13
%13 = struct_extract %12, #Bool._value // user: %14
cond_br %13, bb1, bb2 // id: %14
bb1: // Preds: bb0
%15 = copy_value %1 // user: %16
br bb3(%15) // id: %16
bb2: // Preds: bb0
%17 = integer_literal $Builtin.Word, 1 // user: %19
// function_ref _allocateUninitializedArray<A>(_:)
%18 = function_ref @$ss27_allocateUninitializedArrayySayxG_BptBwlF : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %19
%19 = apply %18<Float>(%17) : $@convention(thin) <τ_0_0> (Builtin.Word) -> (@owned Array<τ_0_0>, Builtin.RawPointer) // user: %20
(%20, %21) = destructure_tuple %19 // users: %26, %22, %22
%22 = mark_dependence %21 on %20 // user: %23
%23 = pointer_to_address %22 to [strict] $*Float // user: %24
store %0 to [trivial] %23 // id: %24
// function_ref _finalizeUninitializedArray<A>(_:)
%25 = function_ref @$ss27_finalizeUninitializedArrayySayxGABnlF : $@convention(thin) <τ_0_0> (@owned Array<τ_0_0>) -> @owned Array<τ_0_0> // user: %26
%26 = apply %25<Float>(%20) : $@convention(thin) <τ_0_0> (@owned Array<τ_0_0>) -> @owned Array<τ_0_0> // user: %27
br bb3(%26) // id: %27
// %28 // user: %29
bb3(%28 : @owned $Array<Float>): // Preds: bb2 bb1
return %28 // id: %29
} // end sil function '$s4main3sumySaySfGSf_ACtF' Activity info is stragihtforward:
We need to propagate adjoint of
Looks like |
Uh oh!
There was an error while loading. Please reload this page.
Description
With the reproducer provided below, we get an assertion failure in PullbackCloner when running mandatory Differentiation pass.
Reproduction
Stack dump
Expected behavior
No assertion failures should be present
Environment
Swift version 6.2-dev (LLVM 94a95edd9aa32e1, Swift c4b0e97)
Target: x86_64-unknown-linux-gnu
Build config: +assertions
Additional information
No response
The text was updated successfully, but these errors were encountered: