Skip to content
This repository has been archived by the owner on Feb 13, 2025. It is now read-only.

Translation example #148

Open
saeta opened this issue May 4, 2019 · 4 comments
Open

Translation example #148

saeta opened this issue May 4, 2019 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@saeta
Copy link
Contributor

saeta commented May 4, 2019

It'd be great to have a neural machine translation model incorporated into our models repository.

@saeta saeta added good first issue Good for newcomers help wanted Extra attention is needed labels May 4, 2019
@palle-k
Copy link

palle-k commented Nov 10, 2019

I have started an implementation of Seq2Seq with LSTMs and Attention here. It currently crashes the compiler though (something in the callAsFunction method in the Seq2Seq struct) and I can't find a way around that crash.

@Shashi456
Copy link
Contributor

@palle-k could you comment in the error in your file? Would be easier to understand if it's API issue or some trivial error

@palle-k
Copy link

palle-k commented Nov 10, 2019

Apparently, there are multiple crashes involved. I have updated the code in my fork and marked the pieces of code that crash the compiler with // MARK: Crash 1 and // MARK: Crash 2 in Seq2Seq/Models.swift starting at line 237.

The relevant pieces are commented out and can be uncommented individually.

Crash 1 seems to occur when an empty if-statement or a empty for-loop is present:

Assertion failed: (pullbackStructElements.count(field) && "Pullback struct element for this field does not exist!"), function getPullbackStructElement, file /Users/swiftninjas/s4tf/swift/lib/SILOptimizer/Mandatory/Differentiation.cpp, line 5127.

Crash 2 seems to occur when a for-loop with a non-empty body is present:

Assertion failed: (lhs->getType() == rhs->getType() && "Adjoints must have equal types!"), function accumulateDirect, file /Users/swiftninjas/s4tf/swift/lib/SILOptimizer/Mandatory/Differentiation.cpp, line 6923.

Also, I'm using the 0.5 release of S4TF.

$ swift --version
Swift version 5.1-dev (LLVM 200186e28b, Swift 1238976565)
Target: x86_64-apple-darwin19.0.0

@dan-zheng
Copy link
Member

dan-zheng commented Nov 11, 2019

Apparently, there are multiple crashes involved. I have updated the code in my fork and marked the pieces of code that crash the compiler with // MARK: Crash 1 and // MARK: Crash 2 in Seq2Seq/Models.swift starting at line 237.

Thanks for reporting! Both crashers you reported are known issues:

  • TF-922: Assertion failed: (lhs->getType() == rhs->getType() && "Adjoints must have equal types!")
  • TF-924: Assertion failed: (pullbackStructElements.count(field) && "Pullback struct element for this field does not exist!")

We'll visit these issues soon, thanks for your patience!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants