Animesh Jain
e80fe7f13a
[dynamo][guards] Skip guards on empty nn module hooks ( #138942 )
...
This brings some unsoundness in guards. Earlier we were skipping empty nn module hooks dict guard only on inbuilt nn modules, but as seen in https://github.com/pytorch/pytorch/issues/138386 , there could be still be significant guard overhead. With this PR, we reduce the guard eval latency from 420 us to 280 us (1.5x reduction).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/138942
Approved by: https://github.com/ezyang , https://github.com/jansel
ghstack dependencies: #139040 , #138954
2024-10-29 02:11:47 +00:00
Animesh Jain
cfdf658a91
[dynamo][modules] Support overridden __call__ on nn modules ( #138619 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/138619
Approved by: https://github.com/williamwen42
ghstack dependencies: #138657
2024-10-24 03:49:26 +00:00
Tom Ritchford
e1c4548441
[dynamo] Simplify creation of VariableTrackers ( #135714 )
...
## `VariableTracker::build()` hides the Builders
### The problem
In the current code, creating a `VariableTracker` involves choosing one of two `Builder` classes and either calling a method, or calling a constructor that creates an object that you immediately call, [like this](083c9149b7/torch/_dynamo/variables/functions.py (L761-L768) ).
Variations on this code are repeated in many places.
More, the `Builder` classes have a lot of dependencies, so they have to be loaded late in the whole import process to avoid circular imports, so they end up being repeatedly imported at local scope.
### The solution
In this commit, the import from `builder` and the logic of choosing and calling the Builder class are hidden in a single static factory method, `VariableTracker.build()`, easier to reason about and to import.
This commit net lowers the total lines of code by over 150 lines by removing repetitive logic and unnecessary local imports.
**CHANGES:** Originally the name of the static method was `VariableTracker.create()` but a static method on a derived class, `LazyVariableTracker.create()` now exists with a different signature that's irreconcilable, so the new static method was renamed to `VariableTracker.build()`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/135714
Approved by: https://github.com/jansel
2024-10-18 09:36:46 +00:00
Avik Chaudhuri
ed55d356de
[alt] fix unroll in successive unflatten ( #137646 )
...
We use nn_module_stack in unflatten to recognize when module calls begin and end. However the current format is not sufficient to detect module call boundaries when we have successive calls to the same module, because the successive instructions (end of one call, begin of next call) have the same nn_module_stack. This causes us to effectively "unroll" successive calls to a single call. This can cause problems when preserving module call signatures because the outputs of the successive calls might be concatenated in the single call.
Previously we introduced the concept of a "call index" to generate multiple graphs when unflattening, one per call. This PR pushes this concept into nn_module_stack itself. In particular, the keys of nn_module_stack now go from `key` to `key@call_index`. (In a previous attempt, https://github.com/pytorch/pytorch/pull/137457 , instead values in nn_module_stack go from (fqn, type) to (fqn, type, call_index), which is BC-breaking.)
Note that we still do not have the ability to preserve module call signatures for multiple calls to the same module. But now instead of randomly crashing we give a proper error. OTOH when not preserving module call signatures we simply generate multiple calls, each with its own graph, possibly deduplicated, matching what we would do for non-successive calls.
Test Plan: Like D64014936
Differential Revision: D64136277
Pull Request resolved: https://github.com/pytorch/pytorch/pull/137646
Approved by: https://github.com/angelayi
2024-10-12 15:53:52 +00:00
Guilherme Leobas
e09c5b6046
Remove vt argument in raise_observed_exception ( #136037 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/136037
Approved by: https://github.com/zou3519
2024-09-24 02:36:57 +00:00
Animesh Jain
fee677eeb6
[fbode-testing][dynamo][reland][inline-inbuilt-nn-modules] Mark attri… ( #134136 )
...
Shuai wants to test this internally before https://github.com/pytorch/pytorch/pull/133713 can go in. Creating a separate PR for ghmport.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/134136
Approved by: https://github.com/yanboliang
2024-08-22 17:54:58 +00:00
PyTorch MergeBot
68425e68fe
Revert "[dynamo][reland][inline-inbuilt-nn-modules] Mark attributes of nn mod… ( #133714 )"
...
This reverts commit e8d3c4be36 .
Reverted https://github.com/pytorch/pytorch/pull/133714 on behalf of https://github.com/anijain2305 due to fails internally ([comment](https://github.com/pytorch/pytorch/pull/133714#issuecomment-2302171472 ))
2024-08-21 14:21:06 +00:00
Animesh Jain
33f1ee036e
[dynamo][user-defined] Simplify call_hasattr ( #133935 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133935
Approved by: https://github.com/williamwen42 , https://github.com/jansel
ghstack dependencies: #133745 , #133747 , #133746 , #133799 , #133800
2024-08-20 16:27:44 +00:00
Animesh Jain
e8d3c4be36
[dynamo][reland][inline-inbuilt-nn-modules] Mark attributes of nn mod… ( #133714 )
...
Relands https://github.com/pytorch/pytorch/pull/132539
Relands https://github.com/pytorch/pytorch/pull/132736
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133714
Approved by: https://github.com/jansel
2024-08-20 05:57:52 +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
Oguz Ulgen
6e79932543
Add basic mypy annotations to dynamo ( #132415 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132415
Approved by: https://github.com/XuehaiPan , https://github.com/jamesjwu
2024-08-04 18:43:36 +00:00
PyTorch MergeBot
3558a8cf4a
Revert "Add basic mypy annotations to dynamo ( #132415 )"
...
This reverts commit 71e22e0959 .
Reverted https://github.com/pytorch/pytorch/pull/132415 on behalf of https://github.com/ZainRizvi due to Sorry, this PR has entered a weird state in the diff train. Trying to revert it to skip it, and then we can try relanding it ([comment](https://github.com/pytorch/pytorch/pull/132415#issuecomment-2267631785 ))
2024-08-04 18:39:29 +00:00
Animesh Jain
419b76c4ac
[dynamo] Reland 132308, 132314, 132318, 132334 - Make builtin nn modules attributes static ( #132539 )
...
Relanding 4 PRs ending at https://github.com/pytorch/pytorch/pull/132334
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132539
Approved by: https://github.com/Skylion007 , https://github.com/yanboliang , https://github.com/mlazos
2024-08-03 02:08:22 +00:00
PyTorch MergeBot
24d0a32f98
Revert "[dynamo] Wrap unspecialized nn module getattr with UnspecializedNNModuleSource ( #132308 )"
...
This reverts commit aa0ed2496f .
Reverted https://github.com/pytorch/pytorch/pull/132308 on behalf of https://github.com/anijain2305 due to broke internal tests ([comment](https://github.com/pytorch/pytorch/pull/132308#issuecomment-2265959993 ))
2024-08-02 18:55:51 +00:00
PyTorch MergeBot
e696f17467
Revert "[dynamo] Track builtin nn modules with UnspecializedBuiltinNNModuleVariable ( #132314 )"
...
This reverts commit d6a82ce39b .
Reverted https://github.com/pytorch/pytorch/pull/132314 on behalf of https://github.com/anijain2305 due to broke internal tests ([comment](https://github.com/pytorch/pytorch/pull/132314#issuecomment-2265953367 ))
2024-08-02 18:52:38 +00:00
Oguz Ulgen
71e22e0959
Add basic mypy annotations to dynamo ( #132415 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132415
Approved by: https://github.com/XuehaiPan , https://github.com/jamesjwu
2024-08-01 20:14:25 +00:00
Animesh Jain
d6a82ce39b
[dynamo] Track builtin nn modules with UnspecializedBuiltinNNModuleVariable ( #132314 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132314
Approved by: https://github.com/yanboliang
ghstack dependencies: #132302 , #132304 , #132312 , #132308
2024-08-01 06:21:05 +00:00
Animesh Jain
aa0ed2496f
[dynamo] Wrap unspecialized nn module getattr with UnspecializedNNModuleSource ( #132308 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132308
Approved by: https://github.com/yanboliang
ghstack dependencies: #132302 , #132304 , #132312
2024-08-01 06:21:05 +00:00
Xuehai Pan
e74ba1b34a
[BE][Easy][15/19] enforce style for empty lines in import segments in torch/_d*/ ( #129767 )
...
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/129767
Approved by: https://github.com/anijain2305
2024-07-31 21:18:11 +00:00
Animesh Jain
a617919541
[dynamo] Do not guard on keys for _forward_hooks and _forward_pre_hooks ( #131682 )
...
Fixes https://github.com/pytorch/pytorch/issues/125836
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131682
Approved by: https://github.com/bdhirsh
2024-07-26 04:39:54 +00:00
Oguz Ulgen
7a42470bcb
Annotate all InstructionTranslator ( #131509 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131509
Approved by: https://github.com/zou3519
2024-07-24 23:45:53 +00:00
PyTorch MergeBot
5db5865614
Revert "Annotate all InstructionTranslator ( #131509 )"
...
This reverts commit eafbd20f23 .
Reverted https://github.com/pytorch/pytorch/pull/131509 on behalf of https://github.com/clee2000 due to sorry need to revert this to revert something else, I think you only need to rebase and remerge ([comment](https://github.com/pytorch/pytorch/pull/131509#issuecomment-2249000843 ))
2024-07-24 22:29:49 +00:00
Oguz Ulgen
b56939dae1
Annotate more InstructionTranslator ( #131680 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131680
Approved by: https://github.com/zou3519
ghstack dependencies: #131676
2024-07-24 22:14:29 +00:00
Oguz Ulgen
eafbd20f23
Annotate all InstructionTranslator ( #131509 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131509
Approved by: https://github.com/zou3519
2024-07-24 05:31:01 +00:00
Animesh Jain
e49c0acc39
[dynamo] Revert https://github.com/pytorch/pytorch/pull/130416 ( #131058 )
...
All the changes brought by the original PR have been addressed in alternative ways in the stack. Why the original PR has to be reverted requires more effort because there is some bad interaction with export.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131058
Approved by: https://github.com/williamwen42
2024-07-19 17:26:24 +00:00
Animesh Jain
ac76dd606f
[dynamo] Alternative way to skip empty hooks guards on inbuilt nn modules ( #131057 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/131057
Approved by: https://github.com/williamwen42 , https://github.com/jansel
ghstack dependencies: #131056
2024-07-19 04:42:38 +00:00
Animesh Jain
65b4163bd2
[dynamo][nn-module] Make slice getitem on nn module container sourceless ( #130852 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130852
Approved by: https://github.com/mlazos
ghstack dependencies: #130773
2024-07-17 20:17:08 +00:00
Aaron Gokaslan
53e5b8ac5b
[BE]: Update flake8-comprehensions and enable C420 ( #130699 )
...
Uses `dict.fromkeys` whenever possible as covered by flake8-comprehensions rule C420. While the ruff rule RUF025 is still in preview, flake8-comprehensions have added a new rule which covers this. Use dict.fromkeys is faster when the value being added to the dictionary is the same at every iteration and is immutable, it also removes an unnecessary dict comprehension.
This rule will be enabled with our current ruleset in RUF in 0.6 as C420.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130699
Approved by: https://github.com/lezcano , https://github.com/ezyang
2024-07-16 13:47:49 +00:00
Xuehai Pan
973037be6a
[BE][Easy] apply autofix for ruff rules unnecessary-collection-call (C408): list() / tuple() / dict() ( #130199 )
...
This PR changes the empty collection factory call to Python literals:
- `list()` -> `[]`
- `tuple()` -> `()`
- `dict()` -> `{}`
The Python literals are more performant and safer. For example, the bytecode for building an empty dictionary:
```bash
$ python3 -m dis - <<EOS
import collections
d1 = {}
d2 = dict()
dict = collections.OrderedDict
d3 = dict()
EOS
```
```text
0 0 RESUME 0
1 2 LOAD_CONST 0 (0)
4 LOAD_CONST 1 (None)
6 IMPORT_NAME 0 (collections)
8 STORE_NAME 0 (collections)
3 10 BUILD_MAP 0
12 STORE_NAME 1 (d1)
4 14 PUSH_NULL
16 LOAD_NAME 2 (dict)
18 CALL 0
26 STORE_NAME 3 (d2)
6 28 LOAD_NAME 0 (collections)
30 LOAD_ATTR 8 (OrderedDict)
50 STORE_NAME 2 (dict)
7 52 PUSH_NULL
54 LOAD_NAME 2 (dict)
56 CALL 0
64 STORE_NAME 5 (d3)
66 RETURN_CONST 1 (None)
```
The dict literal `{}` only has one bytecode `BUILD_MAP`, while the factory call `dict()` has three `PUSH_NULL + LOAD_NAME + CALL`. Also, the factory call is not safe if users override the `dict` name in `locals` or `globals` (see the example of replacing with `OrderedDict` above).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130199
Approved by: https://github.com/malfet
2024-07-11 17:30:28 +00:00
Animesh Jain
f7d7b94017
[dynamo][unspecialized-nn-module] Distinguish between user-defined and builtin nn module ( #130416 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/130416
Approved by: https://github.com/jansel
ghstack dependencies: #130285 , #130368
2024-07-11 14:13:24 +00:00
Animesh Jain
c9798d123b
[dynamo][compile-time] Manually trace torch.nn.Module.parameters ( #129583 )
...
With this PR, we are not worse than no-inlining for Dynamo-only compilation time (there is a litte bit of noise, so outlier of 0.89 is probably ok here). For most of the models, we see positive numbers because of better caching in `UserDefinedObjectVariable`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/129583
Approved by: https://github.com/jansel
2024-06-27 06:06:04 +00:00
Animesh Jain
c4dd752d97
[dynamo][compile-time][inlining-inbuilt-nn-modules] Manually implement nn.Module._call_impl ( #129285 )
...
# Compile time for eager backend
## AlbertForMaskedLM
No inlining - 3.65 seconds
Inlining on main - 7.48 seconds
Inlining + this PR - 2.86 seconds
## MobileBertForMaskedLM
No inlining - 26.90 seconds
Inlining on main - 48.21 seconds
Inlining + this PR - 24.25 seconds
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129285
Approved by: https://github.com/jansel
ghstack dependencies: #129316 , #129315
2024-06-25 01:31:26 +00:00
Animesh Jain
514f9279f8
[dynamo][compile-time] Manually implement nn.Module.__getattr__ to reduce compile time ( #129315 )
...
# Compile time for eager backend
## AlbertForMaskedLM
No inlining - 3.65 seconds
Inlining on main - 7.48 seconds
Inlining + this PR - 6.70 seconds
## MobileBertForMaskedLM
No inlining - 26.90 seconds
Inlining on main - 48.21 seconds
Inlining + this PR - 43.85 seconds
*Next PR in the stack makes the total compile time better/comparable to no inlining*
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129315
Approved by: https://github.com/jansel
ghstack dependencies: #129316
2024-06-25 01:31:26 +00:00
Animesh Jain
17d1723aee
[dynamo][unspecialized-nn-modules] Remove dead (also incorrect) code ( #129316 )
...
This code is unused because we just inline the `.parameters` call. The code was also wrong because side-effects only track the first level of mutations. An object might not marked mutated if one of the child objects (like a dict) is mutated.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129316
Approved by: https://github.com/jansel
2024-06-23 03:02:27 +00:00
Animesh Jain
c0b87afcad
[RELAND2][dynamo][nn-modules] Trace through nn.Module dunder methods for UnspecializedNNModule ( #126578 )
...
Tracing through `__init__` is important because it initializes (calls STORE_ATTR) on members. By doing that, we kick in the mutation tracking for these objects. So, things like mutating `_modules` etc is tracked automatically.
Fixes https://github.com/pytorch/pytorch/issues/111837
Pull Request resolved: https://github.com/pytorch/pytorch/pull/126578
Approved by: https://github.com/jansel
2024-06-12 04:09:23 +00:00
PyTorch MergeBot
adb699189b
Revert "[RELAND][dynamo][nn-modules] Trace through nn.Module dunder methods for UnspecializedNNModule ( #126578 )"
...
This reverts commit b2d602306a .
Reverted https://github.com/pytorch/pytorch/pull/126578 on behalf of https://github.com/clee2000 due to failed internal test D58394084. Author has forward fix but includes external changes so reverting is a bit easier to coordinate ([comment](https://github.com/pytorch/pytorch/pull/126578#issuecomment-2161481839 ))
2024-06-11 19:41:41 +00:00
Animesh Jain
b2d602306a
[RELAND][dynamo][nn-modules] Trace through nn.Module dunder methods for UnspecializedNNModule ( #126578 )
...
Tracing through `__init__` is important because it initializes (calls STORE_ATTR) on members. By doing that, we kick in the mutation tracking for these objects. So, things like mutating `_modules` etc is tracked automatically.
Fixes https://github.com/pytorch/pytorch/issues/111837
Pull Request resolved: https://github.com/pytorch/pytorch/pull/126578
Approved by: https://github.com/jansel
ghstack dependencies: #128295
2024-06-10 23:11:04 +00:00
Animesh Jain
05711eece9
[dynamo][inlining inbuilt modules] Ensure BC for nn_module_stack ( #128295 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/128295
Approved by: https://github.com/ydwu4
2024-06-10 23:11:04 +00:00
PyTorch MergeBot
44371bd432
Revert "[dynamo][nn-modules] Trace through nn.Module dunder methods for UnspecializedNNModule ( #126578 )"
...
This reverts commit 7ede78f9f5 .
Reverted https://github.com/pytorch/pytorch/pull/126578 on behalf of https://github.com/anijain2305 due to pippy tests fail ([comment](https://github.com/pytorch/pytorch/pull/126578#issuecomment-2155836555 ))
2024-06-08 06:35:34 +00:00
Animesh Jain
7ede78f9f5
[dynamo][nn-modules] Trace through nn.Module dunder methods for UnspecializedNNModule ( #126578 )
...
Tracing through `__init__` is important because it initializes (calls STORE_ATTR) on members. By doing that, we kick in the mutation tracking for these objects. So, things like mutating `_modules` etc is tracked automatically.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/126578
Approved by: https://github.com/jansel
ghstack dependencies: #128001
2024-06-06 23:05:49 +00:00
Animesh Jain
626dc934d1
[dynamo][pippy] Hotfix for nn_module_stack for pippy usecase ( #127972 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/127972
Approved by: https://github.com/ydwu4
2024-06-05 20:14:50 +00:00
Animesh Jain
efcea2d2fd
[dynamo] Support __getitem__ on NNModuleVariable __dict__ ( #126956 )
...
Moves further along (but still fails) for the testcase in https://github.com/pytorch/pytorch/pull/126875
Pull Request resolved: https://github.com/pytorch/pytorch/pull/126956
Approved by: https://github.com/jansel
ghstack dependencies: #126923
2024-06-01 15:22:45 +00:00
Animesh Jain
90461d4986
[dynamo] Detect monkeypatching on nn module forward method ( #126203 )
...
An alternative was https://github.com/pytorch/pytorch/pull/124975 . Though it was safer because it was adding guards for every inlined function, it was causing guard overhead for a few models of > 20%. The overhead of this PR is minimal for the common unpatched case.
Fixes an internal issue - [fb.workplace.com/groups/1075192433118967/permalink/1411067766198097](https://fb.workplace.com/groups/1075192433118967/permalink/1411067766198097/ )
Pull Request resolved: https://github.com/pytorch/pytorch/pull/126203
Approved by: https://github.com/ezyang
2024-05-15 20:41:13 +00:00
William Wen
ff090c6937
[dynamo] support tracing nn.Module @property that accesses closure cells ( #125724 )
...
Fix https://github.com/pytorch/pytorch/issues/125702
Pull Request resolved: https://github.com/pytorch/pytorch/pull/125724
Approved by: https://github.com/jansel , https://github.com/jbschlosser
ghstack dependencies: #125710
2024-05-08 23:25:39 +00:00
William Wen
93f3d561f9
[dynamo] don't make nn parametrized Modules unspecialized ( #125710 )
...
Workaround for https://github.com/pytorch/pytorch/issues/125314 and https://github.com/pytorch/pytorch/issues/125478 .
We no longer make parametrized nn.Modules unspecialized. Instead, when we are about to call a function from the `torch.nn.utils.parametrize` module, we skip the frame.
The script from https://github.com/pytorch/pytorch/issues/125314 now outputs
```
parametrize=True: 6587ms
parametrize=False: 1729ms
parametrize=True: 4497ms
parametrize=False: 1539ms
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/125710
Approved by: https://github.com/jansel , https://github.com/jbschlosser
2024-05-08 23:25:39 +00:00
Animesh Jain
5ba777f46e
[guards][cpp-guards] Optimize NN module getattr guards ( #124522 )
...
Improves the guard overhead of MobileBert model with nn module guards from 92000 units to 20000 units.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/124522
Approved by: https://github.com/jansel
ghstack dependencies: #125439 , #125421
2024-05-04 22:08:56 +00:00
Animesh Jain
fd24d8c05a
[dynamo][nn module] Use correct sources for _call_impl ( #124970 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/124970
Approved by: https://github.com/jansel
ghstack dependencies: #124779 , #124627
2024-04-26 23:18:30 +00:00
Animesh Jain
febc4d8759
[dynamo][easy] forbid_in_graph check to use getattr_static ( #124445 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/124445
Approved by: https://github.com/yanboliang , https://github.com/jansel
2024-04-20 14:11:05 +00:00
Edward Z. Yang
bebdbb63ce
Introduce set_example_value and use it throughout Dynamo ( #124176 )
...
I'm going to setup some extra behavior when we set example value, so
I need a convenient place to interpose. I cannot easily do it on
meta itself because its a generic dict with no interposition point.
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/124176
Approved by: https://github.com/oulgen
ghstack dependencies: #124105 , #124059
2024-04-17 22:57:11 +00:00
Xuehai Pan
93e249969b
[BE] enable ruff rule RSE and remove useless parentheses in raise statements ( #124261 )
...
Remove useless parentheses in `raise` statements if the exception type is raised with no argument.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/124261
Approved by: https://github.com/albanD
2024-04-17 19:29:34 +00:00