Commit Graph

6 Commits

Author SHA1 Message Date
Xuehai Pan
e7eeee473c [BE][Easy][14/19] enforce style for empty lines in import segments in torch/_[a-c]*/ and torch/_[e-h]*/ and torch/_[j-z]*/ (#129765)
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/129765
Approved by: https://github.com/ezyang
2024-07-31 10:42:50 +00:00
Aaron Orenstein
afe15d2d2f Flip default value for mypy disallow_untyped_defs [3/11] (#127840)
See #127836 for details.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127840
Approved by: https://github.com/oulgen
2024-06-08 18:28:01 +00:00
Sergii Dymchenko
591222f5d9 Fix use-dict-literal lint (#83718)
Fix use-dict-literal pylint suggestions by changing `dict()` to `{}`. This PR should do the change for every Python file except test/jit/test_list_dict.py, where I think the intent is to test the constructor.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83718
Approved by: https://github.com/albanD
2022-08-24 00:26:46 +00:00
Huy Do
12cb26509a Apply ufmt to torch internal (#81643)
This is a big bang PR, merge conflicts are probably expected and will be addressed at merge.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81643
Approved by: https://github.com/ezyang
2022-07-22 02:19:50 +00:00
Shunting Zhang
f9407fdb86 Dynamo+LTC: handle inplace ops (#75359)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75359

For some models in torchbench (e.g. pyhpc_isoneutral_mixing), dynamo will generate Fx graphs that has side effects . Those graphs may
- return an empty tuple
- change tensors passed in as forward method arguments in-place

This makes the Dynamo+LTC integration fail since we extract compiled graph based on the lazy tensors returned from the forward method. From an empty tuple, we extract nothing.

To solve this problem, we extract compile graph from `union(argument lazy tensors, returned lazy tensors)` instead. The inplace mutations applied to argument lazy tensors will be captured this way.

Test Plan:
```
pytest test/lazy/test_extract_compiled_graph.py
```

```
LTC_TS_CUDA=1 gpui time python torchbench.py --speedup-ltc -dcuda --nvfuser --randomize-input --only pyhpc_isoneutral_mixing
```

Reviewed By: ZolotukhinM

Differential Revision: D35478799

Pulled By: shunting314

fbshipit-source-id: 8116768fc50fe7630e481e6039319ddf5c6a9416
(cherry picked from commit 2e6531d2c80c35ae99c11d49ca01dcdb7fc032f2)
2022-04-08 03:14:28 +00:00
Shunting Zhang
19747cbbe6 Dynamo+LTC: merging related code from staging branch to master (#75046)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75046

Merge the code needed for dynamic+ltc integration from the staging branch to the master branch.

Test Plan:
Unit test
```
pytest test_extract_compiled_graph
```
test thru dynamo
```
LTC_TS_CUDA=1 time python torchbench.py --speedup-ltc -dcuda --nvfuser --randomize-input --only <model name>
```

Reviewed By: alanwaketan

Differential Revision: D35300646

Pulled By: shunting314

fbshipit-source-id: 09ed20d3bb8ef80e4b93ba87ea3356a07d2dccdb
(cherry picked from commit 2b56771cdfd2cfa825c65ee9fd42338fb372fb32)
2022-04-02 00:23:15 +00:00