Repository navigation
Conversation
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ⚪ AUTOMATED REVIEW - Skipped, PR too large to review:
This PR is over the automated review's size limit, so it was not reviewed. Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/203621
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 2 Unclassified FailuresAs of commit 7543dc7 with merge base 29e8991 ( 🟡 GREEN LIGHT - PR was reverted - re-landing requires human review:
Green Light will not review this PR again, on this or any later commit; re-landing it needs a human approval. NEW FAILURE - The following job has failed:
UNCLASSIFIED FAILURES - DrCI could not classify the following jobs because the workflow did not run on the merge base. The failures may be pre-existing on trunk or introduced by this PR:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
… support retained) ## Linked issue or supporting maintainer Part of #201298 Differential Revision: https://www.internalfb.com/diff/D129970553 ## Summary (human written only) > yea can you make a draft PR linked to diff (a codev PR i guess) to show me what's happening? > Since there was already an older deprecation warning on that behavior, we can remove the functionality! ## Agent details ### AI-generated summary This visibility draft removes deprecated public TorchScript Python aliases and 163 dedicated public test/asset files. It now also rejects TorchScript archives passed to public torch.load, for either weights_only mode. Ordinary tensor/state-dict checkpoints remain supported. Migration guidance points to exporting the original model or using an older version to load an existing legacy archive. Internal canonical JIT/RPC APIs, the original full serialization module, and original archive-loading tests are retained in the internal diff through excluded fb/ providers; those files are not included here. Shared native serialization/compiler infrastructure remains for surviving or unwarned consumers. This is not a completed removal rollout. The public preview is adapted to the captured public base and must be reconciled with the final CodeSync export before landing the internal diff. Do not merge it independently on GitHub. ### AI-generated validation status Not ready to merge or land. The initial full internal CPU run recorded 3909 TPX passes, 77 failures and 374 skips. Of those failures, 41 reproduced on the unchanged base, 34 were relocation resource-adjacency defects, and 2 stochastic quantization failures remain unclassified. All 34 relocation failures passed after repairing coherent source/fixture staging. No original test or golden values were changed to hide a failure. For expanded archive retirement, all 11 targeted internal serialization methods passed, including original legacy-archive acceptance. The exported public source passed both archive-rejection cases and 10 ordinary checkpoint/sharing methods. The complete 19-method public compatibility suite also passed after correcting its old archive expectations. These public runs reused real unchanged native libraries and are limited Python/source-profile evidence, not a full rebuilt native candidate. Full CodeSync translation was checked to contain 309 intended public paths, all 163 public deletions, and zero private source/destination/copy/rename headers. The internal original source preimages and source mappings were reviewed independently. Two review findings—a stale public compatibility test and stale documentation—were fixed. Normal-configuration Dynamo and remote GPU/LLVM validation are running on a separate worker against the hash-verified v2 snapshot. GPU/mobile/ARVR, final export-to-diff reconciliation, and the remaining baseline/quantization exceptions remain gates. ### AI-generated test plan The public patch passed syntax and whitespace checks. Scoped spin lint passed for the public modified files; ownership metadata was validated against the committed tree after removing dead test patterns and adding the compatibility test to its existing ownership group. ```sh spin fixlint -- torch/serialization.py test/test_serialization.py test/test_torchscript_compatibility.py docs/source/notes/cpu_threading_torchscript_inference.md lintrunner -a OWNERSHIP.yaml CODEOWNERS git diff HEAD --check ``` CI remains deferred for this changing review-only draft and must be enabled before merge gating. Prepared with an AI assistant under the owner's direction and explicit approval to publish draft updates. No land or merge is authorized. ghstack-source-id: 5a31a60 Pull-Request: #203621
… support retained) ## Linked issue or supporting maintainer Part of #201298 Differential Revision: https://www.internalfb.com/diff/D129970553 ## Summary (human written only) > yea can you make a draft PR linked to diff (a codev PR i guess) to show me what's happening? > Since there was already an older deprecation warning on that behavior, we can remove the functionality! ## Agent details ### AI-generated summary This visibility draft removes deprecated public TorchScript Python aliases and 163 dedicated public test/asset files. It also rejects TorchScript archives passed to public torch.load, for either weights_only mode. Ordinary tensor/state-dict checkpoints remain supported. Migration guidance points to exporting the original model or using an older version to load an existing legacy archive. Internal canonical JIT/RPC APIs, the original full serialization module, and original archive-loading tests are retained in the internal diff through excluded fb/ providers; those files are not included here. Shared native serialization/compiler infrastructure remains for surviving or unwarned consumers. This is not a completed removal rollout. The public preview is adapted to the captured public base and must be reconciled with the final CodeSync export before landing the internal diff. Do not merge it independently on GitHub. ### AI-generated validation status Not ready to merge or land. The initial full internal CPU run recorded 3909 TPX passes, 77 failures and 374 skips. All 34 relocation resource-adjacency failures passed after repairing coherent source/fixture staging. The remaining 43 failures reproduced on the unchanged base, leaving zero unclassified cases. Focused QNNPACK reproduction confirmed a Hypothesis differing_executors harness error; the original leaky-ReLU inner test reproduced the logged numerical mismatch across four engines. The latter replays saved decimal inputs, not claimed original seed or raw-bit identity. No assertions or tolerances were changed to hide failures. For expanded archive retirement, all 11 targeted internal serialization methods passed, including original legacy-archive acceptance. The exported public source passed both archive-rejection cases and 10 ordinary checkpoint/sharing methods. The complete 19-method public compatibility suite passed after correcting its old archive expectations; the subsequently retained native CallStack regression passed separately. These public runs reused real native libraries and are limited Python/source-profile evidence, not a full rebuilt native candidate. Final V4 CodeSync translation contains 313 public paths, all 163 public deletions, 23 real binary records, and zero private/copy/rename/placeholder headers. Independently reviewed direct official export and baseline-plus-patch trees match across all 22538 paths, blob hashes, and modes. Existing 408 retained source files remain byte-identical; four new copies have reviewed import-order/docstring-only formatting and passing runtime checks. The earlier archive-test/documentation/Windows-fixture findings were fixed. The external PR review's five caller/documentation defects are addressed: generated code and surviving fixtures use existing private implementations, the retained archive driver uses its existing loader, the obsolete compiler example is removed, and a retired scripting-only compiler-flag subcheck is deleted. Focused CallStack lifetime and FileCheck rejection/boundary regressions remain for still-supported native utilities. Separate exact-v2 normal opt/NVIDIA validation completed: 18164 Dynamo methods produced 17438 passes, 726 upstream skips, zero failures/fatals/timeouts. All 120 failed GPU/LLVM method identities/statuses reproduced on the exact unchanged base. Most generated NNC cases return early because they are CPU-only; they are not GPU-operator coverage. These runs precede later review fixes. Subsequent actual compiled-native instantiator execution passed all three methods, including the corrected generated scripted RemoteModule template. Broader downstream/mobile/ARVR coverage, public CI, release-warning eligibility, and final GitHub-to-export reconciliation remain gates. ### AI-generated test plan The public patch passed syntax and whitespace checks. Scoped spin lint passed for the modified files. Actual public-source/native-library checks passed for generated Callgrind load source, the archive driver with an eager .orig checkpoint, the quantization save/load fixture, one cross-thread CallStack test, and all 16 FileCheck tests. These are source-profile and native utility checks, not a complete native rebuild or Valgrind performance run. Three actual compiled-native generated-template methods passed separately. Ownership metadata was checked against the committed tree. ```sh spin fixlint -- torch/serialization.py test/test_serialization.py test/test_torchscript_compatibility.py docs/source/notes/cpu_threading_torchscript_inference.md lintrunner -a OWNERSHIP.yaml CODEOWNERS git diff HEAD --check ``` CI remains deferred for this changing review-only draft and must be enabled before merge gating. Prepared with an AI assistant under the owner's direction. No land or merge is authorized. ghstack-source-id: 812e563 Pull-Request: #203621
|
@claude we are removing deprecated APIs + their tests. can you go over this and ensure:
|
|
Claude finished @janeyx99's task in 2m 51s —— View job Nothing outside the targeted list gets deleted from DetailsSummaryThis PR removes 12 names from the public I checked these points directly:
1. Public functionality this effectively removes (please confirm each is intended)Removed from the public namespace on purpose, with user-visible effects:
Still public, but there is no longer a public way to create their input (a ScriptModule, an interface, or a traced module). They are not deleted, but users can't do anything with them. Most have no runtime deprecation warning, so they should get one, or the PR should say why they stay:
Things that break because of this PR and are not handled:
Smaller issues in the diff:
2. More that could be deleted (follow-up)
RecommendationRequest Changes. The fastrnns CI breakage, the dead RPC JIT test helpers plus their |
… retained) ## Linked issue or supporting maintainer Part of #201298 Differential Revision: https://www.internalfb.com/diff/D129970553 ## Summary (human written only) > yea can you make a draft PR linked to diff (a codev PR i guess) to show me what's happening? > Since there was already an older deprecation warning on that behavior, we can remove the functionality! ## Agent details ### AI-generated summary This visibility draft removes deprecated public TorchScript Python aliases and 163 dedicated public test/asset files. It also rejects TorchScript archives passed to public torch.load, for either weights_only mode. Ordinary tensor/state-dict checkpoints remain supported. Migration guidance points to exporting the original model or using an older version to load an existing legacy archive. Internal canonical JIT/RPC APIs, the original full serialization module, and original archive-loading tests are retained in the internal diff through excluded fb/ providers; those files are not included here. Shared native serialization/compiler infrastructure remains for surviving or unwarned consumers. This is not a completed removal rollout. The public preview is adapted to the captured public base and must be reconciled with the final CodeSync export before landing the internal diff. Do not merge it independently on GitHub. ### AI-generated validation status Not ready to merge or land. The initial full internal CPU run recorded 3909 TPX passes, 77 failures and 374 skips. All 34 relocation resource-adjacency failures passed after repairing coherent source/fixture staging. The remaining 43 failures reproduced on the unchanged base, leaving zero unclassified cases. Focused QNNPACK reproduction confirmed a Hypothesis differing_executors harness error; the original leaky-ReLU inner test reproduced the logged numerical mismatch across four engines. The latter replays saved decimal inputs, not claimed original seed or raw-bit identity. No assertions or tolerances were changed to hide failures. For expanded archive retirement, all 11 targeted internal serialization methods passed, including original legacy-archive acceptance. The exported public source passed both archive-rejection cases and 10 ordinary checkpoint/sharing methods. The complete 19-method public compatibility suite passed after correcting its old archive expectations; the subsequently retained native CallStack regression passed separately. These public runs reused real native libraries and are limited Python/source-profile evidence, not a full rebuilt native candidate. Final V4 CodeSync translation contains 313 public paths, all 163 public deletions, 23 real binary records, and zero private/copy/rename/placeholder headers. Independently reviewed direct official export and baseline-plus-patch trees match across all 22538 paths, blob hashes, and modes. Existing 408 retained source files remain byte-identical; four new copies have reviewed import-order/docstring-only formatting and passing runtime checks. The earlier archive-test/documentation/Windows-fixture findings were fixed. The external PR review's five caller/documentation defects are addressed: generated code and surviving fixtures use existing private implementations, the retained archive driver uses its existing loader, the obsolete compiler example is removed, and a retired scripting-only compiler-flag subcheck is deleted. Focused CallStack lifetime and FileCheck rejection/boundary regressions remain for still-supported native utilities. Separate exact-v2 normal opt/NVIDIA validation completed: 18164 Dynamo methods produced 17438 passes, 726 upstream skips, zero failures/fatals/timeouts. All 120 failed GPU/LLVM method identities/statuses reproduced on the exact unchanged base. Most generated NNC cases return early because they are CPU-only; they are not GPU-operator coverage. These runs precede later review fixes. Subsequent actual compiled-native instantiator execution passed all three methods, including the corrected generated scripted RemoteModule template. Broader downstream/mobile/ARVR coverage, public CI, release-warning eligibility, and final GitHub-to-export reconciliation remain gates. ### AI-generated test plan The public patch passed syntax and whitespace checks. Scoped spin lint passed for the modified files. Actual public-source/native-library checks passed for generated Callgrind load source, the archive driver with an eager .orig checkpoint, the quantization save/load fixture, one cross-thread CallStack test, and all 16 FileCheck tests. These are source-profile and native utility checks, not a complete native rebuild or Valgrind performance run. Three actual compiled-native generated-template methods passed separately. Ownership metadata was checked against the committed tree. ```sh spin fixlint -- torch/serialization.py test/test_serialization.py test/test_torchscript_compatibility.py docs/source/notes/cpu_threading_torchscript_inference.md lintrunner -a OWNERSHIP.yaml CODEOWNERS git diff HEAD --check ``` CI is enabled for this review draft; its required checks must pass before merge gating. Prepared with an AI assistant under the owner's direction. No land or merge is authorized. ghstack-source-id: 812e563 Pull-Request: #203621
…ementations only ## Linked issue or supporting maintainer Part of #201298 Differential Revision: https://www.internalfb.com/diff/D129970553 ## Summary (human written only) > yea can you make a draft PR linked to diff (a codev PR i guess) to show me what's happening? > Since there was already an older deprecation warning on that behavior, we can remove the functionality! ## Agent details ### AI-generated summary Implementation-only second attempt under the owner's updated scope. Retire the twelve already-warned public TorchScript aliases and public torch.load acceptance of TorchScript ZIP archives. Keep ordinary checkpoints and concrete supported public consumer coverage. Delete the obsolete CPU threading TorchScript page; migration/rationale belongs in the release/change summary. All 480 task-added internal legacy-test/helper/fixture/golden/provider files from V4/R1/R2 are removed, along with their retention routing. Only necessary canonical JIT and serialization implementation overlays remain. Pre-existing internal-only test files are not copied or deleted. The internal diff and public deletion preview are separate review surfaces and require final CodeSync reconciliation. Public fastrnns CI now uses native/CUDNN/eager variants, not privately re-scripted retired variants. Public JIT OpInfo parity and the conditional IS_FBCODE xfail workaround are removed. Real mobile optimizer/lint/bundled-input coverage remains, including focused XNNPACK Conv1d optimizer returned graph/numerics without private rewrite/serde assertions. Scoped global deletion groups are continuing in independent scratch worktrees; this is not complete all-test assurance. ### AI-generated validation status WIP, not ready to merge or land. Historical frozen R2 public F1-wheel profile: 23 collected, 18 passes, 5 existing prerequisite skips (four missing XNNPACK, one missing torchvision), zero failures/XPASS. Historical internal R2: four actual method passes (three instantiator cases and async multi-fork), one copied-JSON packaging failure; other records are mains/listings. That test-retention architecture has now been removed, not claimed fixed by those results. These runs do not certify the current implementation-only source. Normal Spin setup/version/type-stub generation was explicitly approved and ran. Scoped fixlint and precommit lintrunner applied formatting/import fixes. The taxonomy checker uses committed HEAD paths: before commit it reported 169 now-deleted paths, while unchanged checker analysis of the actual staged 22,522 paths has zero uncovered/stale/duplicate/ineffective/order/group/owner errors. The normal taxonomy check is rerun after commit. No linter, hook, test, ownership scope or security bypass was used. The all-test audit and native dependency contracts remain incomplete; 418 candidate paths and 27 extra dependency paths are under review. Known exact follow-ups and supported-build XNNPACK validation are pending and will be additional authorized iterations. No global audit or passing-CI gate is implied by this visibility draft. CI stays enabled. No merge or landing is authorized. ### AI-generated test plan ```sh spin lint -- <changed surviving files> spin fixlint -- <changed surviving files> lintrunner -a <changed surviving files> git diff --cached --check python scripts/codeowners/check_taxonomy.py ``` No newly copied internal tests, fixtures, goldens or test-only providers remain. Public and internal binary-complete patches and exact source/base hashes are banked for owner review. ghstack-source-id: 1bed8ef Pull-Request: #203621
…ementations only ## Linked issue or supporting maintainer Part of #201298 Differential Revision: https://www.internalfb.com/diff/D129970553 ## Summary (human written only) > yea can you make a draft PR linked to diff (a codev PR i guess) to show me what's happening? > Since there was already an older deprecation warning on that behavior, we can remove the functionality! ## Agent details ### AI-generated summary Implementation-only second attempt under the owner's updated scope. Retire the twelve already-warned public TorchScript aliases and public torch.load acceptance of TorchScript ZIP archives. Keep ordinary checkpoints and concrete supported public consumer coverage. Delete the obsolete CPU threading TorchScript page; migration/rationale belongs in the release/change summary. All 480 task-added internal legacy-test/helper/fixture/golden/provider files from V4/R1/R2 are removed, along with their retention routing. The additional two compatibility suites and two hook-fixture helpers outside that prefix inventory are now removed as well; the pre-existing hook utility remains unchanged at its original path for its verified public C++ Module consumer. Only necessary canonical JIT and serialization implementation overlays remain. Pre-existing internal-only test files are not copied or deleted. The internal diff and public deletion preview are separate review surfaces and require final CodeSync reconciliation. Public fastrnns CI now uses native/CUDNN/eager variants, not privately re-scripted retired variants. Public JIT OpInfo parity and the conditional IS_FBCODE xfail workaround are removed. Real mobile optimizer/lint/bundled-input coverage remains, including focused XNNPACK Conv1d optimizer returned graph/numerics without private rewrite/serde assertions. The additional 20-file verified legacy ONNX/converter/package deletion group is integrated; modern export, public package archives and eager assertions remain. Complete source audit attribution is not runtime assurance, which continues on independent immutable inputs. ### AI-generated validation status WIP, not ready to merge or land. Historical frozen R2 public F1-wheel profile: 23 collected, 18 passes, 5 existing prerequisite skips (four missing XNNPACK, one missing torchvision), zero failures/XPASS. Historical internal R2: four actual method passes (three instantiator cases and async multi-fork), one copied-JSON packaging failure; other records are mains/listings. That test-retention architecture has now been removed, not claimed fixed by those results. These runs do not certify the current implementation-only source. Normal Spin setup/version/type-stub generation was explicitly approved and ran. Scoped fixlint and precommit lintrunner applied formatting/import fixes. The taxonomy checker uses committed HEAD paths: before commit it reported 169 now-deleted paths, while unchanged checker analysis of the actual staged 22,522 paths has zero uncovered/stale/duplicate/ineffective/order/group/owner errors. The normal taxonomy check is rerun after commit. No linter, hook, test, ownership scope or security bypass was used. The all-test audit and native dependency contracts remain incomplete; 418 candidate paths and 27 extra dependency paths are under review. Known exact follow-ups and supported-build XNNPACK validation are pending and will be additional authorized iterations. No global audit or passing-CI gate is implied by this visibility draft. CI stays enabled. No merge or landing is authorized. ### AI-generated test plan ```sh spin lint -- <changed surviving files> spin fixlint -- <changed surviving files> lintrunner -a <changed surviving files> git diff --cached --check python scripts/codeowners/check_taxonomy.py ``` No newly copied internal tests, fixtures, goldens or test-only providers remain. Public and internal binary-complete patches and exact source/base hashes are banked for owner review. ghstack-source-id: 62d4e7e Pull-Request: #203621
Stack from ghstack (oldest at bottom):
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.jitAPIs: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:
torch.loadacceptance of TorchScript ZIP/module archives, in eitherweights_onlymode. Ordinary tensor/state-dict checkpoints remain supported.supported_opsdoc-generation module.And the tests and benchmarks associated with the above APIs.
This is not wholesale deletion of
torch/csrc/jit. Supported publicScriptModule/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?
AI-generated measurement details (provisional; not final-green)
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 Migrate some torchbench models away from torchscript + add them back to inductor bench #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::Moduleinterface. 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
scriptoptions reject rather than silently running eager code. No half-cut API is described as finished.BC Lint still flags
scriptAndSave/Testfrom the deleted Android generator andjit_stepfrom 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_compileis tracked in [deprecation] functorch.compile.ts_compile #203804, attached under ☂️ Deprecations and frozen components: when they started, and when the code is removed #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
fbfolder:fb/torch/jit/__init__.py→ installedtorch/jit/__init__.pyfb/torch/serialization.py→ installedtorch/serialization.pyThe 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
TypeIsimport changed.Test plan
How to best review
torch/jit/__init__.pyandtorch/serialization.py: verify exact exports removed and format-specific Python loading behavior.Links
Part of #201298
Dependency: #203783
Deferred CPU TorchBench migrations: #203757
Differential Revision: https://www.internalfb.com/diff/D130430904
cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @aditew01 @gujinghui @PenghuiCheng @jianyuh @min-jean-cho @yanbing-j @Guobing-Chen @Xia-Weiwen @snadampal @albanD @voznesenskym @penguinwu @EikanWang @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo @azahed98