Skip to content

Commit ab06c5f

Browse files
pytorchbotlucylq
andauthored
Rename ModuleLinear -> ModuleAddMul (#10695)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: #10529 by @lucylq ^ Please use this as the source of truth for the PR details, comments, and reviews ghstack PR base: https://github.com/pytorch/executorch/tree/gh/lucylq/70/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/lucylq/70/head Merge bot PR base: https://github.com/pytorch/executorch/tree/main Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/lucylq/70/orig @diff-train-skip-merge Co-authored-by: lucylq <lfq@meta.com>
1 parent 34f5240 commit ab06c5f

File tree

17 files changed

+67
-67
lines changed

17 files changed

+67
-67
lines changed

codegen/tools/targets.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def define_common_targets(is_fbcode = False):
179179
srcs = ["test/test_gen_oplist_real_model.py"],
180180
base_module = "",
181181
resources = {
182-
"//executorch/test/models:exported_programs[ModuleLinear.pte]": "test/ModuleLinear.pte",
182+
"//executorch/test/models:exported_programs[ModuleAddMul.pte]": "test/ModuleAddMul.pte",
183183
},
184184
visibility = [
185185
"//executorch/...",

codegen/tools/test/test_gen_oplist_real_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from libfb.py import parutil # type: ignore[import-not-found]
1717

18-
MODEL_PATH: Final[str] = parutil.get_file_path("ModuleLinear.pte", pkg=__package__)
18+
MODEL_PATH: Final[str] = parutil.get_file_path("ModuleAddMul.pte", pkg=__package__)
1919

2020

2121
class TestGenOplistRealModel(unittest.TestCase):

extension/flat_tensor/test/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
1919
include(${EXECUTORCH_ROOT}/tools/cmake/Test.cmake)
2020

2121
add_custom_command(
22-
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte"
23-
"${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd"
22+
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte"
23+
"${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd"
2424
COMMAND
25-
python -m test.models.export_program --modules "ModuleLinear"
25+
python -m test.models.export_program --modules "ModuleAddMul"
2626
--external-constants --outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null
2727
WORKING_DIRECTORY ${EXECUTORCH_ROOT}
2828
)
2929

3030
add_custom_target(
3131
extension_flat_tensor_test_resources
32-
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte"
33-
"${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd"
32+
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte"
33+
"${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd"
3434
)
3535

3636
set(test_env
37-
"ET_MODULE_LINEAR_PROGRAM_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte"
38-
"ET_MODULE_LINEAR_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd"
37+
"ET_MODULE_ADD_MUL_PROGRAM_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte"
38+
"ET_MODULE_ADD_MUL_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd"
3939
)
4040

4141
set(_test_srcs flat_tensor_data_map_test.cpp flat_tensor_header_test.cpp)

extension/flat_tensor/test/flat_tensor_data_map_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class FlatTensorDataMapTest : public ::testing::Test {
3535

3636
// Load data map. The eager linear model is defined at:
3737
// //executorch/test/models/linear_model.py
38-
const char* path = std::getenv("ET_MODULE_LINEAR_DATA_PATH");
38+
const char* path = std::getenv("ET_MODULE_ADD_MUL_DATA_PATH");
3939
Result<FileDataLoader> loader = FileDataLoader::from(path);
4040
ASSERT_EQ(loader.error(), Error::Ok);
4141

extension/flat_tensor/test/targets.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def define_common_targets(is_fbcode=False):
3535
# The tests use this var to find the program file to load. This uses
3636
# an fbcode target path because the authoring/export tools
3737
# intentionally don't work in xplat (since they're host-only tools).
38-
"ET_MODULE_LINEAR_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.pte])",
39-
"ET_MODULE_LINEAR_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.ptd])",
38+
"ET_MODULE_ADD_MUL_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.pte])",
39+
"ET_MODULE_ADD_MUL_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.ptd])",
4040
}
4141

4242
runtime.cxx_test(

extension/module/test/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,28 @@ set(_test_srcs module_test.cpp)
2121

2222
add_custom_command(
2323
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte"
24-
"${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte"
25-
"${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd"
24+
"${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte"
25+
"${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd"
2626
COMMAND
2727
python3 -m test.models.export_program --modules "ModuleAdd"
2828
--outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null
2929
COMMAND
30-
python3 -m test.models.export_program --modules "ModuleLinear"
30+
python3 -m test.models.export_program --modules "ModuleAddMul"
3131
--external-constants --outdir "${CMAKE_CURRENT_BINARY_DIR}" 2> /dev/null
3232
WORKING_DIRECTORY ${EXECUTORCH_ROOT}
3333
)
3434

3535
add_custom_target(
3636
generated_module_test_files
3737
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/ModuleAdd.pte"
38-
"${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.pte"
39-
"${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.ptd"
38+
"${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.pte"
39+
"${CMAKE_CURRENT_BINARY_DIR}/ModuleAddMulProgram.ptd"
4040
)
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}/ModuleLinearProgram.pte"
45-
"ET_MODULE_LINEAR_DATA_PATH=${CMAKE_CURRENT_BINARY_DIR}/ModuleLinearProgram.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(

extension/module/test/module_test.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ class ModuleTest : public ::testing::Test {
2424
protected:
2525
static void SetUpTestSuite() {
2626
model_path_ = std::getenv("ET_MODULE_ADD_PATH");
27-
linear_path_ = std::getenv("ET_MODULE_LINEAR_PROGRAM_PATH");
28-
linear_data_path_ = std::getenv("ET_MODULE_LINEAR_DATA_PATH");
27+
add_mul_path_ = std::getenv("ET_MODULE_ADD_MUL_PROGRAM_PATH");
28+
add_mul_data_path_ = std::getenv("ET_MODULE_ADD_MUL_DATA_PATH");
2929
}
3030

3131
static inline std::string model_path_;
32-
static inline std::string linear_path_;
33-
static inline std::string linear_data_path_;
32+
static inline std::string add_mul_path_;
33+
static inline std::string add_mul_data_path_;
3434
};
3535

3636
TEST_F(ModuleTest, TestLoad) {
@@ -449,7 +449,7 @@ TEST_F(ModuleTest, TestSetOutputInvalidType) {
449449
}
450450

451451
TEST_F(ModuleTest, TestPTD) {
452-
Module module(linear_path_, linear_data_path_);
452+
Module module(add_mul_path_, add_mul_data_path_);
453453

454454
ASSERT_EQ(module.load_method("forward"), Error::Ok);
455455

extension/module/test/targets.bzl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def define_common_targets(is_fbcode=False):
1717
# an fbcode target path because the authoring/export tools
1818
# intentionally don't work in xplat (since they're host-only tools).
1919
"ET_MODULE_ADD_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleAdd.pte])",
20-
"ET_MODULE_LINEAR_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.pte])",
21-
"ET_MODULE_LINEAR_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.ptd])",
20+
"ET_MODULE_ADD_MUL_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.pte])",
21+
"ET_MODULE_ADD_MUL_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.ptd])",
2222
}
2323

2424
for aten_mode in get_aten_mode_options():
@@ -42,5 +42,3 @@ def define_common_targets(is_fbcode=False):
4242
"-Wno-error=deprecated-declarations",
4343
],
4444
)
45-
46-

extension/training/module/test/state_dict_util_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class LoadStateDictTest : public ::testing::Test {
3636
// Load data map.
3737
// The eager linear model is defined at:
3838
// //executorch/test/models/linear_model.py
39-
const char* path = std::getenv("ET_MODULE_LINEAR_DATA_PATH");
39+
const char* path = std::getenv("ET_MODULE_ADD_MUL_DATA_PATH");
4040
Result<FileDataLoader> loader = FileDataLoader::from(path);
4141
ASSERT_EQ(loader.error(), Error::Ok);
4242

extension/training/module/test/targets.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def define_common_targets(is_fbcode = False):
1616
# an fbcode target path because the authoring/export tools
1717
# intentionally don't work in xplat (since they're host-only tools).
1818
"ET_MODULE_ADD_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleAdd.pte])",
19-
"ET_MODULE_LINEAR_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.ptd])",
20-
"ET_MODULE_LINEAR_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleLinear.pte])",
19+
"ET_MODULE_ADD_MUL_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.ptd])",
20+
"ET_MODULE_ADD_MUL_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleAddMul.pte])",
2121
"ET_MODULE_TRAIN_DATA_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleSimpleTrain.ptd])",
2222
"ET_MODULE_TRAIN_PROGRAM_PATH": "$(location fbcode//executorch/test/models:exported_program_and_data[ModuleSimpleTrainProgram.pte])",
2323
"ET_MODULE_SIMPLE_TRAIN_PATH": "$(location fbcode//executorch/test/models:exported_programs[ModuleSimpleTrain.pte])",

0 commit comments

Comments
 (0)