pytorch
e755a4f1 - Update the operator version check logic when generating models for testing upgraders (#71894)

Commit
2 years ago
Update the operator version check logic when generating models for testing upgraders (#71894) Summary: The model generation script will check the model version, to ensure the developer run the script before they change operator Previously, the version use the old model version. However, it's hard for developer to know the old version number. In this change, it use the current max operator version to check. It's less strict, but more developer friendly Pull Request resolved: https://github.com/pytorch/pytorch/pull/71894 ghstack-source-id: 147769215 Test Plan: first time run: ``` chenlai@devvm5615:~/fbsource/fbcode(b82243650)$ buck run mode/opt //caffe2/torch/fb/mobile/upgrader_codegen:upgrader_test_models_gen Parsing buck files: finished in 0.7 sec Downloaded 0/2 artifacts, 0.00 bytes, 100.0% cache miss (for updated rules) Building: finished in 21.6 sec (100%) 11547/11547 jobs, 2/11547 updated Total time: 22.4 sec BUILD SUCCEEDED TestVersionedDivTensorExampleV7() aten::div.Tensor INFO:test.jit.fixtures_srcs.generate_models:Processing TestVersionedDivTensorExampleV7 INFO:test.jit.fixtures_srcs.generate_models:Generating model test_versioned_div_tensor_example_v7 and it's save to /data/users/chenlai/fbsource/fbcode/caffe2/test/jit/fixtures/test_versioned_div_tensor_example_v7.ptl chenlai@devvm5615:~/fbsource/fbcode(b82243650)$ ``` second time run: ``` chenlai@devvm5615:~/fbsource/fbcode(b82243650)$ rm caffe2/test/jit/fixtures/test_versioned_div_tensor_example_v4.ptl chenlai@devvm5615:~/fbsource/fbcode(b82243650)$ buck run mode/opt //caffe2/torch/fb/mobile/upgrader_codegen:upgrader_test_models_gen Action graph will be rebuilt because files have been added or removed. Parsing buck files: finished in 2.0 sec Building... 17.4 sec (99%) 9289/9290 jobs, 0/9290 updated TestVersionedDivTensorExampleV7() aten::div.Tensor INFO:test.jit.fixtures_srcs.generate_models:Processing TestVersionedDivTensorExampleV7 INFO:test.jit.fixtures_srcs.generate_models:Model test_versioned_div_tensor_example_v7 already exists, skipping chenlai@devvm5615:~/fbsource/fbcode(b82243650)$ jf s ``` Reviewed By: tugsbayasgalan Differential Revision: D33804737 fbshipit-source-id: 7424b81a700703bdf896ec606c2dac8df6dbf8a6 (cherry picked from commit 44b4e37d30077a3160b8a92209af339a6f2fc885)
Author
Committer
Parents
Loading