Repository navigation
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - Ready for human review:
Findings (2): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/203783
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit fde2dad with merge base b0a1db6 ( NEW FAILURES SUPPRESSED BY AI (non-blocking) - The following jobs failed, but the AI CI Advisor judged the failures not to be evidence against this change:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
## Summary (owner request) > oh then stack a PR underneath this one moving the pin > so they can be reviewed separately ## Agent details (AI-generated) Change only the CI timm pin from release 1.0.22 to release 1.0.31. The old package imports HRNet's TorchScript interface declaration before benchmark model selection, which breaks imports once the deprecated frontend is retired in the upper PR. The released revision removes that import-time dependency. The upper PR's TorchBench model deferral does not affect the separate timm suite. The old source declaration and released revision were inspected, with six earlier CPU/CUDA timm import failures recorded. Example: https://github.com/pytorch/pytorch/actions/runs/42112627909/job/127563394885 Test Plan: ```sh git diff --check python scripts/codeowners/check_taxonomy.py ``` Verify the committed bottom diff contains only the pin and that the final two-commit stack has exactly the same source tree as the prepared retirement checkpoint. Normal lint is run for the pin. CI still needs to rebuild images and execute timm/operator benchmarks; no new-image accuracy, performance or GPU pass is claimed. No model skip, alias restoration or numerical baseline change is introduced. ghstack-source-id: e92b417 Pull-Request: #203783
## Summary (owner request) > oh then stack a PR underneath this one moving the pin > so they can be reviewed separately ## Agent details (AI-generated) Change only the CI timm pin from release 1.0.22 to release 1.0.31. The old package imports HRNet's TorchScript interface declaration before benchmark model selection, which breaks imports once the deprecated frontend is retired in the upper PR. The released revision removes that import-time dependency. The upper PR's TorchBench model deferral does not affect the separate timm suite. The old source declaration and released revision were inspected, with six earlier CPU/CUDA timm import failures recorded. Example: https://github.com/pytorch/pytorch/actions/runs/42112627909/job/127563394885 Test Plan: ```sh git diff --check python scripts/codeowners/check_taxonomy.py ``` Verify the committed bottom diff contains only the pin and that the final two-commit stack has exactly the same source tree as the prepared retirement checkpoint. Normal lint is run for the pin. CI still needs to rebuild images and execute timm/operator benchmarks; no new-image accuracy, performance or GPU pass is claimed. No model skip, alias restoration or numerical baseline change is introduced. ghstack-source-id: e92b417 Pull-Request: #203783
## Summary (owner request) > oh then stack a PR underneath this one moving the pin > so they can be reviewed separately ## Agent details (AI-generated) Change only the CI timm pin from release 1.0.22 to release 1.0.31. The old package imports HRNet's TorchScript interface declaration before benchmark model selection, which breaks imports once the deprecated frontend is retired in the upper PR. The released revision removes that import-time dependency. The upper PR's TorchBench model deferral does not affect the separate timm suite. The old source declaration and released revision were inspected, with six earlier CPU/CUDA timm import failures recorded. Example: https://github.com/pytorch/pytorch/actions/runs/42112627909/job/127563394885 Test Plan: ```sh git diff --check python scripts/codeowners/check_taxonomy.py ``` Verify the committed bottom diff contains only the pin and that the final two-commit stack has exactly the same source tree as the prepared retirement checkpoint. Normal lint is run for the pin. CI still needs to rebuild images and execute timm/operator benchmarks; no new-image accuracy, performance or GPU pass is claimed. No model skip, alias restoration or numerical baseline change is introduced. ghstack-source-id: e92b417 Pull-Request: #203783
There was a problem hiding this comment.
Automated review of fde2dad: nothing blocking; ready for human review.
The PR moves the CI timm pin from 1.0.22 to the v1.0.31 release commit (43b549bf). The review found no blocking issues, only two non-blocking points. Recommendation: Approve, and run ciflow/inductor-periodic before merging so drift in the timm expected-accuracy CSVs shows up on this PR rather than on trunk.
⚪ 2 non-blocking findings
Non-blocking: most timm configs that are checked against expected CSVs won't run on this PR. The labels trigger only inductor_timm and cpu_inductor_timm, and ciflow/docker only rebuilds the images. These don't run: the inductor-periodic.yml timm configs (dynamic/aot inductor_timm and their ROCm versions, dynamic_cpu_inductor_timm, and the CPU freezing, AMP freezing, AVX2 freezing and AOT freezing timm configs), which run only on ciflow/inductor-periodic/*, on a schedule or by dispatch; and inductor-nightly's dynamic_cpu_max_autotune_inductor_amp_freezing_timm, which has no ciflow trigger. Each of these runs check_accuracy.py and check_graph_breaks.py against benchmarks/dynamo/ci_expected_accuracy CSVs. Model changes across nine timm releases can shift graph_breaks or accuracy, which would first show up as a trunk failure after merge. Suggested fix: add ciflow/inductor-periodic before landing, and ideally dispatch inductor-nightly once.
Non-blocking: the first line of the PR description says the operator benchmarks improved because of the new pin, and nothing supports that. Nothing under benchmarks/operator_benchmark/ imports timm, and timm is installed with --no-deps, so the bump can't change other packages in the image. Any operator-benchmark change on the x86 job comes from the image rebuild in general, for example torchbench's install.py re-resolving unpinned installs. Drop the first-line claim so the commit message doesn't misattribute a perf change. Also, if the improvement is real and at least 1.5x, the weekly operator_benchmark job will fail until the expected CSV is updated, because check_perf_csv.py treats a large improvement as a failure.
This review is AI-generated and advisory. Each new automated review replaces the previous one. Report a bad review
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
## Summary (owner request) > oh then stack a PR underneath this one moving the pin > so they can be reviewed separately ## Agent details (AI-generated) Change only the CI timm pin from release 1.0.22 to release 1.0.31. The old package imports HRNet's TorchScript interface declaration before benchmark model selection, which breaks imports once the deprecated frontend is retired in the upper PR. The released revision removes that import-time dependency. The upper PR's TorchBench model deferral does not affect the separate timm suite. The old source declaration and released revision were inspected, with six earlier CPU/CUDA timm import failures recorded. Example: https://github.com/pytorch/pytorch/actions/runs/42112627909/job/127563394885 Test Plan: ```sh git diff --check python scripts/codeowners/check_taxonomy.py ``` Verify the committed bottom diff contains only the pin and that the final two-commit stack has exactly the same source tree as the prepared retirement checkpoint. Normal lint is run for the pin. CI still needs to rebuild images and execute timm/operator benchmarks; no new-image accuracy, performance or GPU pass is claimed. No model skip, alias restoration or numerical baseline change is introduced. ghstack-source-id: e92b417 Pull-Request: #203783
## Summary (human written only) Remove deprecated public TorchScript APIs and their tests; preserve needed internal source through build-time overrides, with no copied tests. ### What is getting deleted? Already deprecated public `torch.jit` APIs: `script`, `script_method`, `interface`, `trace`, `trace_module`, `load`, `save`, `freeze`, `optimize_for_inference`, `set_fusion_strategy`, `fork`, `wait`. Also removed the APIs that are transitively also deprecated: - Public Python `torch.load` acceptance of TorchScript ZIP/module archives, in either `weights_only` mode. Ordinary tensor/state-dict checkpoints remain supported. - Deprecated-API-only JIT/fuser/mobile suites and test assets, scripted benchmark modes and their dead helpers, and stale discovery/CI/ownership references. - The private NNAPI Python host-conversion path and its specific C++ preprocessing callback. Native NNAPI execution and generic backend dispatch remain. - Obsolete TorchScript-only documentation and the unused `supported_ops` doc-generation module. And the tests and benchmarks associated with the above APIs. This is **not** wholesale deletion of `torch/csrc/jit`. Supported public `ScriptModule`/`CompilationUnit`, native C++ serialization, package and flatbuffer features, MKLDNN conversion and public AD dependencies retain the implementation they need. The JVP helper remains unchanged: its deletion broke ordinary gradient-JVPs, and the author asked to keep it. These would need to be deprecated first! ### What is the impact? 1. **Cleaner code!!!!!** Retired frontend tests, fixtures, benchmark modes and dead references are deleted! Gone! 2. **Less CI test work.** Median CI test work removed: 145.0 min per PR pull run; 487.5 min per main pull+trunk push, for a total of at least 632min per PR! <details> <summary>AI-generated measurement details (provisional; not final-green)</summary> > Fresh baseline medians: **145.0 aggregate test-minutes per PR `pull` run** (n=10) and **487.5 per SHA-paired main `pull` + `trunk` push** (n=6). Separate main medians: **231.0 pull / 256.9 trunk** (n=10 each). > > The PR sample contains **6,547 distinct executed removed cases**, median **4,415/run**. Retiring the entire CPP parity driver contributes a median **18.2 PR test-minutes/run**. Target determination varies; these are recorded test-work estimates, **not wall-clock savings**. > > Baseline workflows: **November 5 noon–November 6 noon UTC**, with facts before **November 6 20:00 UTC**; latest job attempts and non-skipped recorded durations. Scope is pinned to **`e2090877` / tree `efbb8f01`**, not final-green. Build/setup, skips, retained coverage and **all temporary twelve-model CPU/GPU TorchBench and BERT-smoke deferrals** receive no credit. > > [Full report (internal)](https://artifacts.internalmeta.com/a/1429819522086350) · [Reproducible queries, CSVs and source audit (internal)](https://artifacts.internalmeta.com/a/29720066164257555). </details> 3. Side effect: We also learned that despite our best intentions, we did not fully deprecate TorchScript in 2.10 and 2.11. There are still many other use cases and cross cutting functionality we need to slap a FutureWarning to, which this PR has started to track in the deprecation issue! ### Disclaimer(s) + Things We Need To Deprecate - To unblock this retirement, **BERT_pytorch and eleven Detectron2 models are temporarily excluded from CPU and GPU Inductor TorchBench**; their BERT-only smoke subcases are deferred too. Migration/re-enablement is tracked in **#203757**. - C++ module-parity transport and the two custom-backend fixture sites have concrete representation boundaries. Ordinary modules/state-dict archives do not satisfy the existing native module reader; `ExportedProgram`/FX inputs do not satisfy the custom backend's `_c`/`jit::Module` interface. Those cases are retained deliberately, not because their value is unknown. - The ScriptModule RPC return-value/archive transport cut is held pending an explicit scope decision: the retained public producer works, and removing the reducer causes a verified serialization failure. The old transport itself uses deprecated archive frontend helpers. Other obsolete RPC fixture/docs cleanup is independent. - The AOTI TorchBind fixture and native CUDA-stream fixture still need matching native artifacts/platform validation before a supported fixture replacement can be accepted. No fake objects, unverified skips or weakened tolerances were substituted. - The broader scripted RemoteModule, TensorBoard and legacy ONNX cuts remain follow-up work; their complete package/isolation/runtime validation is still pending. The utility follow-up is now published: obsolete JIT testing helpers and their solely-dependent benchmark provider are removed, the old fuser comparison launcher is deleted, and explicit retired varlen-LSTM `script` options reject rather than silently running eager code. No half-cut API is described as finished. - BC Lint still flags `scriptAndSave`/`Test` from the deleted Android generator and `jit_step` from the deleted example path. No path exclusions, dead aliases or rule suppression have been added; this remains a documented compatibility-classification gate. - Remote/TensorBoard validation remains a capability gate. A genuine standalone package and safe isolation were established; after-package source selection passed, but existing sampled telemetry needed runtime inventory. A same-worker read-only inventory input was then checked without exposing identifying values, yet the baseline timed out in offline configuration retries. Afterward no after-package or TensorBoard run was launched. The prepared broader cuts remain out of this published checkpoint; no unisolated fallback, logger/sampling bypass, or production access was used to turn the gate green. - Follow-up deprecation of `functorch.compile.ts_compile` is tracked in **#203804**, attached under #201298. This retirement does not remove it or claim that a new warning has shipped. ### How did I deal with internal? We migrate the deleted files into the `fb` folder: - `fb/torch/jit/__init__.py` → installed `torch/jit/__init__.py` - `fb/torch/serialization.py` → installed `torch/serialization.py` The original names and relative layout are preserved under `(fbcode|xplat)/caffe2/fb/torch/`. BUCK/ovrsource selects these sources at build time; internal callers keep canonical imports. Nothing else is copied. AI has checked the JIT initializer is byte-identical to the pinned pre-removal source. Serialization preserves the original implementation/warning/loader with only the formatter's placement of a `TypeIs` import changed. ### Test plan - **CI should be green publicly and internally before merging.** Current checks are still being monitored; this is an expectation, not an assertion that all jobs passed. - Relevant failures were reproduced locally before fixes and checked afterward. ARM performance uses CI under the author's explicit local-validation exception. - The internal BUCK metadata failure reproduced before cleanup and the same owner query passed afterward; the orphan test target was removed rather than restored. Native NNAPI builds/links passed before and after the host-preprocessing cut; baseline host startup and Android execution remain separate unverified runtime gates. - Fresh canonical internal validation passed **six core contracts before and six after** the frozen copy/layout change. The original OSS-specific shared assertions reproduced **14 failures** internally; the corrected **three existing tests plus a separate identity check** passed without skips or mocked package flags. - Public/ internal model-selection checks preserve unrelated arguments and selections; the CPU/GPU extension and its effective-backend edge were locally checked. This does not substitute for GPU model accuracy/performance CI. - The public hook-fixture migration passed all 17 builders and generated all 15 native fixture archives with matching behavior. The full C++ executable is not claimed passed. - The stale upgrader provider reproduced a real missing-source error locally; its dead target/wrapper closure is now removed, while retained codegen manifest/package checks pass. The dependency spelling resolves to the same configured canonical Torch provider. - Dynamo no longer registers the deleted JIT-only assertion context. Its exact context lookup failed locally before and passed after; real compile/FX probes passed on both sides and are not presented as reproducing all wrapped-CI failures. Per the owner's review direction, the EmbeddingBag_sparse C++ parity registration and its C++-only constructor metadata are removed; the ordinary NN fixture and other parity cases remain. The incidental PGO change and added regression are reverted, restoring both PGO files byte-for-byte to their pre-fix contents. This is intentional coverage retirement, not a compiler fix or a claim that the retirement caused the original PGO failure. - For this review update, five one-off source/registration checks passed: exact PGO-file restoration, removal of only the selected parity registration, unchanged ordinary NN fixture metadata, deletion of only ConcatGraphOptBench and its registration, and comment-only Dynamo cleanup. Public lintrunner and internal Arc/mirror hooks passed. These are source/registration checks, not a full native C++ parity execution. Human review and CI are still required; no merge or landing is authorized. ### How to best review 1. Review the bottom timm PR separately: it contains only the dependency pin. 2. In this PR, start with `torch/jit/__init__.py` and `torch/serialization.py`: verify exact exports removed and format-specific Python loading behavior. 3. Group deleted suites with their fixtures/helper/provider closure; inspect mixed-test edits for preserved independent eager/public coverage rather than private TorchScript parity. 4. Review surviving library callers, RPC/NNAPI boundaries, and the narrowly scoped CPU/GPU TorchBench deferral. Compare normal, performance, dashboard and exporter/backend controls. 5. Review **D129970553** separately for canonical internal source selection, original-layout copies, no test copies, and the source-identity/runtime evidence. Source adaptation is not inferred from a matching filename. 6. Check the posted Export/Dynamo questions and explicitly documented validation gaps rather than treating an unrelated green job as their resolution. ## Links Part of #201298 Dependency: #203783 Deferred CPU TorchBench migrations: #203757 Differential Revision: https://www.internalfb.com/diff/D129970553 Pull Request resolved: #203621 Approved by: https://github.com/justinchuby, https://github.com/ngimel
…torch#203783) Update the timm pin because the old one imported an API that depends on torchscript A result is that the operator benchmarks improved :) ## Linked issue or supporting maintainer Dependency for TS public API removal ## Agent details — AI-generated Update the CI timm pin from 1.0.22 (`af3732eebe8c1964e5ba5f2769f955e6e0deb980`) to the released 1.0.31 revision (`43b549bfe9d680bc94284cfd0b611152d18e97d7`). This PR changes only `.ci/docker/ci_commit_pins/timm.txt`. The old pin imports HRNet's `@torch.jit.interface` declaration while importing the timm package, before benchmark model selection. That caused all six CPU/CUDA timm shards to fail when the deprecated TorchScript entrypoints were removed in pytorch#203621. The released version removes that import-time dependency. - [Old import-time interface declaration](https://github.com/huggingface/pytorch-image-models/blob/af3732eebe8c1964e5ba5f2769f955e6e0deb980/timm/models/hrnet.py#L521-L524) - [Released timm 1.0.31](https://github.com/huggingface/pytorch-image-models/releases/tag/v1.0.31) - [Example timm CI failure](https://github.com/pytorch/pytorch/actions/runs/42112627909/job/127563394885) ### Test plan The pin is a verified released source revision, and its import-time TorchScript dependency was inspected. CI must rebuild the Docker images and validate the timm benchmarks. This description does not claim that all new-image accuracy/performance checks have passed. This dependency-only PR is separate from the TorchScript API/test retirement. It does not weaken benchmark expectations, restore aliases, or skip timm models. Operator-benchmark base/head comparison requires checking actual source, image and compiler provenance; separating the pin does not itself prove a performance cause. Pull Request resolved: pytorch#203783 Approved by: https://github.com/Skylion007, https://github.com/albanD, https://github.com/jbschlosser
## Summary (human written only) Remove deprecated public TorchScript APIs and their tests; preserve needed internal source through build-time overrides, with no copied tests. ### What is getting deleted? Already deprecated public `torch.jit` APIs: `script`, `script_method`, `interface`, `trace`, `trace_module`, `load`, `save`, `freeze`, `optimize_for_inference`, `set_fusion_strategy`, `fork`, `wait`. Also removed the APIs that are transitively also deprecated: - Public Python `torch.load` acceptance of TorchScript ZIP/module archives, in either `weights_only` mode. Ordinary tensor/state-dict checkpoints remain supported. - Deprecated-API-only JIT/fuser/mobile suites and test assets, scripted benchmark modes and their dead helpers, and stale discovery/CI/ownership references. - The private NNAPI Python host-conversion path and its specific C++ preprocessing callback. Native NNAPI execution and generic backend dispatch remain. - Obsolete TorchScript-only documentation and the unused `supported_ops` doc-generation module. And the tests and benchmarks associated with the above APIs. This is **not** wholesale deletion of `torch/csrc/jit`. Supported public `ScriptModule`/`CompilationUnit`, native C++ serialization, package and flatbuffer features, MKLDNN conversion and public AD dependencies retain the implementation they need. The JVP helper remains unchanged: its deletion broke ordinary gradient-JVPs, and the author asked to keep it. These would need to be deprecated first! ### What is the impact? 1. **Cleaner code!!!!!** Retired frontend tests, fixtures, benchmark modes and dead references are deleted! Gone! 2. **Less CI test work.** Median CI test work removed: 145.0 min per PR pull run; 487.5 min per main pull+trunk push, for a total of at least 632min per PR! <details> <summary>AI-generated measurement details (provisional; not final-green)</summary> > Fresh baseline medians: **145.0 aggregate test-minutes per PR `pull` run** (n=10) and **487.5 per SHA-paired main `pull` + `trunk` push** (n=6). Separate main medians: **231.0 pull / 256.9 trunk** (n=10 each). > > The PR sample contains **6,547 distinct executed removed cases**, median **4,415/run**. Retiring the entire CPP parity driver contributes a median **18.2 PR test-minutes/run**. Target determination varies; these are recorded test-work estimates, **not wall-clock savings**. > > Baseline workflows: **November 5 noon–November 6 noon UTC**, with facts before **November 6 20:00 UTC**; latest job attempts and non-skipped recorded durations. Scope is pinned to **`e2090877` / tree `efbb8f01`**, not final-green. Build/setup, skips, retained coverage and **all temporary twelve-model CPU/GPU TorchBench and BERT-smoke deferrals** receive no credit. > > [Full report (internal)](https://artifacts.internalmeta.com/a/1429819522086350) · [Reproducible queries, CSVs and source audit (internal)](https://artifacts.internalmeta.com/a/29720066164257555). </details> 3. Side effect: We also learned that despite our best intentions, we did not fully deprecate TorchScript in 2.10 and 2.11. There are still many other use cases and cross cutting functionality we need to slap a FutureWarning to, which this PR has started to track in the deprecation issue! ### Disclaimer(s) + Things We Need To Deprecate - To unblock this retirement, **BERT_pytorch and eleven Detectron2 models are temporarily excluded from CPU and GPU Inductor TorchBench**; their BERT-only smoke subcases are deferred too. Migration/re-enablement is tracked in **pytorch#203757**. - C++ module-parity transport and the two custom-backend fixture sites have concrete representation boundaries. Ordinary modules/state-dict archives do not satisfy the existing native module reader; `ExportedProgram`/FX inputs do not satisfy the custom backend's `_c`/`jit::Module` interface. Those cases are retained deliberately, not because their value is unknown. - The ScriptModule RPC return-value/archive transport cut is held pending an explicit scope decision: the retained public producer works, and removing the reducer causes a verified serialization failure. The old transport itself uses deprecated archive frontend helpers. Other obsolete RPC fixture/docs cleanup is independent. - The AOTI TorchBind fixture and native CUDA-stream fixture still need matching native artifacts/platform validation before a supported fixture replacement can be accepted. No fake objects, unverified skips or weakened tolerances were substituted. - The broader scripted RemoteModule, TensorBoard and legacy ONNX cuts remain follow-up work; their complete package/isolation/runtime validation is still pending. The utility follow-up is now published: obsolete JIT testing helpers and their solely-dependent benchmark provider are removed, the old fuser comparison launcher is deleted, and explicit retired varlen-LSTM `script` options reject rather than silently running eager code. No half-cut API is described as finished. - BC Lint still flags `scriptAndSave`/`Test` from the deleted Android generator and `jit_step` from the deleted example path. No path exclusions, dead aliases or rule suppression have been added; this remains a documented compatibility-classification gate. - Remote/TensorBoard validation remains a capability gate. A genuine standalone package and safe isolation were established; after-package source selection passed, but existing sampled telemetry needed runtime inventory. A same-worker read-only inventory input was then checked without exposing identifying values, yet the baseline timed out in offline configuration retries. Afterward no after-package or TensorBoard run was launched. The prepared broader cuts remain out of this published checkpoint; no unisolated fallback, logger/sampling bypass, or production access was used to turn the gate green. - Follow-up deprecation of `functorch.compile.ts_compile` is tracked in **pytorch#203804**, attached under pytorch#201298. This retirement does not remove it or claim that a new warning has shipped. ### How did I deal with internal? We migrate the deleted files into the `fb` folder: - `fb/torch/jit/__init__.py` → installed `torch/jit/__init__.py` - `fb/torch/serialization.py` → installed `torch/serialization.py` The original names and relative layout are preserved under `(fbcode|xplat)/caffe2/fb/torch/`. BUCK/ovrsource selects these sources at build time; internal callers keep canonical imports. Nothing else is copied. AI has checked the JIT initializer is byte-identical to the pinned pre-removal source. Serialization preserves the original implementation/warning/loader with only the formatter's placement of a `TypeIs` import changed. ### Test plan - **CI should be green publicly and internally before merging.** Current checks are still being monitored; this is an expectation, not an assertion that all jobs passed. - Relevant failures were reproduced locally before fixes and checked afterward. ARM performance uses CI under the author's explicit local-validation exception. - The internal BUCK metadata failure reproduced before cleanup and the same owner query passed afterward; the orphan test target was removed rather than restored. Native NNAPI builds/links passed before and after the host-preprocessing cut; baseline host startup and Android execution remain separate unverified runtime gates. - Fresh canonical internal validation passed **six core contracts before and six after** the frozen copy/layout change. The original OSS-specific shared assertions reproduced **14 failures** internally; the corrected **three existing tests plus a separate identity check** passed without skips or mocked package flags. - Public/ internal model-selection checks preserve unrelated arguments and selections; the CPU/GPU extension and its effective-backend edge were locally checked. This does not substitute for GPU model accuracy/performance CI. - The public hook-fixture migration passed all 17 builders and generated all 15 native fixture archives with matching behavior. The full C++ executable is not claimed passed. - The stale upgrader provider reproduced a real missing-source error locally; its dead target/wrapper closure is now removed, while retained codegen manifest/package checks pass. The dependency spelling resolves to the same configured canonical Torch provider. - Dynamo no longer registers the deleted JIT-only assertion context. Its exact context lookup failed locally before and passed after; real compile/FX probes passed on both sides and are not presented as reproducing all wrapped-CI failures. Per the owner's review direction, the EmbeddingBag_sparse C++ parity registration and its C++-only constructor metadata are removed; the ordinary NN fixture and other parity cases remain. The incidental PGO change and added regression are reverted, restoring both PGO files byte-for-byte to their pre-fix contents. This is intentional coverage retirement, not a compiler fix or a claim that the retirement caused the original PGO failure. - For this review update, five one-off source/registration checks passed: exact PGO-file restoration, removal of only the selected parity registration, unchanged ordinary NN fixture metadata, deletion of only ConcatGraphOptBench and its registration, and comment-only Dynamo cleanup. Public lintrunner and internal Arc/mirror hooks passed. These are source/registration checks, not a full native C++ parity execution. Human review and CI are still required; no merge or landing is authorized. ### How to best review 1. Review the bottom timm PR separately: it contains only the dependency pin. 2. In this PR, start with `torch/jit/__init__.py` and `torch/serialization.py`: verify exact exports removed and format-specific Python loading behavior. 3. Group deleted suites with their fixtures/helper/provider closure; inspect mixed-test edits for preserved independent eager/public coverage rather than private TorchScript parity. 4. Review surviving library callers, RPC/NNAPI boundaries, and the narrowly scoped CPU/GPU TorchBench deferral. Compare normal, performance, dashboard and exporter/backend controls. 5. Review **D129970553** separately for canonical internal source selection, original-layout copies, no test copies, and the source-identity/runtime evidence. Source adaptation is not inferred from a matching filename. 6. Check the posted Export/Dynamo questions and explicitly documented validation gaps rather than treating an unrelated green job as their resolution. ## Links Part of pytorch#201298 Dependency: pytorch#203783 Deferred CPU TorchBench migrations: pytorch#203757 Differential Revision: https://www.internalfb.com/diff/D129970553 Pull Request resolved: pytorch#203621 Approved by: https://github.com/justinchuby, https://github.com/ngimel
## Summary (human written only) Remove deprecated public TorchScript APIs and their tests; preserve needed internal source through build-time overrides, with no copied tests. ### What is getting deleted? Already deprecated public `torch.jit` APIs: `script`, `script_method`, `interface`, `trace`, `trace_module`, `load`, `save`, `freeze`, `optimize_for_inference`, `set_fusion_strategy`, `fork`, `wait`. Also removed the APIs that are transitively also deprecated: - Public Python `torch.load` acceptance of TorchScript ZIP/module archives, in either `weights_only` mode. Ordinary tensor/state-dict checkpoints remain supported. - Deprecated-API-only JIT/fuser/mobile suites and test assets, scripted benchmark modes and their dead helpers, and stale discovery/CI/ownership references. - The private NNAPI Python host-conversion path and its specific C++ preprocessing callback. Native NNAPI execution and generic backend dispatch remain. - Obsolete TorchScript-only documentation and the unused `supported_ops` doc-generation module. And the tests and benchmarks associated with the above APIs. This is **not** wholesale deletion of `torch/csrc/jit`. Supported public `ScriptModule`/`CompilationUnit`, native C++ serialization, package and flatbuffer features, MKLDNN conversion and public AD dependencies retain the implementation they need. The JVP helper remains unchanged: its deletion broke ordinary gradient-JVPs, and the author asked to keep it. These would need to be deprecated first! ### What is the impact? 1. **Cleaner code!!!!!** Retired frontend tests, fixtures, benchmark modes and dead references are deleted! Gone! 2. **Less CI test work.** Median CI test work removed: 145.0 min per PR pull run; 487.5 min per main pull+trunk push, for a total of at least 632min per PR! <details> <summary>AI-generated measurement details (provisional; not final-green)</summary> > Fresh baseline medians: **145.0 aggregate test-minutes per PR `pull` run** (n=10) and **487.5 per SHA-paired main `pull` + `trunk` push** (n=6). Separate main medians: **231.0 pull / 256.9 trunk** (n=10 each). > > The PR sample contains **6,547 distinct executed removed cases**, median **4,415/run**. Retiring the entire CPP parity driver contributes a median **18.2 PR test-minutes/run**. Target determination varies; these are recorded test-work estimates, **not wall-clock savings**. > > Baseline workflows: **November 5 noon–November 6 noon UTC**, with facts before **November 6 20:00 UTC**; latest job attempts and non-skipped recorded durations. Scope is pinned to **`e2090877` / tree `efbb8f01`**, not final-green. Build/setup, skips, retained coverage and **all temporary twelve-model CPU/GPU TorchBench and BERT-smoke deferrals** receive no credit. > > [Full report (internal)](https://artifacts.internalmeta.com/a/1429819522086350) · [Reproducible queries, CSVs and source audit (internal)](https://artifacts.internalmeta.com/a/29720066164257555). </details> 3. Side effect: We also learned that despite our best intentions, we did not fully deprecate TorchScript in 2.10 and 2.11. There are still many other use cases and cross cutting functionality we need to slap a FutureWarning to, which this PR has started to track in the deprecation issue! ### Disclaimer(s) + Things We Need To Deprecate > **C++ archive compatibility:** Python `torch.load` no longer accepts TorchScript module archives, including archives produced by C++ `torch::save` for ordinary tensors, tensor lists, modules, or optimizers. This behavior was already deprecated and is now fully removed. Native C++ `torch::save`/`torch::load` remains unchanged. For C++→Python tensor/value interchange, use `torch::pickle_save` with Python `torch.load`. Existing C++ archive files are not automatically migrated. - To unblock this retirement, **BERT_pytorch and eleven Detectron2 models are temporarily excluded from CPU and GPU Inductor TorchBench**; their BERT-only smoke subcases are deferred too. Migration/re-enablement is tracked in **#203757**. - C++ module-parity transport and the two custom-backend fixture sites have concrete representation boundaries. Ordinary modules/state-dict archives do not satisfy the existing native module reader; `ExportedProgram`/FX inputs do not satisfy the custom backend's `_c`/`jit::Module` interface. Those cases are retained deliberately, not because their value is unknown. - The ScriptModule RPC return-value/archive transport cut is held pending an explicit scope decision: the retained public producer works, and removing the reducer causes a verified serialization failure. The old transport itself uses deprecated archive frontend helpers. Other obsolete RPC fixture/docs cleanup is independent. - The AOTI TorchBind fixture and native CUDA-stream fixture still need matching native artifacts/platform validation before a supported fixture replacement can be accepted. No fake objects, unverified skips or weakened tolerances were substituted. - The broader scripted RemoteModule, TensorBoard and legacy ONNX cuts remain follow-up work; their complete package/isolation/runtime validation is still pending. The utility follow-up is now published: obsolete JIT testing helpers and their solely-dependent benchmark provider are removed, the old fuser comparison launcher is deleted, and explicit retired varlen-LSTM `script` options reject rather than silently running eager code. No half-cut API is described as finished. - BC Lint still flags `scriptAndSave`/`Test` from the deleted Android generator and `jit_step` from the deleted example path. No path exclusions, dead aliases or rule suppression have been added; this remains a documented compatibility-classification gate. - Remote/TensorBoard validation remains a capability gate. A genuine standalone package and safe isolation were established; after-package source selection passed, but existing sampled telemetry needed runtime inventory. A same-worker read-only inventory input was then checked without exposing identifying values, yet the baseline timed out in offline configuration retries. Afterward no after-package or TensorBoard run was launched. The prepared broader cuts remain out of this published checkpoint; no unisolated fallback, logger/sampling bypass, or production access was used to turn the gate green. - Follow-up deprecation of `functorch.compile.ts_compile` is tracked in **#203804**, attached under #201298. This retirement does not remove it or claim that a new warning has shipped. ### How did I deal with internal? We migrate the deleted files into the `fb` folder: - `fb/torch/jit/__init__.py` → installed `torch/jit/__init__.py` - `fb/torch/serialization.py` → installed `torch/serialization.py` The original names and relative layout are preserved under `(fbcode|xplat)/caffe2/fb/torch/`. BUCK/ovrsource selects these sources at build time; internal callers keep canonical imports. Nothing else is copied. AI has checked the JIT initializer is byte-identical to the pinned pre-removal source. Serialization preserves the original implementation/warning/loader with only the formatter's placement of a `TypeIs` import changed. ### Test plan - **CI should be green publicly and internally before merging.** Current checks are still being monitored; this is an expectation, not an assertion that all jobs passed. - Relevant failures were reproduced locally before fixes and checked afterward. ARM performance uses CI under the author's explicit local-validation exception. - The internal BUCK metadata failure reproduced before cleanup and the same owner query passed afterward; the orphan test target was removed rather than restored. Native NNAPI builds/links passed before and after the host-preprocessing cut; baseline host startup and Android execution remain separate unverified runtime gates. - Fresh canonical internal validation passed **six core contracts before and six after** the frozen copy/layout change. The original OSS-specific shared assertions reproduced **14 failures** internally; the corrected **three existing tests plus a separate identity check** passed without skips or mocked package flags. - Public/ internal model-selection checks preserve unrelated arguments and selections; the CPU/GPU extension and its effective-backend edge were locally checked. This does not substitute for GPU model accuracy/performance CI. - The public hook-fixture migration passed all 17 builders and generated all 15 native fixture archives with matching behavior. The full C++ executable is not claimed passed. - The stale upgrader provider reproduced a real missing-source error locally; its dead target/wrapper closure is now removed, while retained codegen manifest/package checks pass. The dependency spelling resolves to the same configured canonical Torch provider. - Dynamo no longer registers the deleted JIT-only assertion context. Its exact context lookup failed locally before and passed after; real compile/FX probes passed on both sides and are not presented as reproducing all wrapped-CI failures. Per the owner's review direction, the EmbeddingBag_sparse C++ parity registration and its C++-only constructor metadata are removed; the ordinary NN fixture and other parity cases remain. The incidental PGO change and added regression are reverted, restoring both PGO files byte-for-byte to their pre-fix contents. This is intentional coverage retirement, not a compiler fix or a claim that the retirement caused the original PGO failure. - For this review update, five one-off source/registration checks passed: exact PGO-file restoration, removal of only the selected parity registration, unchanged ordinary NN fixture metadata, deletion of only ConcatGraphOptBench and its registration, and comment-only Dynamo cleanup. Public lintrunner and internal Arc/mirror hooks passed. These are source/registration checks, not a full native C++ parity execution. Human review and CI are still required; no merge or landing is authorized. ### How to best review 1. Review the bottom timm PR separately: it contains only the dependency pin. 2. In this PR, start with `torch/jit/__init__.py` and `torch/serialization.py`: verify exact exports removed and format-specific Python loading behavior. 3. Group deleted suites with their fixtures/helper/provider closure; inspect mixed-test edits for preserved independent eager/public coverage rather than private TorchScript parity. 4. Review surviving library callers, RPC/NNAPI boundaries, and the narrowly scoped CPU/GPU TorchBench deferral. Compare normal, performance, dashboard and exporter/backend controls. 5. Review **D129970553** separately for canonical internal source selection, original-layout copies, no test copies, and the source-identity/runtime evidence. Source adaptation is not inferred from a matching filename. 6. Check the posted Export/Dynamo questions and explicitly documented validation gaps rather than treating an unrelated green job as their resolution. ## Links Part of #201298 Dependency: #203783 Deferred CPU TorchBench migrations: #203757 Differential Revision: https://www.internalfb.com/diff/D130430904 Pull Request resolved: #203621 Approved by: https://github.com/justinchuby, https://github.com/ngimel
Update the timm pin because the old one imported an API that depends on torchscript
A result is that the operator benchmarks improved :)
Stack from ghstack (oldest at bottom):
Linked issue or supporting maintainer
Dependency for TS public API removal
Agent details — AI-generated
Update the CI timm pin from 1.0.22 (
af3732eebe8c1964e5ba5f2769f955e6e0deb980) to the released 1.0.31 revision (43b549bfe9d680bc94284cfd0b611152d18e97d7). This PR changes only.ci/docker/ci_commit_pins/timm.txt.The old pin imports HRNet's
@torch.jit.interfacedeclaration while importing the timm package, before benchmark model selection. That caused all six CPU/CUDA timm shards to fail when the deprecated TorchScript entrypoints were removed in #203621. The released version removes that import-time dependency.Test plan
The pin is a verified released source revision, and its import-time TorchScript dependency was inspected. CI must rebuild the Docker images and validate the timm benchmarks. This description does not claim that all new-image accuracy/performance checks have passed.
This dependency-only PR is separate from the TorchScript API/test retirement. It does not weaken benchmark expectations, restore aliases, or skip timm models. Operator-benchmark base/head comparison requires checking actual source, image and compiler provenance; separating the pin does not itself prove a performance cause.