Add MoE ASM ctypes migration on top of #2255#2341
Open
zufayu wants to merge 1 commit intorefactor_bind_klfrom
Open
Add MoE ASM ctypes migration on top of #2255#2341zufayu wants to merge 1 commit intorefactor_bind_klfrom
zufayu wants to merge 1 commit intorefactor_bind_klfrom
Conversation
Convert fmoe, fmoe_int8_g1u0, fmoe_g1u1, fmoe_g1u1_tkw1, fmoe_int8_g1u0_a16, fmoe_g1u1_a16, fmoe_fp8_blockscale_g1u1, and moe_stage1_g1u1 from torch::Tensor& (pybind11) to AiterTensor* + hipStream_t (C ABI called via ctypes). - asm_fmoe.cu: Remove torch/ATen includes, use AiterTensor*, AITER_DTYPE_*, AITER_CHECK; template <int I_elemSize, int O_elemSize> - asm_moe_2stage.cu: Same conversion for moe_stage1_g1u1 - moe_op.h: Remove fmoe pybind declarations (now extern "C") - rocm_ops.hpp: Remove fmoe entries from MOE_OP_PYBIND macro - moe_op.py: Use ffi_type="ctypes" with new module_moe_fmoe_asm - optCompilerConfig.json: Split ctypes sources into module_moe_fmoe_asm Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
torch::Tensor&) to C ABI (AiterTensor*+hipStream_t) called via ctypesfmoe,fmoe_int8_g1u0,fmoe_g1u1,fmoe_g1u1_tkw1,fmoe_int8_g1u0_a16,fmoe_g1u1_a16,fmoe_fp8_blockscale_g1u1,moe_stage1_g1u1module_moe_fmoe_asmbuild module to avoid torch dependency in the .soChanges
csrc/py_itfs_cu/asm_fmoe.cu: Remove torch/ATen includes; useAiterTensor*,AITER_DTYPE_*,AITER_CHECK; convert template<typename T, typename T_O>to<int I_elemSize, int O_elemSize>; addextern "C"exportscsrc/py_itfs_cu/asm_moe_2stage.cu: Same conversion formoe_stage1_g1u1csrc/include/moe_op.h: Remove fmoe pybind declarations (nowextern "C"in .cu files)csrc/include/rocm_ops.hpp: Remove fmoe entries fromMOE_OP_PYBINDmacroaiter/ops/moe_op.py: Useffi_type="ctypes"with newmodule_moe_fmoe_asmfor migrated functionsaiter/jit/optCompilerConfig.json: Split ctypes sources intomodule_moe_fmoe_asm; keep pybind sources inmodule_moe_asmTest plan
module_moe_fmoe_asmbuilds without torch dependencypython op_tests/test_moe.py -t fmoeto validate fmoe kernelpython op_tests/test_moe.py -t fmoe_int8to validate int8 pathpython op_tests/test_moe.py -t fmoe_g1u1to validate g1u1 path🤖 Generated with Claude Code