[ExecuTorch][llm] Add quantized_moe_ffn custom op with C++ kernel#21119
[ExecuTorch][llm] Add quantized_moe_ffn custom op with C++ kernel#21119digantdesai wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21119
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (2 Unrelated Failures)As of commit f700b8a with merge base 21554e5 ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
Stack from ghstack (oldest at bottom):
Add a fused
quantized_moe_ffncustom op for MoE feed-forward with INT4/INT8 weight quantization via torchao.The C++ runtime kernel implements router GEMM, scoring, top-k, counting-sort permutation, per-expert grouped GEMMs, SwiGLU, and weighted scatter-add unpermute. On aarch64, expert GEMMs use
torchao::linear_operatorfrom D112958457; otherwise a portable reference path unpacks the torchao blob, dequantizes to fp32, and callscpublas::gemm.The AOT shim registers the schema, provides
CompositeExplicitAutograddispatch, and exposes a_quantized_moe_ffn_activesentinel op. Build integration covers Buck and CMake.Differential Revision: D102382000