pytorch/torch/_export
Benjamin Glass 37a1b9efcc [export] Serialize all dataclass fields (#142286)
Reverts a change in #121337. All dataclass members must be serialized, even default-valued members, because downstream code often implicitly assumes their presence.

This PR fixes a segfault when running `test_custom_op_all_inputs` from `test/inductor/test_aot_inductor_custom_ops.py`. This segfault was caused by querying for an "index" field for the `Device` type (see `torch/csrc/inductor/aoti_torch/oss_proxy_executor.cpp:136`), which was previously skipped when serializing if the device index was unspecified. A number of other structs which are deserialized in this file also contain optional fields, and presumably could experience the same bug.

Fixes #138955

Fixes #134793
Pull Request resolved: https://github.com/pytorch/pytorch/pull/142286
Approved by: https://github.com/zhxchen17
ghstack dependencies: #142175
2024-12-17 17:21:27 +00:00
..
db Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
pass_infra
passes [BE] Remove unused argument (#141983) 2024-12-04 00:07:33 +00:00
serde [export] Serialize all dataclass fields (#142286) 2024-12-17 17:21:27 +00:00
__init__.py Revert "Kill capture_pre_autograd_graph API (#143224)" 2024-12-17 00:47:24 +00:00
converter.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
error.py
non_strict_utils.py support slicing with symints in non-strict (#143217) 2024-12-14 10:27:45 +00:00
pass_base.py Support symbolic builtin round in export (#139549) 2024-11-07 02:49:44 +00:00
tools.py
utils.py Remove unused Python variables in torch/[_-a]* (#133492) 2024-12-12 17:39:14 +00:00
verifier.py Add truediv support in export serializer (#136364) 2024-12-05 17:33:33 +00:00
wrappers.py