Skip to content

Commit 7489cc5

Browse files
authored
[ExecuTorch][llm] Add source-transform and Meta-kernel tests for MoE op (pytorch#21536)
This PR was created by the merge bot to help merge the original PR into the main branch. ghstack PR number: pytorch#21122 by @digantdesai ^ 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/digantdesai/72/base ghstack PR head: https://github.com/pytorch/executorch/tree/gh/digantdesai/72/head Merge bot PR base: https://github.com/pytorch/executorch/tree/gh/digantdesai/71/orig Merge bot PR head: https://github.com/pytorch/executorch/tree/gh/digantdesai/72/orig Differential Revision: [D102381997](https://our.internmc.facebook.com/intern/diff/D102381997/) @diff-train-skip-merge Co-authored-by: Digant Desai <digantdesai@meta.com>
1 parent afffe4f commit 7489cc5

3 files changed

Lines changed: 537 additions & 0 deletions

File tree

‎.ci/scripts/test_llama_torchao_lowbit.sh‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ cmake -DPYTHON_EXECUTABLE=python \
5050
examples/models/llama
5151
cmake --build cmake-out/examples/models/llama -j16 --config Release
5252

53+
${PYTHON_EXECUTABLE} -m pytest \
54+
extension/llm/custom_ops/test_quantized_moe.py
55+
5356
# Download stories llama110m artifacts
5457
download_stories_model_artifacts
5558

‎extension/llm/custom_ops/BUCK‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,22 @@ fbcode_target(_kind = runtime.python_binary,
129129
],
130130
deps = [":bench_channelwise_gated_delta_rule_lib"],
131131
)
132+
133+
fbcode_target(_kind = runtime.python_test,
134+
name = "test_quantized_moe",
135+
srcs = [
136+
"test_quantized_moe.py",
137+
],
138+
preload_deps = [
139+
":custom_ops_aot_lib_mkl_noomp",
140+
":custom_ops_aot_py",
141+
"//pytorch/ao/torchao/csrc/cpu/shared_kernels/linear_8bit_act_xbit_weight:op_linear_8bit_act_xbit_weight_aten",
142+
],
143+
deps = [
144+
"//caffe2:torch",
145+
"//executorch/extension/pybindings:portable_lib",
146+
"//executorch/examples/models/llama:llama_transformer",
147+
"//executorch/examples/models/llama:transformer_modules",
148+
"//executorch/examples/models/llama:source_transformation",
149+
],
150+
)

0 commit comments

Comments
 (0)