Skip to content

Commit 6dd40f2

Browse files
committed
Update on "Rename ModuleLinear -> ModuleAddMul"
In export_program, the `ModuleLinear` is a decomposed add mul. Renaming it to addmul, so that we can add a ModuleLinear that calls nn.Linear for backend program-data separation testing. Differential Revision: [D73679750](https://our.internmc.facebook.com/intern/diff/D73679750/) [ghstack-poisoned]
2 parents bd266ad + ed11ee3 commit 6dd40f2

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

extension/module/test/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ add_custom_target(
4141

4242
set(test_env
4343
"ET_MODULE_ADD_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte"
44-
"ET_MODULE_LINEAR_PROGRAM_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte"
45-
"ET_MODULE_LINEAR_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd"
44+
"ET_MODULE_ADD_MUL_PROGRAM_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte"
45+
"ET_MODULE_ADD_MUL_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd"
4646
)
4747

4848
et_cxx_test(

runtime/executor/test/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ add_custom_command(
2828
"${CMAKE_CURRENT_BINARY_DIR}/ModuleMultipleEntry.pte"
2929
"${CMAKE_CURRENT_BINARY_DIR}/ModuleSimpleTrain.pte"
3030
"${CMAKE_CURRENT_BINARY_DIR}/ModuleStateful.pte"
31+
"${CMAKE_CURRENT_BINARY_DIR}/delegated/ModuleAddMul.pte"
3132
COMMAND
3233
python3 -m test.models.export_program --modules
3334
"ModuleAdd,ModuleAddHalf,ModuleAddMul,ModuleDynamicCatUnallocatedIO,ModuleIndex,ModuleMultipleEntry,ModuleSimpleTrain,ModuleStateful"
@@ -37,7 +38,7 @@ add_custom_command(
3738
--external-constants --outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null
3839
COMMAND
3940
python3 -m test.models.export_delegated_program --modules "ModuleAddMul"
40-
--backend_id "StubBackend" --outdir "${CMAKE_CURRENT_BINARY_DIR}" || true
41+
--backend_id "StubBackend" --outdir "${CMAKE_CURRENT_BINARY_DIR}/delegated/" || true
4142
WORKING_DIRECTORY ${EXECUTORCH_ROOT}
4243
)
4344

@@ -67,6 +68,7 @@ set(test_env
6768
"ET_MODULE_MULTI_ENTRY_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleMultipleEntry.pte"
6869
"ET_MODULE_SIMPLE_TRAIN_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleSimpleTrain.pte"
6970
"ET_MODULE_STATEFUL_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleStateful.pte"
71+
"ET_MODULE_ADD_MUL_DELEGATED_PATH=${CMAKE_CURRENT_BINARY_DIR}/delegated/ModuleAddMul.pte"
7072
)
7173

7274
et_cxx_test(

runtime/executor/test/backend_integration_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ class BackendIntegrationTest : public ::testing::TestWithParam<bool> {
289289
ASSERT_EQ(StubBackend::register_singleton(), Error::Ok);
290290

291291
// Paths to the test program files.
292-
program_path_ = std::getenv("ET_MODULE_ADD_MUL_PATH");
292+
program_path_ = std::getenv("ET_MODULE_ADD_MUL_DELEGATED_PATH");
293293
ASSERT_FALSE(program_path_.empty());
294294
program_nosegments_path_ = std::getenv("ET_MODULE_ADD_MUL_NOSEGMENTS_PATH");
295295
ASSERT_FALSE(program_nosegments_path_.empty());

runtime/executor/test/targets.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def define_common_targets(is_fbcode = False):
236236
# tools).
237237
"ET_MODULE_ADD_MUL_NOSEGMENTS_DA1024_PATH": "$(location fbcode//executorch/test/models:exported_delegated_add_mul[ModuleAddMul-nosegments-da1024.pte])",
238238
"ET_MODULE_ADD_MUL_NOSEGMENTS_PATH": "$(location fbcode//executorch/test/models:exported_delegated_add_mul[ModuleAddMul-nosegments.pte])",
239-
"ET_MODULE_ADD_MUL_PATH": "$(location fbcode//executorch/test/models:exported_delegated_add_mul[ModuleAddMul.pte])",
239+
"ET_MODULE_ADD_MUL_DELEGATED_PATH": "$(location fbcode//executorch/test/models:exported_delegated_add_mul[ModuleAddMul.pte])",
240240
},
241241
)
242242

0 commit comments

Comments
 (0)