pytorch/torch/_export
Yidi Wu 404a8ae8f6 [export] fix set_grad x tensor constant. (#131787)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/130379.

The original error is verifier finds that the placeholder nodes' meta[''val"] are missing in subgraph of WrapSetGradEnabled hop.

In this PR, we fixed it by re-ordering the replace_set_grad_with_hop_pass with lift_constant_tensor pass because only after lift_constant_pass, all the constant attrs start to have meta["val"].

Test Plan: buck2 test test:test_export -- -r "test_setgrad_lifted_tensor"

Differential Revision: D60244935

Pull Request resolved: https://github.com/pytorch/pytorch/pull/131787
Approved by: https://github.com/yushangdi
2024-07-26 16:41:59 +00:00
..
db [export] Update example inputs format for DB. (#129982) 2024-07-03 17:53:15 +00:00
pass_infra Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
passes [export] fix set_grad x tensor constant. (#131787) 2024-07-26 16:41:59 +00:00
serde [aoti] Add initial custom op support (#127034) 2024-07-24 20:29:55 +00:00
__init__.py fix non-persistent buffers (#131756) 2024-07-26 04:45:30 +00:00
converter.py [BE] typing for decorators - fx/_compatibility (#131568) 2024-07-25 22:24:19 +00:00
error.py Fix global flake8 issues (#124771) 2024-04-26 15:35:53 +00:00
non_strict_utils.py refactor post-trace fakification in strict (#131421) 2024-07-23 18:23:03 +00:00
pass_base.py [BE] typing for decorators - fx/_compatibility (#131568) 2024-07-25 22:24:19 +00:00
tools.py Flip default value for mypy disallow_untyped_defs [2/11] (#127839) 2024-06-08 18:23:08 +00:00
utils.py Revert "[export] fix zero arg export in training_ir (#130990)" 2024-07-22 16:49:25 +00:00
verifier.py [export] Fully support extension op in serialization/deserialization. (#130851) 2024-07-18 16:47:53 +00:00
wrappers.py Flip default value for mypy disallow_untyped_defs [2/11] (#127839) 2024-06-08 18:23:08 +00:00