Repository navigation
[dynamo] Migrate AutogradFunctionContextVariable methods - #195179
AayushMainali-Github wants to merge 2 commits into
Conversation
The context methods were dispatched through a hand-written name if-chain. Register them in tp_methods so named-method dispatch is declarative while retaining the existing handlers. Test Plan: ``` git diff --check python -m py_compile torch/_dynamo/variables/misc.py ``` AI-assisted implementation; reviewed and approved by the contributor.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/195179
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 9f781e1 with merge base 6a211a9 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
@pytorchbot label "topic: not user facing" |
Address review on #195179: mark_dirty and mark_non_differentiable now use no_keywords instead of raise_args_mismatch, matching CPython's _PyArg_NoKeywords and the other tp_methods handlers. Sync the graph-break registry for the hardcoded context strings from the migration. Test Plan: ``` git diff --check python -m py_compile torch/_dynamo/variables/misc.py lintrunner --skip PYREFLY,CLANGTIDY,CLANGTIDY_EXECUTORCH_COMPATIBILITY,CLANGFORMAT torch/_dynamo/variables/misc.py python test/dynamo/test_autograd_function.py AutogradFunctionTests python test/dynamo/test_autograd_function.py AutogradFunctionFunctorchTests ``` AI-assisted.
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: torchtitan-test / torchtitan-x-pytorch-test / test (torchtitan_models_integration, 1, 1, mt-l-x86aavx2-189-704-a10g-8) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 1 checks: torchtitan-test / torchtitan-x-pytorch-test / test (torchtitan_models_integration, 1, 1, mt-l-x86aavx2-189-704-a10g-8) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
) ## Summary Migrate `AutogradFunctionContextVariable` off a `call_method` if-chain onto declarative `tp_methods`, as in pytorch#195165. `save_for_backward`, `mark_dirty`, and `mark_non_differentiable` are now `Method` handlers. Part of pytorch#195165 (does not close the umbrella). ## Test plan - [x] `git diff --check` - [x] `python -m py_compile torch/_dynamo/variables/misc.py` > AI-assisted implementation. Pull Request resolved: pytorch#195179 Approved by: https://github.com/guilhermeleobas
Summary
Migrate
AutogradFunctionContextVariableoff acall_methodif-chain onto declarativetp_methods, as in #195165.save_for_backward,mark_dirty, andmark_non_differentiableare nowMethodhandlers.Part of #195165 (does not close the umbrella).
Test plan
git diff --checkpython -m py_compile torch/_dynamo/variables/misc.pycc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @kadeng @chauhang @amjames @jataylo @azahed98