Skip to content

[scan] Autograd#135631

Open
bohnstingl wants to merge 21 commits intopytorch:gh/ydwu4/153/headfrom
bohnstingl:scan_autograd2
Open

[scan] Autograd#135631
bohnstingl wants to merge 21 commits intopytorch:gh/ydwu4/153/headfrom
bohnstingl:scan_autograd2

Conversation

@bohnstingl
Copy link
Copy Markdown
Collaborator

@bohnstingl bohnstingl commented Sep 10, 2024

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Sep 10, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/135631

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit fc2f4c0 with merge base 386884e (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Comment thread torch/_inductor/ir.py Outdated
Copy link
Copy Markdown
Contributor

@ydwu4 ydwu4 left a comment

Choose a reason for hiding this comment

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

Overall we're on the right track! Add a few comments. The additonal_inputs would need some special handling and some more testing.

Comment thread torch/_higher_order_ops/scan.py Outdated
Comment thread torch/_higher_order_ops/scan.py Outdated
Comment thread torch/_higher_order_ops/scan.py Outdated
Comment thread torch/_higher_order_ops/scan.py
Comment thread torch/_higher_order_ops/scan.py Outdated
g_c_T = flat_grads[:num_leaves_init]
g_ys = flat_grads[num_leaves_init:]

if reverse:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mind adding a comment for this? To explain how we handle reverse?

Comment thread torch/_higher_order_ops/scan.py Outdated
Comment thread torch/_higher_order_ops/scan.py
Comment thread torch/_higher_order_ops/scan.py Outdated
Comment thread torch/_higher_order_ops/scan.py
Comment thread torch/_higher_order_ops/scan.py Outdated
Comment thread torch/_higher_order_ops/scan.py Outdated
Comment thread torch/_higher_order_ops/scan.py
Comment thread torch/_higher_order_ops/scan.py Outdated
Comment thread torch/_higher_order_ops/utils.py Outdated
Comment thread torch/_higher_order_ops/scan.py Outdated
Comment thread torch/_higher_order_ops/scan.py
Comment thread torch/_higher_order_ops/scan.py
Comment thread test/functorch/test_control_flow.py
Comment thread torch/_higher_order_ops/scan.py Outdated
Comment thread torch/_higher_order_ops/scan.py
Added checks for the case if not all variables in Autograd require gradients. Not yet handled
@ydwu4 ydwu4 added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 15, 2024
@github-actions
Copy link
Copy Markdown
Contributor

Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as Stale.
Feel free to remove the Stale label if you feel this was a mistake.
If you are unable to remove the Stale label please contact a maintainer in order to do so.
If you want the bot to never mark this PR stale again, add the no-stale label.
Stale pull requests will automatically be closed after 30 days of inactivity.

@github-actions github-actions Bot added the Stale label Nov 15, 2024
@bohnstingl
Copy link
Copy Markdown
Collaborator Author

@pytorchbot label "no-stale"

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Nov 15, 2024

❌ 🤖 pytorchbot command failed:

@pytorchbot: error: argument command: invalid choice: 'add' (choose from 'merge', 'revert', 'rebase', 'label', 'drci', 'cherry-pick', 'close')

usage: @pytorchbot [-h] {merge,revert,rebase,label,drci,cherry-pick,close} ...

Try @pytorchbot --help for more info.

@pytorch-bot pytorch-bot Bot added the no-stale label Nov 15, 2024
@bohnstingl bohnstingl changed the title Autograd for scan [scan] Autograd Nov 19, 2024
@bohnstingl
Copy link
Copy Markdown
Collaborator Author

This PR will be combined with bohnstingl#4 and pursued further in #146285

@github-actions github-actions Bot deleted the branch pytorch:gh/ydwu4/153/head February 23, 2025 02:09
pytorchmergebot pushed a commit that referenced this pull request Apr 14, 2025
This PR introduces the Autograd feature for scan with partial gradient support. It is a combination of the already opened PRs: #135631 and bohnstingl#4

Pull Request resolved: #146285
Approved by: https://github.com/ydwu4

Co-authored-by: Yidi Wu <yidi@meta.com>
timocafe pushed a commit to timocafe/pytorch that referenced this pull request Apr 16, 2025
This PR introduces the Autograd feature for scan with partial gradient support. It is a combination of the already opened PRs: pytorch#135631 and bohnstingl#4

Pull Request resolved: pytorch#146285
Approved by: https://github.com/ydwu4

Co-authored-by: Yidi Wu <yidi@meta.com>
amathewc pushed a commit to amathewc/pytorch that referenced this pull request Apr 17, 2025
This PR introduces the Autograd feature for scan with partial gradient support. It is a combination of the already opened PRs: pytorch#135631 and bohnstingl#4

Pull Request resolved: pytorch#146285
Approved by: https://github.com/ydwu4

Co-authored-by: Yidi Wu <yidi@meta.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants