Xuehai Pan
6d5c789ad5
[BE][PYFMT] migrate PYFMT for test/[a-h]*/ to ruff format ( #144555 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/144555
Approved by: https://github.com/ezyang
ghstack dependencies: #144551 , #144554
2025-06-24 04:53:54 +00:00
Guilherme Leobas
a4459cd4e3
Remove property from python_type function ( #152900 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152900
Approved by: https://github.com/amjames , https://github.com/anijain2305
ghstack dependencies: #153070
2025-05-13 16:26:25 +00:00
Guilherme Leobas
ae1e51b6ad
Add infra to run CPython tests under Dynamo ( #150787 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/150787
Approved by: https://github.com/zou3519
2025-05-07 04:03:14 +00:00
PyTorch MergeBot
103fe856e1
Revert "Add infra to run CPython tests under Dynamo ( #150787 )"
...
This reverts commit 7c96dd8f0c .
Reverted https://github.com/pytorch/pytorch/pull/150787 on behalf of https://github.com/huydhn due to Sorry for reverting your change but a failed test is showing up in trunk ([comment](https://github.com/pytorch/pytorch/pull/150787#issuecomment-2852818113 ))
2025-05-06 00:20:02 +00:00
Guilherme Leobas
7c96dd8f0c
Add infra to run CPython tests under Dynamo ( #150787 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/150787
Approved by: https://github.com/zou3519
2025-05-05 17:20:14 +00:00
Jason Ansel
15a3f58f91
Return ConstantVariable(None) from WithExitFunctionVariable.exit to prevent NoneType crash inside autocast exception path ( #152503 )
...
Copy of #152013 with PR time benchmarks updated (regressions seem unrelated)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/152503
Approved by: https://github.com/anijain2305 , https://github.com/Skylion007
Co-authored-by: Witold Dziurdz <wdziurdz@habana.ai>
2025-05-01 04:01:24 +00:00
Guilherme Leobas
f3b2fb6c66
Allow trace through unittest ( #146500 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/146500
Approved by: https://github.com/anijain2305
2025-04-08 14:55:17 +00:00
Guilherme Leobas
cbc901fac3
Implement raise ... from ... ( #148766 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/148766
Approved by: https://github.com/zou3519
2025-04-03 13:15:31 +00:00
Guilherme Leobas
daff65d671
Correctly propagate exception to parent tx ( #146502 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/146502
Approved by: https://github.com/anijain2305 , https://github.com/williamwen42 , https://github.com/zou3519
ghstack dependencies: #146504 , #146499
2025-03-11 18:55:45 +00:00
Guilherme Leobas
fb53e9e514
Add __context/cause/suppress_context/traceback__ to Exception ( #146499 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/146499
Approved by: https://github.com/zou3519 , https://github.com/anijain2305
ghstack dependencies: #146504
2025-03-11 18:55:45 +00:00
Guilherme Leobas
4e7d264cf8
Introduce UserDefinedExceptionClassVariable ( #146504 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/146504
Approved by: https://github.com/anijain2305
2025-03-11 18:55:45 +00:00
William Wen
4caeede799
[dynamo] more better error messages [3/N] ( #147494 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/147494
Approved by: https://github.com/jansel , https://github.com/zou3519
2025-02-28 06:23:28 +00:00
Guilherme Leobas
134723ee1c
Add WITH_EXCEPT_START opcode ( #146492 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/146492
Approved by: https://github.com/anijain2305 , https://github.com/zou3519
ghstack dependencies: #146498
2025-02-14 13:37:23 +00:00
Guilherme Leobas
8603a1c870
Suport generators ( #141055 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/141055
Approved by: https://github.com/zou3519
2025-02-08 22:42:12 +00:00
Animesh Jain
1de41e6918
[dynamo][exceptions][3.10] Clean symbolic stack on exception handling ( #146198 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/146198
Approved by: https://github.com/williamwen42
ghstack dependencies: #146062
2025-02-01 02:51:44 +00:00
Animesh Jain
56307dc370
[dynamo][dicts] Raise exception on pop ( #145986 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/145986
Approved by: https://github.com/Skylion007 , https://github.com/williamwen42 , https://github.com/StrongerXi , https://github.com/jansel
2025-01-31 00:47:13 +00:00
Colin L. Rice
926f9056a9
speculation_log: Raise a unique error for divergence issues ( #144785 )
...
This is primarily sent for discussion and to see what tests fail due to
this. The idea is that rather than capturing this as a regex on the
fail_reason, just give it a unique failure type
Pull Request resolved: https://github.com/pytorch/pytorch/pull/144785
Approved by: https://github.com/ezyang
2025-01-16 00:49:43 +00:00
Tom Ritchford
d25e6e623f
Fix unused Python variables in test/[a-d]* ( #134665 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134665
Approved by: https://github.com/albanD
2024-12-13 22:13:12 +00:00
Edward Z. Yang
208442ea18
Don't setup try-except handler when Dynamo compiling ( #133239 )
...
The reraise is not supported and so this just gunks up our actual exception handling. You can trigger this by hitting an exception inside of an NN module that has hooks on it. You end up graph breaking on the reraise here, and losing the inner stack trace from the actual exception that was raised.
This might be kind of controversial. An alternate strategy is to support reraises in Dynamo or something but IDK this doesn't feel like the right place to apply force.
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133239
Approved by: https://github.com/anijain2305
2024-09-01 22:26:46 +00:00
Animesh Jain
fb35d1e01f
[raland][dynamo][exceptions] Support raise from None ( #134621 )
...
The PR was reverted because this PR traced more code and surfaced a latent bug. Resubmitting w/o any changes.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134621
Approved by: https://github.com/jansel
ghstack dependencies: #134610 , #134590
2024-08-29 09:14:42 +00:00
Animesh Jain
2446dead35
[dynamo][exceptions] Use exception subclass whenever possible ( #134610 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134610
Approved by: https://github.com/drisspg , https://github.com/jansel
2024-08-29 09:14:42 +00:00
PyTorch MergeBot
f0fceed432
Revert "[dynamo][exceptions] Use exception subclass whenever possible ( #134610 )"
...
This reverts commit 880e3d18a4 .
Reverted https://github.com/pytorch/pytorch/pull/134610 on behalf of https://github.com/ZainRizvi due to Sorry, I had to revert this in order to revert another PR ([comment](https://github.com/pytorch/pytorch/pull/134610#issuecomment-2316568553 ))
2024-08-29 02:02:12 +00:00
PyTorch MergeBot
40cebde3bc
Revert "[raland][dynamo][exceptions] Support raise from None ( #134621 )"
...
This reverts commit e96dc3665a .
Reverted https://github.com/pytorch/pytorch/pull/134621 on behalf of https://github.com/ZainRizvi due to Sorry, I had to revert this in order to revert another PR ([comment](https://github.com/pytorch/pytorch/pull/134610#issuecomment-2316568553 ))
2024-08-29 02:02:12 +00:00
Animesh Jain
e96dc3665a
[raland][dynamo][exceptions] Support raise from None ( #134621 )
...
The PR was reverted because this PR traced more code and surfaced a latent bug. Resubmitting w/o any changes.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134621
Approved by: https://github.com/jansel
ghstack dependencies: #134610 , #134590
2024-08-28 07:35:23 +00:00
Animesh Jain
880e3d18a4
[dynamo][exceptions] Use exception subclass whenever possible ( #134610 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134610
Approved by: https://github.com/drisspg , https://github.com/jansel
2024-08-28 07:35:12 +00:00
Shuai Yang
de57a6e806
Back out "[dynamo][exception] Support raise exception from None ( #134028 )" ( #134513 )
...
Summary:
The original diff is causing the error "attempting to assign a gradient with dtype 'c10::BFloat16' to a tensor with dtype ‘float".
The context is in: https://fb.workplace.com/groups/1075192433118967/permalink/1491357138169159/
Test Plan: After reverting, the above issue is gone, details are in https://fb.workplace.com/groups/1075192433118967/permalink/1491357138169159/
Differential Revision: D61820520
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134513
Approved by: https://github.com/anijain2305
2024-08-27 02:57:14 +00:00
Animesh Jain
0d79f67a25
[dynamo][exception] Support raise exception from None ( #134028 )
...
Fixes https://github.com/pytorch/pytorch/issues/132362
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134028
Approved by: https://github.com/yanboliang
2024-08-21 12:48:35 +00:00
Animesh Jain
8a2b064236
[dynamo][user_defined][stable-diffusion] Raise ObservedAttributeError on UserDefinedObject var_getattr ( #132806 )
...
Fixes https://github.com/pytorch/pytorch/issues/132551
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132806
Approved by: https://github.com/williamwen42
2024-08-16 04:30:06 +00:00
Edward Z. Yang
90d2593b3e
Revert #132806 , #132736 , #132539 , #132487 ( #133570 )
...
This reverts commit 25df063f04 .
This reverts commit de00c79583 .
This reverts commit 419b76c4ac .
This reverts commit bc57d5b6ff .
Differential Revision: [D61335013](https://our.internmc.facebook.com/intern/diff/D61335013 )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133570
Approved by: https://github.com/albanD , https://github.com/jansel , https://github.com/anijain2305
2024-08-15 20:54:21 +00:00
Animesh Jain
25df063f04
[dynamo][user_defined][stable-diffusion] Raise ObservedAttributeError on UserDefinedObject var_getattr ( #132806 )
...
Fixes https://github.com/pytorch/pytorch/issues/132551
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132806
Approved by: https://github.com/williamwen42
2024-08-07 18:19:49 +00:00
Animesh Jain
6c4ce4331c
[dynamo][exception] Raise Observed KeyError exception for dict __getitem__ ( #132425 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132425
Approved by: https://github.com/yanboliang , https://github.com/Skylion007
2024-08-02 02:58:31 +00:00
Oguz Ulgen
920f0426ae
Add None return type to init -- tests rest ( #132376 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132376
Approved by: https://github.com/jamesjwu
ghstack dependencies: #132335 , #132351 , #132352
2024-08-01 15:44:51 +00:00
Guilherme Leobas
e0e4e84ef9
wrap self.call_function(...) in try finally block to undo changes to self.kw_names ( #130490 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130490
Approved by: https://github.com/williamwen42 , https://github.com/zou3519
ghstack dependencies: #129091
2024-07-29 15:41:03 +00:00
Xuehai Pan
918ece4f4d
[BE][Easy][11/19] enforce style for empty lines in import segments in test/dy*/ ( #129762 )
...
See https://github.com/pytorch/pytorch/pull/129751#issue-2380881501 . Most changes are auto-generated by linter.
You can review these PRs via:
```bash
git diff --ignore-all-space --ignore-blank-lines HEAD~1
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129762
Approved by: https://github.com/anijain2305
2024-07-27 17:43:53 +00:00
Animesh Jain
11673851d9
[dynamo][exception][bugfix] Add a pop for < 3.11 version ( #131795 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131795
Approved by: https://github.com/yanboliang
2024-07-25 23:33:19 +00:00
Animesh Jain
6850e42266
[dynamo][exception] Remove older specialization for StopIteration ( #131512 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131512
Approved by: https://github.com/yanboliang
ghstack dependencies: #131347 , #131367 , #131378 , #131389 , #131405 , #131480
2024-07-24 00:06:53 +00:00
PyTorch MergeBot
c49f909aab
Revert "wrap self.call_function(...) in try finally block to undo changes to self.kw_names ( #130490 )"
...
This reverts commit a8bd2933d9 .
Reverted https://github.com/pytorch/pytorch/pull/130490 on behalf of https://github.com/clee2000 due to test_jit started failing on main after this stack https://github.com/pytorch/pytorch/actions/runs/9980754603/job/27583474357 a8bd2933d9 ([comment](https://github.com/pytorch/pytorch/pull/129091#issuecomment-2234269541 ))
2024-07-17 20:59:40 +00:00
Guilherme Leobas
a8bd2933d9
wrap self.call_function(...) in try finally block to undo changes to self.kw_names ( #130490 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130490
Approved by: https://github.com/williamwen42 , https://github.com/zou3519
ghstack dependencies: #129091
2024-07-17 20:07:06 +00:00
Animesh Jain
4aa7a1efcf
[dynamo] Initial exception handling support ( #126923 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/126923
Approved by: https://github.com/williamwen42 , https://github.com/jansel
2024-06-01 13:00:32 +00:00