Closed dan-zheng closed 3 years ago
@swift-ci create
Forward-mode is not supported and will be deprecated. Closing.
I found the same crash in #59429, and it does not seem related to forward-mode differentiation. However, #59429 was found while investigating a separate crash involving forward-mode differentiation.
I did come across this, which produced a similar error message under the -enable-experimental-forward-mode-differentiation
flag.
func partial<T, U, V>(
_ f: @differentiable(reverse) (T, T) -> V,
y: U
) -> @differentiable(reverse) (T) -> V {
{ x in f(x, x) }
}
Toolchain: June 8, 2022 Development Snapshot
Here is the full investigation of the new set of crashers. Above each one is the first line of the error message. Credit to @stevapple for spotting this crash.
import _Differentiation
// Bad generic parameter in τ_0_1
func process<T: Differentiable>(
_ f: (T) -> T
) where T == T.TangentVector {
pullback(at: .zero, of: { x in
f(x)
})(.zero)
}
// Assertion failed: (paramInfos.size() == arguments.size()), function OperandToInoutArgument, file SILInstruction.h, line 2716.
func partial<T, U, V>(
_ f: @differentiable(reverse) (T, U) -> V,
y: U
) -> @differentiable(reverse) (T) -> V {
{ x in f(x, y) }
}
// Assertion failed: (signature || !origType->hasTypeParameter()), function initSwiftType, file AbstractionPattern.h, line 528.
func partial<T, U, V>(
_ f: @differentiable(reverse) (T, T) -> V,
y: U
) -> @differentiable(reverse) (T) -> V {
{ x in f(x, x) }
}
// Bad generic parameter in τ_0_2
func partial<T, V>(
_ f: @differentiable(reverse) (T, T) -> V,
y: T
) -> @differentiable(reverse) (T) -> V {
{ x in f(x, x) }
}
// Bad generic parameter in τ_0_2
func partial<T, V>(
_ f: @differentiable(reverse) (T, T) -> V
) -> @differentiable(reverse) (T) -> V {
{ x in f(x, x) }
}
// Bad generic parameter in τ_0_1
func partial<T>(
_ f: @differentiable(reverse) (T, T) -> T
) -> @differentiable(reverse) (T) -> T {
{ x in f(x, x) }
}
// Bad generic parameter in τ_0_1
func partial<T>(
_ f: (T) -> T
) -> @differentiable(reverse) (T) -> T {
{ x in f(x) }
}
Edit: I have started to reproduce this crash without having the forward-mode flag. Thus, it is probably an issue affecting reverse-mode differentiation.
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, AutoDiff, CompilerCrash | |Assignee | None | |Priority | Medium | md5: bf77f0398bb89e022f17050e14447b10Issue Description:
Reproducer:
The crash occurs while attempting to generate a reabstraction thunk for a function-typed value (differential callee) during forward-mode differentiation.