Skip to content

[AutoDiff] Ensure adjoint buffer of unchecked_take_enum_data_addr is zeroed after value is accumulated #58457

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
Apr 27, 2022

Conversation

asl
Copy link
Contributor

@asl asl commented Apr 27, 2022

This is yet another optional-related bug. It could be triggered if unchecked_take_enum_data_addr is inside a loop. In such case the accumulated value of adjoint buffer would be re-used in the subsequent loop iterations producing wrong results.

Fixes #58353 (SR16094)

@asl asl changed the title Ensure adjoint buffer of unchecked_take_enum_data_addr is zeroed after value is accumulated [AutoDiff] Ensure adjoint buffer of unchecked_take_enum_data_addr is zeroed after value is accumulated Apr 27, 2022
@asl
Copy link
Contributor Author

asl commented Apr 27, 2022

Tagging @rxwei @BradLarson

@rxwei
Copy link
Contributor

rxwei commented Apr 27, 2022

@swift-ci please test

@asl
Copy link
Contributor Author

asl commented Apr 27, 2022

@compnerd Interesting enough, windows tests say that "No test results found". Though looks like all tests were run and succeeded. Is this expected?

@compnerd
Copy link
Member

@asl - that is .... interesting; @shahmishal can we get that sorted out please?

But, yes, it seems that the tests passed, so that should be good.

@rxwei rxwei merged commit 11dd84e into swiftlang:main Apr 27, 2022
@asl asl deleted the sr16094-2 branch April 27, 2022 19:05
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.

[SR-16094] [AutoDiff] Incorrect gradients produced from certain generic functions
3 participants