pytorch/torch/export
Angela Yi 3b21d79225 [export] Move PT2ArchiveWriter/Reader to torch/export (#153795)
Summary:
Before:
`from sigmoid.core.package.pt2_archive import PT2ArchiveWriter, PT2ArchiveReader, is_sigmoid_package`
After:
`from torch.export.pt2_archive import PT2ArchiveWriter, PT2ArchiveReader, is_pt2_package`

By merging the two PT2ArchiveReader/Writers, into using the native PytorchFileReader/Writer, the open source PT2 archive also changed to have an additional folder. However this PR still maintains support for loading an old PT2 archive which does not have the additional folder.

Before:
```
├── archive_format
├── byteorder
├── .data
│   ├── serialization_id
│   └── version
├── data
│   ├── aotinductor

```
After:
```
├── tmp
│   ├── archive_format
│   ├── byteorder
│   ├── .data
│   │   ├── serialization_id
│   │   └── version
│   ├── data
│   │   ├── aotinductor
```

Test Plan:
`buck2 test //sigmoid/...`
https://www.internalfb.com/intern/testinfra/testrun/5348024839248187

Pull Request resolved: https://github.com/pytorch/pytorch/pull/153795
Approved by: https://github.com/zhxchen17
2025-05-23 19:04:36 +00:00
..
experimental [export] Exporter API prototype. (#153205) 2025-05-11 14:20:09 +00:00
passes PEP585: More UP006 fixes (#146392) 2025-02-20 06:18:13 +00:00
pt2_archive [export] Move PT2ArchiveWriter/Reader to torch/export (#153795) 2025-05-23 19:04:36 +00:00
__init__.py [export] Make draft_export public (#153219) 2025-05-14 02:18:36 +00:00
_draft_export.py [export] Make draft_export public (#153219) 2025-05-14 02:18:36 +00:00
_remove_auto_functionalized_pass.py remove allow-untyped-defs from torch/export/_remove_auto_functionalized_pass.py (#144230) 2025-01-06 22:23:19 +00:00
_remove_effect_tokens_pass.py Fakify torchbind objects in compile_fx and add tests for SigridTransformsInstanceTorchBind (#149529) 2025-03-21 18:58:28 +00:00
_safeguard.py Flip default value for mypy disallow_untyped_defs [6/11] (#127843) 2024-06-08 18:49:29 +00:00
_swap.py PEP585 update - torch/export (#145165) 2025-01-19 20:56:55 +00:00
_trace.py Revert "[BE]: Enable RUFF TRY400 rule - log.exception (#153473)" 2025-05-16 08:29:26 +00:00
_tree_utils.py PEP585 update - torch/export (#145165) 2025-01-19 20:56:55 +00:00
_unlift.py Suppress more warnings (#149833) 2025-04-01 05:33:04 +00:00
_wrapper_utils.py [reland] Make export._trace._WrapperModule work in strict mode (#146919) (#151264) 2025-04-15 18:35:34 +00:00
custom_obj.py
custom_ops.py Fix subclass access custom op bug (#149698) 2025-03-21 19:42:56 +00:00
decomp_utils.py Re-land exclude upsample_bilinear2d.vec and nearest2d.vec from default export decomposition table (#147153) 2025-02-19 23:03:29 +00:00
dynamic_shapes.py Fix additional inputs to error on inconsistent constants (#151970) 2025-04-30 01:38:17 +00:00
exported_program.py [export][function schema] support exporting hop with function schema argument (#152073) 2025-05-01 05:22:02 +00:00
graph_signature.py pretty print graph signature (#149710) 2025-03-21 21:31:58 +00:00
unflatten.py [export] Support no inputs in unflattened module (#153474) 2025-05-14 18:45:47 +00:00