Skip to content

[AutoDiff] Properly collect inout parameter adjoints #41559

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
merged 1 commit into from
Feb 25, 2022

Conversation

asl
Copy link
Contributor

@asl asl commented Feb 25, 2022

Apparently, the parameter index calculation in #37861 was not always correct in presence of other pullback parameters (e.g. captures and non-differentiated args). Collect all inout parameters and collect inout parameter adjoints correctly.

Resolves SR-15891

Apparently, the parameter index calculation in swiftlang#37861 was not always
correct in presence of other pullback parameters (e.g. captures and
non-differentiated args). Collect all inout parameters and collect
inout parameter adjoints correctly.

Fixes SR-15891
@asl
Copy link
Contributor Author

asl commented Feb 25, 2022

Tagging @BradLarson @rxwei

@asl asl changed the title Properly collect inout parameter adjoints [AutoDiff] Properly collect inout parameter adjoints Feb 25, 2022
@philipturner
Copy link
Contributor

Is SR-15793 related to this? It seems to stem from incorrect index calculation, and it has a nested pullback calculation involving an inout parameter. The inout resides in the inner function, unlike SR-15891 where inout is in the outer function's parameter list. I tested the bug's reproducer and this PR's current commits have not changed its behavior.

@asl
Copy link
Contributor Author

asl commented Feb 25, 2022

Well, if it did not change the behavior, then it is not related...

Copy link
Contributor

@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.

Thanks @asl

@rxwei
Copy link
Contributor

rxwei commented Feb 25, 2022

@swift-ci please test

@rxwei rxwei merged commit 4b7baf0 into swiftlang:main Feb 25, 2022
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.

3 participants