diff --git a/codegen/tools/targets.bzl b/codegen/tools/targets.bzl index fb629adf047..c37c77459df 100644 --- a/codegen/tools/targets.bzl +++ b/codegen/tools/targets.bzl @@ -179,7 +179,7 @@ def define_common_targets(is_fbcode = False): srcs = ["test/test_gen_oplist_real_model.py"], base_module = "", resources = { - "//executorch/test/models:exported_programs[ModuleLinear.pte]": "test/ModuleLinear.pte", + "//executorch/test/models:exported_programs[ModuleAddMul.pte]": "test/ModuleAddMul.pte", }, visibility = [ "//executorch/...", diff --git a/codegen/tools/test/test_gen_oplist_real_model.py b/codegen/tools/test/test_gen_oplist_real_model.py index 685e7f8e31b..93098cc512f 100644 --- a/codegen/tools/test/test_gen_oplist_real_model.py +++ b/codegen/tools/test/test_gen_oplist_real_model.py @@ -15,7 +15,7 @@ from libfb.py import parutil # type: ignore[import-not-found] -MODEL_PATH: Final[str] = parutil.get_file_path("ModuleLinear.pte", pkg=__package__) +MODEL_PATH: Final[str] = parutil.get_file_path("ModuleAddMul.pte", pkg=__package__) class TestGenOplistRealModel(unittest.TestCase): diff --git a/extension/flat_tensor/test/CMakeLists.txt b/extension/flat_tensor/test/CMakeLists.txt index e22025215c5..6c3110065c2 100644 --- a/extension/flat_tensor/test/CMakeLists.txt +++ b/extension/flat_tensor/test/CMakeLists.txt @@ -19,23 +19,23 @@ set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..) include(${EXECUTORCH_ROOT}/tools/cmake/Test.cmake) add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd" COMMAND - python -m test.models.export_program --modules "ModuleLinear" + python -m test.models.export_program --modules "ModuleAddMul" --external-constants --outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null WORKING_DIRECTORY ${EXECUTORCH_ROOT} ) add_custom_target( extension_flat_tensor_test_resources - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd" ) set(test_env - "ET_MODULE_LINEAR_PROGRAM_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte" - "ET_MODULE_LINEAR_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd" + "ET_MODULE_ADD_MUL_PROGRAM_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte" + "ET_MODULE_ADD_MUL_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd" ) set(_test_srcs flat_tensor_data_map_test.cpp flat_tensor_header_test.cpp) diff --git a/extension/flat_tensor/test/flat_tensor_data_map_test.cpp b/extension/flat_tensor/test/flat_tensor_data_map_test.cpp index ac4583eda88..0d8bf9659bb 100644 --- a/extension/flat_tensor/test/flat_tensor_data_map_test.cpp +++ b/extension/flat_tensor/test/flat_tensor_data_map_test.cpp @@ -35,7 +35,7 @@ class FlatTensorDataMapTest : public ::testing::Test { // Load data map. The eager linear model is defined at: // //executorch/test/models/linear_model.py - const char* path = std::getenv("ET_MODULE_LINEAR_DATA_PATH"); + const char* path = std::getenv("ET_MODULE_ADD_MUL_DATA_PATH"); Result loader = FileDataLoader::from(path); ASSERT_EQ(loader.error(), Error::Ok); diff --git a/extension/flat_tensor/test/targets.bzl b/extension/flat_tensor/test/targets.bzl index a2b96526ab5..4d798cc1a7c 100644 --- a/extension/flat_tensor/test/targets.bzl +++ b/extension/flat_tensor/test/targets.bzl @@ -35,8 +35,8 @@ def define_common_targets(is_fbcode=False): # The tests use this var to find the program file to load. This uses # an fbcode target path because the authoring/export tools # intentionally don't work in xplat (since they're host-only tools). - "ET_MODULE_LINEAR_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.pte])", - "ET_MODULE_LINEAR_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.ptd])", + "ET_MODULE_ADD_MUL_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.pte])", + "ET_MODULE_ADD_MUL_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.ptd])", } runtime.cxx_test( diff --git a/extension/module/test/CMakeLists.txt b/extension/module/test/CMakeLists.txt index 6ed42f63034..bb93553d370 100644 --- a/extension/module/test/CMakeLists.txt +++ b/extension/module/test/CMakeLists.txt @@ -21,13 +21,13 @@ set(_test_srcs module_test.cpp) add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd" COMMAND python3 -m test.models.export_program --modules "ModuleAdd" --outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null COMMAND - python3 -m test.models.export_program --modules "ModuleLinear" + python3 -m test.models.export_program --modules "ModuleAddMul" --external-constants --outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null WORKING_DIRECTORY ${EXECUTORCH_ROOT} ) @@ -35,14 +35,14 @@ add_custom_command( add_custom_target( generated_module_test_files DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd" ) set(test_env "ET_MODULE_ADD_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte" - "ET_MODULE_LINEAR_PROGRAM_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte" - "ET_MODULE_LINEAR_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd" + "ET_MODULE_ADD_MUL_PROGRAM_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte" + "ET_MODULE_ADD_MUL_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd" ) et_cxx_test( diff --git a/extension/module/test/module_test.cpp b/extension/module/test/module_test.cpp index 38d739767a9..6d0b941706d 100644 --- a/extension/module/test/module_test.cpp +++ b/extension/module/test/module_test.cpp @@ -24,13 +24,13 @@ class ModuleTest : public ::testing::Test { protected: static void SetUpTestSuite() { model_path_ = std::getenv("ET_MODULE_ADD_PATH"); - linear_path_ = std::getenv("ET_MODULE_LINEAR_PROGRAM_PATH"); - linear_data_path_ = std::getenv("ET_MODULE_LINEAR_DATA_PATH"); + add_mul_path_ = std::getenv("ET_MODULE_ADD_MUL_PROGRAM_PATH"); + add_mul_data_path_ = std::getenv("ET_MODULE_ADD_MUL_DATA_PATH"); } static inline std::string model_path_; - static inline std::string linear_path_; - static inline std::string linear_data_path_; + static inline std::string add_mul_path_; + static inline std::string add_mul_data_path_; }; TEST_F(ModuleTest, TestLoad) { @@ -449,7 +449,7 @@ TEST_F(ModuleTest, TestSetOutputInvalidType) { } TEST_F(ModuleTest, TestPTD) { - Module module(linear_path_, linear_data_path_); + Module module(add_mul_path_, add_mul_data_path_); ASSERT_EQ(module.load_method("forward"), Error::Ok); diff --git a/extension/module/test/targets.bzl b/extension/module/test/targets.bzl index b684e8d07b6..e308ca89c30 100644 --- a/extension/module/test/targets.bzl +++ b/extension/module/test/targets.bzl @@ -17,8 +17,8 @@ def define_common_targets(is_fbcode=False): # an fbcode target path because the authoring/export tools # intentionally don't work in xplat (since they're host-only tools). "ET_MODULE_ADD_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleAdd.pte])", - "ET_MODULE_LINEAR_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.pte])", - "ET_MODULE_LINEAR_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.ptd])", + "ET_MODULE_ADD_MUL_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.pte])", + "ET_MODULE_ADD_MUL_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.ptd])", } for aten_mode in get_aten_mode_options(): @@ -42,5 +42,3 @@ def define_common_targets(is_fbcode=False): "-Wno-error=deprecated-declarations", ], ) - - diff --git a/extension/training/module/test/state_dict_util_test.cpp b/extension/training/module/test/state_dict_util_test.cpp index 14e5b0d4f0d..af8bdff53e1 100644 --- a/extension/training/module/test/state_dict_util_test.cpp +++ b/extension/training/module/test/state_dict_util_test.cpp @@ -36,7 +36,7 @@ class LoadStateDictTest : public ::testing::Test { // Load data map. // The eager linear model is defined at: // //executorch/test/models/linear_model.py - const char* path = std::getenv("ET_MODULE_LINEAR_DATA_PATH"); + const char* path = std::getenv("ET_MODULE_ADD_MUL_DATA_PATH"); Result loader = FileDataLoader::from(path); ASSERT_EQ(loader.error(), Error::Ok); diff --git a/extension/training/module/test/targets.bzl b/extension/training/module/test/targets.bzl index 17e8d1fe6ef..4e813b360eb 100644 --- a/extension/training/module/test/targets.bzl +++ b/extension/training/module/test/targets.bzl @@ -16,8 +16,8 @@ def define_common_targets(is_fbcode = False): # an fbcode target path because the authoring/export tools # intentionally don't work in xplat (since they're host-only tools). "ET_MODULE_ADD_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleAdd.pte])", - "ET_MODULE_LINEAR_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.ptd])", - "ET_MODULE_LINEAR_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.pte])", + "ET_MODULE_ADD_MUL_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.ptd])", + "ET_MODULE_ADD_MUL_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.pte])", "ET_MODULE_TRAIN_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleSimpleTrain.ptd])", "ET_MODULE_TRAIN_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleSimpleTrainProgram.pte])", "ET_MODULE_SIMPLE_TRAIN_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleSimpleTrain.pte])", diff --git a/runtime/executor/test/CMakeLists.txt b/runtime/executor/test/CMakeLists.txt index 512f832858f..cd815428997 100644 --- a/runtime/executor/test/CMakeLists.txt +++ b/runtime/executor/test/CMakeLists.txt @@ -18,38 +18,39 @@ set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..) include(${EXECUTORCH_ROOT}/tools/cmake/Test.cmake) add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddHalf.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddHalf.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMul.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd" "${CMAKE_CURRENT_BINARY_DIR}/ModuleDynamicCatUnallocatedIO.pte" "${CMAKE_CURRENT_BINARY_DIR}/ModuleIndex.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinear.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd" "${CMAKE_CURRENT_BINARY_DIR}/ModuleMultipleEntry.pte" "${CMAKE_CURRENT_BINARY_DIR}/ModuleSimpleTrain.pte" "${CMAKE_CURRENT_BINARY_DIR}/ModuleStateful.pte" + "${CMAKE_CURRENT_BINARY_DIR}/delegated/ModuleAddMul.pte" COMMAND python3 -m test.models.export_program --modules - "ModuleAdd,ModuleAddHalf,ModuleDynamicCatUnallocatedIO,ModuleIndex,ModuleLinear,ModuleMultipleEntry,ModuleSimpleTrain,ModuleStateful" + "ModuleAdd,ModuleAddHalf,ModuleAddMul,ModuleDynamicCatUnallocatedIO,ModuleIndex,ModuleMultipleEntry,ModuleSimpleTrain,ModuleStateful" --outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null COMMAND - python3 -m test.models.export_program --modules "ModuleLinear" + python3 -m test.models.export_program --modules "ModuleAddMul" --external-constants --outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null COMMAND python3 -m test.models.export_delegated_program --modules "ModuleAddMul" - --backend_id "StubBackend" --outdir "${CMAKE_CURRENT_BINARY_DIR}" || true + --backend_id "StubBackend" --outdir "${CMAKE_CURRENT_BINARY_DIR}/delegated/" || true WORKING_DIRECTORY ${EXECUTORCH_ROOT} ) add_custom_target( generated_pte_files - DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddHalf.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte" + DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddHalf.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMul.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte" + "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd" "${CMAKE_CURRENT_BINARY_DIR}/ModuleDynamicCatUnallocatedIO.pte" "${CMAKE_CURRENT_BINARY_DIR}/ModuleIndex.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinear.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte" - "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd" "${CMAKE_CURRENT_BINARY_DIR}/ModuleMultipleEntry.pte" "${CMAKE_CURRENT_BINARY_DIR}/ModuleSimpleTrain.pte" "${CMAKE_CURRENT_BINARY_DIR}/ModuleStateful.pte" @@ -57,16 +58,17 @@ add_custom_target( set(test_env "DEPRECATED_ET_MODULE_LINEAR_CONSTANT_BUFFER_PATH=${EXECUTORCH_ROOT}/test/models/deprecated/ModuleLinear-no-constant-segment.pte" - "ET_MODULE_ADD_HALF_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddHalf.pte" "ET_MODULE_ADD_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte" + "ET_MODULE_ADD_HALF_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddHalf.pte" + "ET_MODULE_ADD_MUL_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMul.pte" + "ET_MODULE_ADD_MUL_PROGRAM_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte" + "ET_MODULE_ADD_MUL_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd" "ET_MODULE_DYNAMIC_CAT_UNALLOCATED_IO_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleDynamicCatUnallocatedIO.pte" "ET_MODULE_INDEX_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleIndex.pte" - "ET_MODULE_LINEAR_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleLinear.pte" - "ET_MODULE_LINEAR_PROGRAM_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte" - "ET_MODULE_LINEAR_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd" "ET_MODULE_MULTI_ENTRY_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleMultipleEntry.pte" "ET_MODULE_SIMPLE_TRAIN_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleSimpleTrain.pte" "ET_MODULE_STATEFUL_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleStateful.pte" + "ET_MODULE_ADD_MUL_DELEGATED_PATH=${CMAKE_CURRENT_BINARY_DIR}/delegated/ModuleAddMul.pte" ) et_cxx_test( diff --git a/runtime/executor/test/backend_integration_test.cpp b/runtime/executor/test/backend_integration_test.cpp index 587c7b353eb..ea9467907c7 100644 --- a/runtime/executor/test/backend_integration_test.cpp +++ b/runtime/executor/test/backend_integration_test.cpp @@ -289,7 +289,7 @@ class BackendIntegrationTest : public ::testing::TestWithParam { ASSERT_EQ(StubBackend::register_singleton(), Error::Ok); // Paths to the test program files. - program_path_ = std::getenv("ET_MODULE_ADD_MUL_PATH"); + program_path_ = std::getenv("ET_MODULE_ADD_MUL_DELEGATED_PATH"); ASSERT_FALSE(program_path_.empty()); program_nosegments_path_ = std::getenv("ET_MODULE_ADD_MUL_NOSEGMENTS_PATH"); ASSERT_FALSE(program_nosegments_path_.empty()); diff --git a/runtime/executor/test/method_test.cpp b/runtime/executor/test/method_test.cpp index 5324ff5916d..f597746e0fd 100644 --- a/runtime/executor/test/method_test.cpp +++ b/runtime/executor/test/method_test.cpp @@ -78,15 +78,15 @@ class MethodTest : public ::testing::Test { load_program(std::getenv("ET_MODULE_INDEX_PATH"), "index"); load_program( std::getenv("ET_MODULE_DYNAMIC_CAT_UNALLOCATED_IO_PATH"), "cat"); - load_program(std::getenv("ET_MODULE_LINEAR_PATH"), "linear"); + load_program(std::getenv("ET_MODULE_ADD_MUL_PATH"), "add_mul"); load_program(std::getenv("ET_MODULE_STATEFUL_PATH"), "stateful"); load_program( std::getenv("DEPRECATED_ET_MODULE_LINEAR_CONSTANT_BUFFER_PATH"), "linear_constant_buffer"); load_program( - std::getenv("ET_MODULE_LINEAR_PROGRAM_PATH"), "linear_program"); - load_data_map(std::getenv("ET_MODULE_LINEAR_DATA_PATH"), "linear_data"); + std::getenv("ET_MODULE_ADD_MUL_PROGRAM_PATH"), "add_mul_program"); + load_data_map(std::getenv("ET_MODULE_ADD_MUL_DATA_PATH"), "add_mul_data"); } private: @@ -309,7 +309,7 @@ TEST_F(MethodTest, ConstantSegmentTest) { // Execute model with constants stored in segment. ManagedMemoryManager mmm(kDefaultNonConstMemBytes, kDefaultRuntimeMemBytes); Result method = - programs_["linear"]->load_method("forward", &mmm.get()); + programs_["add_mul"]->load_method("forward", &mmm.get()); ASSERT_EQ(method.error(), Error::Ok); // Can execute the method. @@ -331,8 +331,8 @@ TEST_F(MethodTest, ConstantBufferTest) { TEST_F(MethodTest, ProgramDataSeparationTest) { ManagedMemoryManager mmm(kDefaultNonConstMemBytes, kDefaultRuntimeMemBytes); - Result method = programs_["linear_program"]->load_method( - "forward", &mmm.get(), nullptr, data_maps_["linear_data"].get()); + Result method = programs_["add_mul_program"]->load_method( + "forward", &mmm.get(), nullptr, data_maps_["add_mul_data"].get()); ASSERT_EQ(method.error(), Error::Ok); // Can execute the method. diff --git a/runtime/executor/test/program_test.cpp b/runtime/executor/test/program_test.cpp index d82bfb50778..962bf8f548a 100644 --- a/runtime/executor/test/program_test.cpp +++ b/runtime/executor/test/program_test.cpp @@ -415,8 +415,8 @@ TEST_F(ProgramTest, LoadConstantSegmentWithNoConstantSegment) { } TEST_F(ProgramTest, LoadConstantSegment) { - // Load the serialized ModuleLinear data, with constants in the segment. - const char* linear_path = std::getenv("ET_MODULE_LINEAR_PATH"); + // Load the serialized ModuleAddMul data, with constants in the segment. + const char* linear_path = std::getenv("ET_MODULE_ADD_MUL_PATH"); Result linear_loader = FileDataLoader::from(linear_path); ASSERT_EQ(linear_loader.error(), Error::Ok); @@ -458,7 +458,7 @@ TEST_F(ProgramTest, LoadConstantSegment) { } TEST_F(ProgramTest, LoadConstantSegmentWhenConstantBufferExists) { - // Load the serialized ModuleLinear data, with constants in the flatbuffer and + // Load the serialized ModuleAddMul data, with constants in the flatbuffer and // no constants in the segment. const char* linear_path = std::getenv("DEPRECATED_ET_MODULE_LINEAR_CONSTANT_BUFFER_PATH"); diff --git a/runtime/executor/test/targets.bzl b/runtime/executor/test/targets.bzl index 75ea2674aa7..01f0f91ea1a 100644 --- a/runtime/executor/test/targets.bzl +++ b/runtime/executor/test/targets.bzl @@ -119,12 +119,12 @@ def define_common_targets(is_fbcode = False): "ET_MODULE_ADD_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleAdd.pte])", "ET_MODULE_DYNAMIC_CAT_UNALLOCATED_IO_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleDynamicCatUnallocatedIO.pte])", "ET_MODULE_INDEX_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleIndex.pte])", - "ET_MODULE_LINEAR_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleLinear.pte])", + "ET_MODULE_ADD_MUL_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleAddMul.pte])", "ET_MODULE_MULTI_ENTRY_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleMultipleEntry.pte])", "ET_MODULE_SIMPLE_TRAIN_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleSimpleTrain.pte])", "ET_MODULE_STATEFUL_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleStateful.pte])", - "ET_MODULE_LINEAR_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.pte])", - "ET_MODULE_LINEAR_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.ptd])", + "ET_MODULE_ADD_MUL_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.pte])", + "ET_MODULE_ADD_MUL_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.ptd])", } runtime.cxx_test( @@ -236,7 +236,7 @@ def define_common_targets(is_fbcode = False): # tools). "ET_MODULE_ADD_MUL_NOSEGMENTS_DA1024_PATH": "$(location fbcode//executorch/test/models:exported_delegated_add_mul[ModuleAddMul-nosegments-da1024.pte])", "ET_MODULE_ADD_MUL_NOSEGMENTS_PATH": "$(location fbcode//executorch/test/models:exported_delegated_add_mul[ModuleAddMul-nosegments.pte])", - "ET_MODULE_ADD_MUL_PATH": "$(location fbcode//executorch/test/models:exported_delegated_add_mul[ModuleAddMul.pte])", + "ET_MODULE_ADD_MUL_DELEGATED_PATH": "$(location fbcode//executorch/test/models:exported_delegated_add_mul[ModuleAddMul.pte])", }, ) diff --git a/test/models/export_program.py b/test/models/export_program.py index 5ed9cba4f8e..5387df24aad 100644 --- a/test/models/export_program.py +++ b/test/models/export_program.py @@ -131,7 +131,7 @@ def get_export_kwargs(): return {"capture_config": CaptureConfig(pt2_mode=True, enable_aot=True)} -class ModuleLinear(torch.nn.Module): +class ModuleAddMul(torch.nn.Module): def __init__(self): super().__init__() self.a = 3 * torch.ones(2, 2, dtype=torch.float) diff --git a/test/models/targets.bzl b/test/models/targets.bzl index 0e3b881b706..db0f410d727 100644 --- a/test/models/targets.bzl +++ b/test/models/targets.bzl @@ -61,8 +61,8 @@ def define_common_targets(): MODULES_TO_EXPORT = [ "ModuleAdd", "ModuleAddHalf", + "ModuleAddMul", "ModuleBasic", - "ModuleLinear", "ModuleMultipleEntry", "ModuleIndex", "ModuleDynamicCatUnallocatedIO", @@ -94,7 +94,7 @@ def define_common_targets(): # Class names of nn.Modules for :exported_programs to export. MODULES_AND_DATA_TO_EXPORT = [ - "ModuleLinear", + "ModuleAddMul", "ModuleSimpleTrain", ] @@ -102,8 +102,8 @@ def define_common_targets(): name = "exported_program_and_data", cmd = "$(exe :export_program) --modules " + ",".join(MODULES_AND_DATA_TO_EXPORT) + " --external-constants --outdir $OUT", outs = { - "ModuleLinear.pte": ["ModuleLinearProgram.pte"], - "ModuleLinear.ptd": ["ModuleLinearProgram.ptd"], + "ModuleAddMul.pte": ["ModuleAddMulProgram.pte"], + "ModuleAddMul.ptd": ["ModuleAddMulProgram.ptd"], "ModuleSimpleTrainProgram.pte": ["ModuleSimpleTrainProgram.pte"], "ModuleSimpleTrain.ptd": ["ModuleSimpleTrainProgram.ptd"], },