pytorch/test/cpp/aoti_inference
Mu-Chu Lee c3a18f6126 [AOTInductor] Add states for constant folding process (#151273)
Summary:
We add states in the constant folding process for AOTInductor.
Basically, there's 3 states, which is
(1) None: The state when no constants are loaded and uninitialized.
(2) Initialized: The state when constants are loaded, but not yet
folded.
(3) Folded: The state where the model is fully ready with folded
constants.

Note that even if constant folding is not enabled, we still only run
when state is FOLDED, this is okay because without constant folding, the
transition from INITIALIZED to FOLDED is just a pass-throught.

Test Plan:
python test/inductor/test_aot_inductor.py -k test_constant_folding_with_update

Reviewers:

Subscribers:

Tasks:

Tags:

Differential Revision: [D73002538](https://our.internmc.facebook.com/intern/diff/D73002538)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/151273
Approved by: https://github.com/jingsh, https://github.com/desertfire
2025-04-17 16:41:38 +00:00
..
aoti_custom_class.cpp [AOTI] Fix #140546 and support AOTI package load for Intel GPU. (#140664) 2024-12-10 05:05:08 +00:00
aoti_custom_class.h
CMakeLists.txt [ROCm][Inductor] Enable AOT Inductor CPP UTs for ROCm (#131521) 2024-08-08 19:49:56 +00:00
compile_model.py [AOTI] Fix test_aoti_inference CPU build issue (#134675) 2024-08-28 17:42:19 +00:00
generate_lowered_cpu.py [AOTInductor] Add standalone test for compilation from ExportedProgram (#142327) 2024-12-10 06:50:09 +00:00
standalone_compile.sh [AOTInductor] Add standalone test for compilation from ExportedProgram (#142327) 2024-12-10 06:50:09 +00:00
standalone_test.cpp [AOTInductor] Add standalone test for compilation from ExportedProgram (#142327) 2024-12-10 06:50:09 +00:00
test.cpp [AOTInductor] Add states for constant folding process (#151273) 2025-04-17 16:41:38 +00:00
test.py [AOTInductor] Free folded constants that's managed by AOTInductor (#149825) 2025-03-27 06:05:50 +00:00