Commit Graph

24 Commits

Author SHA1 Message Date
Xuehai Pan
dcc3cf7066 [BE] fix ruff rule E226: add missing whitespace around operator in f-strings (#144415)
The fixes are generated by:

```bash
ruff check --fix --preview --unsafe-fixes --select=E226 .
lintrunner -a --take "RUFF,PYFMT" --all-files
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/144415
Approved by: https://github.com/huydhn, https://github.com/Skylion007
2025-01-08 21:55:00 +00:00
Oguz Ulgen
a6985c09cb Add None return type to init -- functorch and torchgen (#132351)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132351
Approved by: https://github.com/jamesjwu
ghstack dependencies: #132335
2024-08-01 15:26:45 +00:00
Xuehai Pan
740fb22966 [BE][Easy][4/19] enforce style for empty lines in import segments in functorch/ (#129755)
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/129755
Approved by: https://github.com/zou3519
ghstack dependencies: #129752
2024-07-18 05:08:03 +00:00
Xuehai Pan
a28bfb5ed5 [4/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort functorch (#127125)
The `usort` config in `pyproject.toml` has no effect due to a typo. Fixing the typo make `usort` do more and generate the changes in the PR. Except `pyproject.toml`, all changes are generated by `lintrunner -a --take UFMT --all-files`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127125
Approved by: https://github.com/Skylion007
ghstack dependencies: #127122, #127123, #127124
2024-05-25 22:45:38 +00:00
Edward Z. Yang
e6ec0efaf8 Apply UFMT to all non test/torch files (#106205)
Signed-off-by: Edward Z. Yang <ezyang@meta.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/106205
Approved by: https://github.com/albanD
2023-07-29 02:56:24 +00:00
Justin Chu
8a688277a2 [BE] Enable ruff's UP rules and autoformat dynamo / functorch and refs (#105432)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105432
Approved by: https://github.com/ezyang
2023-07-19 13:48:44 +00:00
Xuehai Pan
5b1cedacde [BE] [2/3] Rewrite super() calls in functorch and torch (#94588)
Rewrite Python built-in class `super()` calls. Only non-semantic changes should be applied.

- #94587
- #94588
- #94592

Also, methods with only a `super()` call are removed:

```diff
class MyModule(nn.Module):
-   def __init__(self):
-       super().__init__()
-
    def forward(self, ...):
        ...
```

Some cases that change the semantics should be kept unchanged. E.g.:

f152a79be9/caffe2/python/net_printer.py (L184-L190)

f152a79be9/test/test_jit_fuser_te.py (L2628-L2635)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94588
Approved by: https://github.com/ezyang, https://github.com/albanD
2023-02-10 21:16:33 +00:00
Philip Meier
bc73affdad prepare removal of deprecated functionality in torch.testing (#87969)
_Redo of #86586 with all BC breaking changes granularly placed into separate commits._

---

Per title. Deprecation happened on Feb 25, 2022 in c6f1bbc0ac, which made it into the 1.12 release. Since it is now 245 days later and the next release will be 1.14, the removals later in the stack comply with the [BC policy](https://github.com/pytorch/pytorch/wiki/PyTorch's-Python-Frontend-Backward-and-Forward-Compatibility-Policy#minimizing-the-disruption-of-bc-breaking-changes).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87969
Approved by: https://github.com/mruberry
2022-11-02 14:04:48 +00:00
Richard Zou
d02f085f70 [functorch] Align functorch's flake8 config with pytorch's (pytorch/functorch#963) 2022-07-21 13:41:37 -07:00
Andre
1feff6bb69 [functorch] update compile example imports (pytorch/functorch#834) 2022-07-21 13:41:34 -07:00
Animesh Jain
9157be2b10 [functorch] Cleaning up TVM compiler integration (pytorch/functorch#405)
* Cleaning up TVM compiler integration

* Linters
2022-07-21 13:41:19 -07:00
vfdev
c94446a04d [functorch] Fixed python code formatting and added flake8 setup (pytorch/functorch#346)
* Fixed python code formatting and added flake8 setup

* Fixes config.yaml

* Added missing setup.cfg

* Removed flake8 job from circle ci and setup GHA

* More flake8 fixes

* Fixed test_conv2d

* Fixed failing flake8
2022-07-21 13:41:17 -07:00
samdow
b25d781d80 [functorch] cleanup unnecessary functions, examples 2022-07-21 13:41:10 -07:00
Bert Maher
033e7109a4 [functorch] Support buffers in compiled_module (pytorch/functorch#147)
* Support buffers in compiled_module

* Don't compute gradients for inputs that don't require grad

* Add a unit test for batchnorm

* Fix eager compilation tests that change requires_grad

* Create new args for tests without recompilation

* Enable some eager fusion opinfo tests that now work (because we stopped asking for unimplemented derivatives)
2022-07-21 13:41:06 -07:00
Horace He
90ad67843b [functorch] plumbed partition_fn through compiled_module 2022-07-21 13:41:05 -07:00
Bert Maher
acf0318fa3 [functorch] Remove some commented code (pytorch/functorch#146) 2022-07-21 13:41:05 -07:00
Bert Maher
53c9fdd24b [functorch] Introduce compiled_module for eager compilation of modules (pytorch/functorch#133)
* Introduce compiled_module for eager compilation of modules

* Make parameters work

Co-authored-by: Horace He <horacehe2007@yahoo.com>
2022-07-21 13:41:05 -07:00
Horace He
7e13e3c6f5 [functorch] added option to skip specialization cache 2022-07-21 13:41:03 -07:00
Horace He
c0afd464d1 [functorch] Cleaned up the tests 2022-07-21 13:41:03 -07:00
Horace He
d314e2f78b [functorch] stored some stuff 2022-07-21 13:41:03 -07:00
Horace He
5466ac5da3 [functorch] Update eager_fusion.py 2022-07-21 13:41:00 -07:00
Horace He
e8a5b3725b [functorch] fix example to work well :) 2022-07-21 13:40:59 -07:00
Horace He
1a2e538580 [functorch] Moved to Keops example 2022-07-21 13:40:59 -07:00
Horace He
9ca5ae86d0 [functorch] Added eager-mode fusion prototype 2022-07-21 13:40:59 -07:00