-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[AutoDiff] Change cross-file derivative registration to a frontend flag. #29339
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
Merged
dan-zheng
merged 2 commits into
swiftlang:tensorflow
from
dan-zheng:retrodiff-frontend-flag
Jan 23, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
test/AutoDiff/downstream/cross_module_derivative_attr_e2e.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
test/AutoDiff/downstream/derivative_registration_foreign/main.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You do not need
-Xfrontend
when using the frontend.swiftc -enable-experimental...
orswift -enable-experimental...
should just work.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing
-Xfrontend
from thisRUN
line doesn't work, I tried it.This was unexpected to me too (
swift -enable-experimental...
doesn't always work), I noticed it for a while. Perhaps the options aren't registered properly inOptions.td
- we can investigate more later.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct, the frontend flags are unsupported options, that is, they are within the purview of the compiler and may be changed at anytime (including having the behavior be entirely the opposite of the previous release). If you are using the driver (that is
swiftc
) you must specify-Xfrontend
for the flag.For this option, I believe that the current approach is desirable anyways as longer term we would like to remove the
-enable-experimental-cross-file-derivative-registration
flag and simply enable it unconditionally.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rxwei I think that the confusion here may be related to the use of
%target-build-swift
which actually uses the driver and not the frontend.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I normally use
%target-swift-frontend
. Is there a reason we need to use%target-build-swift
here, @dan-zheng ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%target-build-swift
is closer to how normal swift compilation works, making the test more realistic so that it catches more bugs. I don't know exactly what the differences are, but I have observed that some symbols that are visible when you compile with%target-swift-frontend
are actually hidden when you compile normally. Also,%target-build-swift
respectsswift_test_mode=optimize
, so that it tests both-Onone
and-O
compilation.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!