Skip to content
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

[SR-8996] Inlining crash in devirtualizeWitnessMethod during deabstraction #51499

Closed
swift-ci opened this issue Oct 15, 2018 · 8 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. GPE swift for tensorflow

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-8996
Radar None
Original Reporter jekbradbury (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Swift for TensorFlow
Labels Bug, GPE
Assignee @rxwei
Priority Medium

md5: 234cf7049009ab142d351ab073e27b3e

Issue Description:

The LSTM language model example crashes the compiler during the deabstraction pass towards the end of inlining.

Stacktrace:

Assertion failed: (SrcTy.isAddress() == DestTy.isAddress() && "Addresses aren't compatible with values"), function castValueToABICompatibleType, file /Users/jekbradbury/swift-sources/swift/lib/SILOptimizer/Utils/Local.cpp, line 490.
Stack dump:
0.  Program arguments: /Users/jekbradbury/swift-sources/build/Xcode-RelWithDebInfoAssert+swift-DebugAssert/swift-macosx-x86_64/Debug/bin/swift -frontend -interpret experimental/users/jekbradbury/swift-scratchpad/LSTMLanguageModel/main.swift -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -O -color-diagnostics -module-name main 
1.  While running pass #​566 SILModuleTransform "TFDeabstraction".
2.  TFDeabstraction on function main
3.  TFDeabstraction::inlineCalls
0  swift                    0x000000010790a848 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swift                    0x0000000107909ac5 llvm::sys::RunSignalHandlers() + 85
2  swift                    0x000000010790ae52 SignalHandler(int) + 258
3  libsystem_platform.dylib 0x00007fff7dc4df5a _sigtramp + 26
4  libdyld.dylib            0x00007fff7d93f149 dyldGlobalLockRelease() + 0
5  libsystem_c.dylib        0x00007fff7d9eb1ae abort + 127
6  libsystem_c.dylib        0x00007fff7d9b31ac basename_r + 0
7  swift                    0x0000000103a50548 swift::castValueToABICompatibleType(swift::SILBuilder*, swift::SILLocation, swift::SILValue, swift::SILType, swift::SILType) + 264
8  swift                    0x00000001039d6afb devirtualizeWitnessMethod(swift::ApplySite, swift::SILFunction*, swift::ProtocolConformanceRef, swift::OptRemark::Emitter*) + 731
9  swift                    0x00000001039d6487 swift::tryDevirtualizeWitnessMethod(swift::ApplySite, swift::OptRemark::Emitter*) + 919
10 swift                    0x00000001039d6ef7 swift::tryDevirtualizeApply(swift::ApplySite, swift::ClassHierarchyAnalysis*, swift::OptRemark::Emitter*) + 183
11 swift                    0x0000000103598838 tryDevirtualizeApplyHelper(swift::FullApplySite, llvm::ilist_iterator<llvm::ilist_detail::node_options<swift::SILInstruction, true, false, void>, false, false>, swift::ClassHierarchyAnalysis*) + 72
12 swift                    0x00000001035978b6 runOnFunctionRecursively(swift::SILOptFunctionBuilder&, swift::SILFunction*, swift::FullApplySite, llvm::DenseSet<swift::SILFunction*, llvm::DenseMapInfo<swift::SILFunction*> >&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >::Factory&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >, swift::ClassHierarchyAnalysis*, swift::SILInliner::InlineKind, std::__1::function<bool (swift::FullApplySite, swift::SILFunction&)> const&) + 982
13 swift                    0x0000000103597cca runOnFunctionRecursively(swift::SILOptFunctionBuilder&, swift::SILFunction*, swift::FullApplySite, llvm::DenseSet<swift::SILFunction*, llvm::DenseMapInfo<swift::SILFunction*> >&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >::Factory&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >, swift::ClassHierarchyAnalysis*, swift::SILInliner::InlineKind, std::__1::function<bool (swift::FullApplySite, swift::SILFunction&)> const&) + 2026
14 swift                    0x0000000103597cca runOnFunctionRecursively(swift::SILOptFunctionBuilder&, swift::SILFunction*, swift::FullApplySite, llvm::DenseSet<swift::SILFunction*, llvm::DenseMapInfo<swift::SILFunction*> >&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >::Factory&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >, swift::ClassHierarchyAnalysis*, swift::SILInliner::InlineKind, std::__1::function<bool (swift::FullApplySite, swift::SILFunction&)> const&) + 2026
15 swift                    0x0000000103597cca runOnFunctionRecursively(swift::SILOptFunctionBuilder&, swift::SILFunction*, swift::FullApplySite, llvm::DenseSet<swift::SILFunction*, llvm::DenseMapInfo<swift::SILFunction*> >&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >::Factory&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >, swift::ClassHierarchyAnalysis*, swift::SILInliner::InlineKind, std::__1::function<bool (swift::FullApplySite, swift::SILFunction&)> const&) + 2026
16 swift                    0x0000000103597cca runOnFunctionRecursively(swift::SILOptFunctionBuilder&, swift::SILFunction*, swift::FullApplySite, llvm::DenseSet<swift::SILFunction*, llvm::DenseMapInfo<swift::SILFunction*> >&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >::Factory&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >, swift::ClassHierarchyAnalysis*, swift::SILInliner::InlineKind, std::__1::function<bool (swift::FullApplySite, swift::SILFunction&)> const&) + 2026
17 swift                    0x000000010359746f swift::inlineForTFDeabstraction(swift::SILOptFunctionBuilder&, swift::SILFunction&, std::__1::function<bool (swift::FullApplySite, swift::SILFunction&)> const&) + 239
18 swift                    0x0000000103607953 (anonymous namespace)::TFDeabstraction::inlineCalls() + 771
19 swift                    0x000000010360732f (anonymous namespace)::TFDeabstraction::doIt() + 31
20 swift                    0x00000001036070ea (anonymous namespace)::TFDeabstractionPass::run() + 698
21 swift                    0x000000010377d613 swift::SILPassManager::runModulePass(unsigned int) + 2275
22 swift                    0x000000010377f1d4 swift::SILPassManager::execute() + 1092
23 swift                    0x000000010295700c swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 556
24 swift                    0x00000001037bff1d swift::runSILDiagnosticPasses(swift::SILModule&) + 301
25 swift                    0x00000001025cf60b performMandatorySILPasses(swift::CompilerInvocation&, swift::SILModule*, swift::FrontendObserver*) + 75
26 swift                    0x00000001025a7100 performCompileStepsPostSILGen(swift::CompilerInstance&, swift::CompilerInvocation&, std::__1::unique_ptr<swift::SILModule, std::__1::default_delete<swift::SILModule> >, bool, llvm::PointerUnion<swift::ModuleDecl*, swift::SourceFile*>, swift::PrimarySpecificPaths const&, bool, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 2656
27 swift                    0x000000010259a2c0 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 4160
28 swift                    0x0000000102597477 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 5063
29 swift                    0x00000001024ca2f5 run_driver(llvm::StringRef, llvm::ArrayRef<char const*>) + 917
30 swift                    0x00000001024c8b02 main + 3730
31 libdyld.dylib            0x00007fff7d93f015 start + 1
Abort trap: 6

Additional LLDB output that may be useful:

frame #&#8203;7: 0x000000010152ff07 swift`swift::tryDevirtualizeApply(AI=ApplySite @ 0x00007ffeefbf40f0, CHA=0x0000000000000000, ORE=0x0000000000000000) at Devirtualize.cpp:1022
   1019   //   %9 = apply %8<Self = CodeUnit?>(%6#1) : ...
   1020   //
   1021   if (isa<WitnessMethodInst>(AI.getCallee()))
-> 1022     return tryDevirtualizeWitnessMethod(AI, ORE);
   1023 
   1024   // TODO: check if we can also de-virtualize partial applies of class methods.
   1025   FullApplySite FAS = FullApplySite::isa(AI.getInstruction());
(lldb) p AI.getInstruction()->dump()
  %71 = apply %68<Tensor<Float>>(%55, %70, %69) : $@convention(witness_method: VectorNumeric) <τ_0_0 where τ_0_0 : VectorNumeric> (@in τ_0_0.ScalarElement, @thick τ_0_0.Type) -> @out τ_0_0
...
frame #&#8203;4: 0x00000001015a9558 swift`swift::castValueToABICompatibleType(B=0x00007ffeefbf3cd8, Loc=SILLocation @ 0x00007ffeefbf3a00, Value=SILValue @ 0x00007ffeefbf3930, SrcTy=SILType @ 0x00007ffeefbf3928, DestTy=SILType @ 0x00007ffeefbf3920) at Local.cpp:489
   486    if (SrcTy == DestTy)
   487      return Value;
   488  
-> 489    assert(SrcTy.isAddress() == DestTy.isAddress() &&
   490           "Addresses aren't compatible with values");
   491  
   492    if (SrcTy.isAddress() && DestTy.isAddress()) {
(lldb) p DestTy.dump()
$*Tensor<Float>
(lldb) p SrcTy.dump()
$Tensor<Float>

I can provide an internal link to the example, or I can paste it publicly if that's better.

@rxwei
Copy link
Member

rxwei commented Oct 15, 2018

Could you email the code (or the link to the code)? Thx.

@swift-ci
Copy link
Collaborator Author

Comment by Mingsheng Hong (JIRA)

Tweaked the code a bit and got an AD crash. Will talk to Richard and James about it.

@swift-ci
Copy link
Collaborator Author

Comment by Mingsheng Hong (JIRA)

Based on James' code, I made a simpler reproducer below:

import TensorFlow

@inlinable
@differentiable(reverse, wrt: (.0),
primal: _primalSoftmaxCrossEntropy,
adjoint: _adjointSoftmaxCrossEntropy)
func softmaxCrossEntropy(logits: Tensor<Float>, categoricalLabels: Tensor<Int32>) -> Float {
 return Raw.sparseSoftmaxCrossEntropyWithLogits(features: logits,
 labels: categoricalLabels).loss.mean()
}

@inlinable
func _primalSoftmaxCrossEntropy(logits: Tensor<Float>,
 categoricalLabels: Tensor<Int32>) -> (Tensor<Float>, Float) {
 let (loss, grad) = Raw.sparseSoftmaxCrossEntropyWithLogits(features: logits,
 labels: categoricalLabels)
 return (grad, loss.mean())
}

@inlinable
func _adjointSoftmaxCrossEntropy(logits: Tensor<Float>,
 categoricalLabels: Tensor<Int32>,
 checkpointedGrad: Tensor<Float>,
 originalResult: Float,
 seed: Float) -> Tensor<Float> {
 return checkpointedGrad
}

struct LSTMLanguageModel {
 func predict(for input: Tensor<Float>) -> (Tensor<Float>, Tensor<Float>) {
 return (input, input)
 }
}

func autoregressiveLoss(_ model: LSTMLanguageModel, _ input: Tensor<Float>) -> Float {
 let (logits, _) = model.predict(for: input)
 return softmaxCrossEntropy(logits: logits, categoricalLabels: Tensor<Int32>(input))
}

func trainLanguageModel(model: LSTMLanguageModel, input: Tensor<Float>) {
 _ = #valueAndGradient(autoregressiveLoss, wrt: .0)(model, input)
}
  

Crash trace:

 ../build/$rdir/swift-linux-x86_64/bin/swiftc -O -Xllvm -tf-dynamic-compilation test/TensorFlow/lang3.swift
swift: /usr/local/google/home/hongm/ssd_part/git/swift-base/swift/lib/SILOptimizer/Utils/Local.cpp:490: swift::SILValue swift::castValueToABICompatibleType(swift::SILBuilder *, swift::SILLocation, swift::SILValue, swift::SILType, swift::SILType): Assertion `SrcTy.isAddress() == DestTy.isAddress() && "Addresses aren't compatible with values"' failed.
Stack dump:
0.  Program arguments: /usr/local/google/home/hongm/ssd_part/git/swift-base/build/Ninja-ReleaseAssert+stdlib-Release/swift-linux-x86_64/bin/swift -frontend -c -primary-file test/TensorFlow/lang3.swift -target x86_64-unknown-linux-gnu -disable-objc-interop -O -Xllvm -tf-dynamic-compilation -module-name lang3 -o /tmp/lang3-e33abc.o 
1.  While running pass #&#8203;126 SILModuleTransform "TFDeabstraction".
2.  TFDeabstraction::inlineCalls\0
#&#8203;0 0x000000000414cf34 PrintStackTraceSignalHandler(void*) (/usr/local/google/home/hongm/ssd_part/git/swift-base/build/Ninja-ReleaseAssert+stdlib-Release/swift-linux-x86_64/bin/swift+0x414cf34)
#&#8203;1 0x000000000414b090 llvm::sys::RunSignalHandlers() (/usr/local/google/home/hongm/ssd_part/git/swift-base/build/Ninja-ReleaseAssert+stdlib-Release/swift-linux-x86_64/bin/swift+0x414b090)
#&#8203;2 0x000000000414d0e2 SignalHandler(int) (/usr/local/google/home/hongm/ssd_part/git/swift-base/build/Ninja-ReleaseAssert+stdlib-Release/swift-linux-x86_64/bin/swift+0x414d0e2)
#&#8203;3 0x00007fe62ac3a0c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x110c0)
#&#8203;4 0x00007fe6134aafcf gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x32fcf)
#&#8203;5 0x00007fe6134ac3fa abort (/lib/x86_64-linux-gnu/libc.so.6+0x343fa)
#&#8203;6 0x00007fe6134a3e37 (/lib/x86_64-linux-gnu/libc.so.6+0x2be37)
#&#8203;7 0x00007fe6134a3ee2 (/lib/x86_64-linux-gnu/libc.so.6+0x2bee2)
#&#8203;8 0x0000000000ec6515 swift::castValueToABICompatibleType(swift::SILBuilder*, swift::SILLocation, swift::SILValue, swift::SILType, swift::SILType) (/usr/local/google/home/hongm/ssd_part/git/swift-base/build/Ninja-ReleaseAssert+stdlib-Release/swift-linux-x86_64/bin/swift+0xec6515)
#&#8203;9 0x0000000000e7513b swift::tryDevirtualizeWitnessMethod(swift::ApplySite, swift::OptRemark::Emitter*) (/usr/local/google/home/hongm/ssd_part/git/swift-base/build/Ninja-ReleaseAssert+stdlib-Release/swift-linux-x86_64/bin/swift+0xe7513b)
#&#8203;10 0x0000000000e7582d swift::tryDevirtualizeApply(swift::ApplySite, swift::ClassHierarchyAnalysis*, swift::OptRemark::Emitter*) (/usr/local/google/home/hongm/ssd_part/git/swift-base/build/Ninja-ReleaseAssert+stdlib-Release/swift-linux-x86_64/bin/swift+0xe7582d)
#&#8203;11 0x000000000109c465 runOnFunctionRecursively(swift::SILOptFunctionBuilder&, swift::SILFunction*, swift::FullApplySite, llvm::DenseSet<swift::SILFunction*, llvm::DenseMapInfo<swift::SILFunction*> >&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >::Factory&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >, swift::ClassHierarchyAnalysis*, swift::SILInliner::InlineKind, std::function<bool (swift::FullApplySite, swift::SILFunction&)> const&) (/usr/local/google/home/hongm/ssd_part/git/swift-base/build/Ninja-ReleaseAssert+stdlib-Release/swift-linux-x86_64/bin/swift+0x109c465)
#&#8203;12 0x000000000109caf2 runOnFunctionRecursively(swift::SILOptFunctionBuilder&, swift::SILFunction*, swift::FullApplySite, llvm::DenseSet<swift::SILFunction*, llvm::DenseMapInfo<swift::SILFunction*> >&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >::Factory&, llvm::ImmutableSet<swift::SILFunction*, llvm::ImutContainerInfo<swift::SILFunction*> >, swift::ClassHierarchyAnalysis*, swift::SILInliner::InlineKind, std::function<bool (swift::FullApplySite, swift::SILFunction&)> const&) (/usr/local/google/home/hongm/ssd_part/git/swift-base/build/Ninja-ReleaseAssert+stdlib-Release/swift-linux-x86_64/bin/swift+0x109caf2)
#&#8203;13 0x000000000109c0f0 swift::inlineForTFDeabstraction(swift::SILOptFunctionBuilder&, swift::SILFunction&, std::function<bool (swift::FullApplySite, swift::SILFunction&)> const&) (/usr/local/google/home/hongm/ssd_part/git/swift-base/build/Ninja-ReleaseAssert+stdlib-Release/swift-linux-x86_64/bin/swift+0x109c0f0)

@rxwei
Copy link
Member

rxwei commented Oct 22, 2018

Thanks. Have you tried removing all AD-related operators? If so, it could even be an AD bug. I'll prioritize it this week.

@swift-ci
Copy link
Collaborator Author

Comment by Mingsheng Hong (JIRA)

This might be an AD bug, because:

  1. The SIL function that triggers the crash is created by AD:
$  ../build/$rdir/swift-linux-x86_64/bin/swiftc -frontend -O -Xllvm -tf-dump-intermediates -Xllvm -tf-dump-graph  -Xllvm -tf-dynamic-compilation=true -emit-sil  test/TensorFlow/lang3.swift
--- TFDeabstraction Input: AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__grad_src_0_wrt_0_s_p
// AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__grad_src_0_wrt_0_s_p
sil hidden @AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__grad_src_0_wrt_0_s_p : $@convention(thin) (LSTMLanguageModel, @guaranteed Tensor<Float>, Float) -> (Float, LSTMLanguageModel) {
// %0                                             // users: %8, %4
// %1                                             // users: %8, %4
// %2                                             // user: %8
bb0(%0 : $LSTMLanguageModel, %1 : $Tensor<Float>, %2 : $Float):
  // function_ref AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__primal_src_0_wrt_0
  %3 = function_ref @AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__primal_src_0_wrt_0 : $@convention(thin) (LSTMLanguageModel, @guaranteed Tensor<Float>) -> (@owned AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__Type__src_0_wrt_0, Float) // user: %4
  %4 = apply %3(%0, %1) : $@convention(thin) (LSTMLanguageModel, @guaranteed Tensor<Float>) -> (@owned AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__Type__src_0_wrt_0, Float) // users: %6, %5
  %5 = tuple_extract %4 : $(AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__Type__src_0_wrt_0, Float), 0 // user: %8
  %6 = tuple_extract %4 : $(AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__Type__src_0_wrt_0, Float), 1 // users: %9, %8
  // function_ref AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__adjoint_src_0_wrt_0
  %7 = function_ref @AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__adjoint_src_0_wrt_0 : $@convention(thin) (LSTMLanguageModel, @guaranteed Tensor<Float>, AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__Type__src_0_wrt_0, Float, Float) -> LSTMLanguageModel // user: %8
  %8 = apply %7(%0, %1, %5, %6, %2) : $@convention(thin) (LSTMLanguageModel, @guaranteed Tensor<Float>, AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__Type__src_0_wrt_0, Float, Float) -> LSTMLanguageModel // user: %9
  %9 = tuple (%6 : $Float, %8 : $LSTMLanguageModel) // user: %10
  return %9 : $(Float, LSTMLanguageModel)         // id: %10
} // end sil function 'AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__grad_src_0_wrt_0_s_p'

2. If we replace `#valueAndGradient(autoregressiveLoss, wrt: .0)(model, input)` with `autoregressiveLoss(model, input)` above, it does not crash at the same place. Instead, it crashes at IRGen. I can debug this one once we confirm the generated SIL code above by AD is good.

@swift-ci
Copy link
Collaborator Author

Comment by Mingsheng Hong (JIRA)

More info from gdb at the point of crash:

// AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__adjoint_src_0_wrt_0
sil hidden @AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__adjoint_src_0_wrt_0 : $@convention(thin) (LSTMLanguageModel, @guaranteed Tensor<Float>, AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__Type__src_0_wrt_0, Float, Float) -> LSTMLanguageModel {
// %0                                             // user: %78
// %1                                             // users: %29, %13, %78
// %2                                             // users: %45, %32, %5
// %4                                             // user: %36
bb0(%0 : $LSTMLanguageModel, %1 : $Tensor<Float>, %2 : $AD__$s5lang318autoregressiveLossySfAA17LSTMLanguageModelV_10TensorFlow0F0VySfGtF__Type__src_0_wrt_0, %3 : $Float, %4 : $Float):

...
%67 = witness_method $Tensor<Float>, #VectorNumeric.init!allocator.1 : <Self where Self : VectorNumeric> (Self.Type) -> (Self.ScalarElement) -> Self : $@convention(witness_method: VectorNumeric) <τ_0_0 where τ_0_0 : VectorNumeric> (@in τ_0_0.ScalarElement, @thick τ_0_0.Type) -> @out τ_0_0 // user: %70

...

%70 = apply %67<Tensor<Float>>(%54, %69, %68) : $@convention(witness_method: VectorNumeric) <τ_0_0 where τ_0_0 : VectorNumeric> (@in τ_0_0.ScalarElement, @thick τ_0_0.Type) -> @out τ_0_0

  

When processing %70 in the last line of swift::tryDevirtualizeWitnessMethod(), the crash was triggered.

I'll leave this with AD folks for now.

@rxwei
Copy link
Member

rxwei commented Oct 22, 2018

Thanks a lot for isolating the bug. I'll take this.

@swift-ci
Copy link
Collaborator Author

Comment by Mingsheng Hong (JIRA)

np. Let me know if I can help.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. GPE swift for tensorflow
Projects
None yet
Development

No branches or pull requests

2 participants