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

Fix nested accelerate with grad #1156

Merged
merged 3 commits into from
Sep 25, 2024

Conversation

erick-xanadu
Copy link
Contributor

@erick-xanadu erick-xanadu commented Sep 25, 2024

Context: Fixes taking the gradient of nested accelerate calls.

Description of the Change: Takes advantage of accelerate context to let JAX do its thing.

Benefits: Fixes bug.

Possible Drawbacks: I think a better way to do this would be to have is_tracing to return False. However, that would involve refactoring the current tracing context. Maybe a possible follow up.

Related GitHub Issues: Fixes #1086

@erick-xanadu erick-xanadu marked this pull request as ready for review September 25, 2024 16:18
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.86%. Comparing base (fe5e6ae) to head (0130660).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1156   +/-   ##
=======================================
  Coverage   97.86%   97.86%           
=======================================
  Files          76       76           
  Lines       10811    10811           
  Branches     1281     1281           
=======================================
  Hits        10580    10580           
  Misses        179      179           
  Partials       52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Thanks Erick :)

@erick-xanadu erick-xanadu merged commit e191db5 into main Sep 25, 2024
43 checks passed
@erick-xanadu erick-xanadu deleted the eochoa/2024-09-25/fix-nested-acc-grad branch September 25, 2024 17:37
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.

[Feature] Nested calls to accelerate should behave like nested jax.jit functions.
2 participants