Commit Graph

3 Commits

Author SHA1 Message Date
FFFrog
6980c5048d UFMT formatting on test/mobile (#123521)
Partially addresses https://github.com/pytorch/pytorch/issues/123062

Ran lintrunner on:
test/mobile

Detail:
```Shell
$ lintrunner -a --take UFMT --all-files
ok No lint issues.
Successfully applied all patches.
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/123521
Approved by: https://github.com/shink, https://github.com/ezyang
2024-04-09 14:06:22 +00:00
Xuehai Pan
046e88a291 [BE] [3/3] Rewrite super() calls in test (#94592)
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/94592
Approved by: https://github.com/ezyang, https://github.com/seemethere
2023-02-12 22:20:53 +00:00
Priya Ramani
67970e8c9b Add CI tests for AOT Compile (#65441)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65441

Adding CI test to verify a simple linear model can compile fine.
Successful run from CI logs:

```
+ test_aot_model_compiler
+ echo 'Testing AOT model compiler'
Testing AOT model compiler
+ source test/mobile/nnc/test_aot_compile.sh
+++ python -c 'import site; print(site.getsitepackages()[0])'
++ TORCH_INSTALL_DIR=/opt/conda/lib/python3.6/site-packages/torch
++ TORCH_BIN_DIR=/opt/conda/lib/python3.6/site-packages/torch/bin
+++ dirname test/mobile/nnc/test_aot_compile.sh
++ CURRENT_DIR=test/mobile/nnc
++ MODEL=aot_test_model.pt
++ COMPILED_MODEL=aot_test_model.compiled.pt
++ COMPILED_CODE=aot_test_model.compiled.ll
++ test_aot_model_compiler
++ python test/mobile/nnc/aot_test_model.py
++ exit_code=0
++ [[ 0 != 0 ]]
++ /opt/conda/lib/python3.6/site-packages/torch/bin/test_aot_model_compiler --model aot_test_model.pt --model_name=aot_test_model --model_version=v1 --input_dims=2,2,2
The compiled model was saved to aot_test_model.compiled.pt
++ success=1
++ '[' '!' -f aot_test_model.compiled.pt ']'
++ '[' '!' -f aot_test_model.compiled.ll ']'
++ '[' -f aot_test_model.compiled.ll ']'
++ rm aot_test_model.compiled.ll
++ '[' -f aot_test_model.compiled.pt ']'
++ rm aot_test_model.compiled.pt
++ rm aot_test_model.pt
++ '[' 1 = 0 ']'
+ [[ linux-xenial-py3.6-gcc5.4-default == pytorch-linux-xenial-py3* ]]
+ assert_git_not_dirty
+ [[ linux-xenial-py3.6-gcc5.4-default != *rocm* ]]
+ [[ linux-xenial-py3.6-gcc5.4-default != *xla* ]]
++ git status --porcelain
+ git_status=
+ [[ -n '' ]]
+ test_custom_script_ops
```

Test Plan: Imported from OSS

Reviewed By: ljk53

Differential Revision: D31348169

Pulled By: priyaramani

fbshipit-source-id: dd5c55859dfa07d150e5decc2dd7e56f43e7f66b
2021-10-06 18:23:19 -07:00