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] Clear adjoint after global store #6579

Merged
merged 6 commits into from
Nov 17, 2022

Conversation

erizmr
Copy link
Contributor

@erizmr erizmr commented Nov 11, 2022

To avoid invalid grad accumulation, adjoints of fields on left-hand sides of assignments (GlobalStoreStmt) need to be reset to zero after the corresponding adjoint assignments.

@netlify
Copy link

netlify bot commented Nov 11, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit 2d94a29
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/63735a3141863400084f1950
😎 Deploy Preview https://deploy-preview-6579--docsite-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@erizmr erizmr requested a review from ailzhang November 14, 2022 07:52
Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

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

Nice!

tests/python/test_offline_cache.py Show resolved Hide resolved
tests/python/test_loop_grad.py Show resolved Hide resolved
@erizmr
Copy link
Contributor Author

erizmr commented Nov 15, 2022

/rebase

Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

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

Thanks!

@erizmr erizmr merged commit 3a5036a into taichi-dev:master Nov 17, 2022
@erizmr erizmr deleted the ad_fix_global_store branch November 17, 2022 03:15
erizmr added a commit that referenced this pull request Dec 10, 2022
Issue: #6733 

The the grad field of variable at the left side of the global store will
be cleared after #6579. Change to atomic add sort the issue.
quadpixels pushed a commit to quadpixels/taichi that referenced this pull request May 13, 2023
To avoid invalid grad accumulation, adjoints of fields on left-hand
sides of assignments (GlobalStoreStmt) need to be reset to zero after
the corresponding adjoint assignments.

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
quadpixels pushed a commit to quadpixels/taichi that referenced this pull request May 13, 2023
Issue: taichi-dev#6733 

The the grad field of variable at the left side of the global store will
be cleared after taichi-dev#6579. Change to atomic add sort the issue.
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.

2 participants