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] Handle mutable for loop index #7778

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

erizmr
Copy link
Contributor

@erizmr erizmr commented Apr 10, 2023

Issue: #7771

Brief Summary

🤖 Generated by Copilot at 30ef20b

This pull request enhances the automatic differentiation (AD) pass to handle more complex for loops. It fixes some aliasing and consistency issues in taichi/transforms/auto_diff.cpp, and adds a new test case in tests/python/test_ad_for.py to verify the correctness of the AD pass on nested and mutable loop indices.

Walkthrough

🤖 Generated by Copilot at 30ef20b

  • Add a method to check if a statement is a mutable loop index and modify the condition for promoting statements to local variables in the AD pass (link, link)
  • Add a method to mark local variables that are used as loop boundaries as needing AD stack allocation (link)
  • Add a logic to clone and insert AD stack load statements before the loop execution in the adjoint program (link)
  • Add a test case to test_ad_for.py to check the correctness of the AD pass on nested for loops with mutable indices (link)

@netlify
Copy link

netlify bot commented Apr 10, 2023

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit f737baf
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/6433cfb2b2056a00088e2cfa
😎 Deploy Preview https://deploy-preview-7778--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.

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.

1 participant