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

[AutoDiff] Fix differentiation crashes related to definite initialization. #32031

Merged
merged 2 commits into from May 29, 2020

Conversation

dan-zheng
Copy link
Collaborator

@dan-zheng dan-zheng commented May 27, 2020

[SIL] Fix alloc_stack [dynamic_lifetime] attribute cloning.

Make SILCloner:visitAllocStack correctly propagate the [dynamic_lifetime] attribute.

Resolves SR-12886: differentiation transform error related to the VJPEmitter
subclass of SILCloner.


[AutoDiff] Fix SIL locations and debug scopes.

Fix SIL locations and debug scopes in VJPEmitter for:

  • Pullback struct struct instructions
  • Predecessor enums enum instructions

These instructions are not directly cloned from the original function and should
have auto-generated locations.

Resolves SR-12887: debug scope error for VJPEmitter-generated functions.

@dan-zheng
Copy link
Collaborator Author

@gottesmm: would you like to sanity check this PR? It should not be controversial.

@dan-zheng
Copy link
Collaborator Author

@swift-ci Please test

Copy link
Member

@rxwei rxwei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: [dynamic_lifetime], not [dynamic_replacement].

@dan-zheng dan-zheng changed the title [SIL] Fix alloc_stack [dynamic_replacement] attribute cloning. [SIL] Fix alloc_stack [dynamic_lifetime] attribute cloning. May 27, 2020
@dan-zheng
Copy link
Collaborator Author

@swift-ci Please test

@swift-ci
Copy link
Collaborator

Build failed
Swift Test Linux Platform
Git Sha - de31fab9c6f18fadb29872dcefaac4dd6e8affb8

@swift-ci
Copy link
Collaborator

Build failed
Swift Test OS X Platform
Git Sha - de31fab9c6f18fadb29872dcefaac4dd6e8affb8

@dan-zheng
Copy link
Collaborator Author

@swift-ci Please test

@swift-ci
Copy link
Collaborator

Build failed
Swift Test OS X Platform
Git Sha - 8563a3a78e588a78bc01ae447ee38686b3d5f0a0

@swift-ci
Copy link
Collaborator

Build failed
Swift Test Linux Platform
Git Sha - 8563a3a78e588a78bc01ae447ee38686b3d5f0a0

@dan-zheng dan-zheng changed the title [SIL] Fix alloc_stack [dynamic_lifetime] attribute cloning. [AutoDiff] Fix differentiation crashes related to definite initialization. May 27, 2020
@dan-zheng
Copy link
Collaborator Author

The test for verification error SR-12886 added in the first commit revealed a second verification error SR-12887, so I pushed a fix for that too.

Updated PR title and description.

@dan-zheng
Copy link
Collaborator Author

@swift-ci Please test

@swift-ci
Copy link
Collaborator

Build failed
Swift Test Linux Platform
Git Sha - 6f5d4ccd3da998c1ab1addcd5b0039ddcf3ee768

@swift-ci
Copy link
Collaborator

Build failed
Swift Test OS X Platform
Git Sha - 6f5d4ccd3da998c1ab1addcd5b0039ddcf3ee768

@dan-zheng
Copy link
Collaborator Author

@swift-ci Please test

@swift-ci
Copy link
Collaborator

Build failed
Swift Test OS X Platform
Git Sha - 1017baa246b3702f4a0c97173be87eeaee488c04

@dan-zheng
Copy link
Collaborator Author

Unrelated llvm macOS CI error.
@swift-ci Please test macOS

@swift-ci
Copy link
Collaborator

Build failed
Swift Test Linux Platform
Git Sha - 1017baa246b3702f4a0c97173be87eeaee488c04

@dan-zheng
Copy link
Collaborator Author

Linux CI appears to have flaked while building SwiftPM.
@swift-ci Please test Linux

@swift-ci
Copy link
Collaborator

Build failed
Swift Test Linux Platform
Git Sha - 1017baa246b3702f4a0c97173be87eeaee488c04

@swift-ci
Copy link
Collaborator

Build failed
Swift Test OS X Platform
Git Sha - 1017baa246b3702f4a0c97173be87eeaee488c04

@dan-zheng
Copy link
Collaborator Author

Linux and macOS platform tests have both flaked multiple times. I'll try smoke tests instead.

@dan-zheng
Copy link
Collaborator Author

@swift-ci Please smoke test

@dan-zheng
Copy link
Collaborator Author

@swift-ci Please smoke test

Make `SILCloner:visitAllocStack` correctly propagate the `[dynamic_lifetime]`
attribute.

Resolves SR-12886: differentiation transform error related to the `VJPEmitter`
subclass of `SILCloner`.
Fix SIL locations and debug scopes in `VJPEmitter` for:
- Pullback struct `struct` instructions
- Predecessor enums `enum` instructions

These instructions are not directly cloned from the original function and should
have auto-generated locations.

Resolves SR-12887: debug scope error for `VJPEmitter`-generated function.
@dan-zheng
Copy link
Collaborator Author

@swift-ci Please smoke test Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants