Repository navigation
feat(metax): add native MLA, DeepseekMoe and scalar Mul for 021 - #1050
Merged
Merged
Conversation
rubik-hua
force-pushed
the
metax-021-ops
branch
from
November 23, 2026 08:05
5ac9c1e to
21b52c2
Compare
rubik-hua
force-pushed
the
metax-021-ops
branch
3 times, most recently
from
November 23, 2026 11:34
89d4d19 to
ca25ee7
Compare
2 tasks done
baominghelly
requested changes
Nov 24, 2026
rubik-hua
force-pushed
the
metax-021-ops
branch
from
November 24, 2026 10:20
ca25ee7 to
d4ffe24
Compare
This was referenced Nov 24, 2026
baominghelly
requested changes
Nov 25, 2026
rubik-hua
force-pushed
the
metax-021-ops
branch
from
November 25, 2026 08:57
d4ffe24 to
d505a17
Compare
Support DeepseekV2-style 021 model inference on MetaX GPUs:
- Native MLA paged attention: flash_mla_launch host launchers plus
varlen-prefill and kvcache-decode providers for the 576/512 fused
latent cache, fp16/bf16.
- Native DeepseekMoe: expert-grouped strided GEMMs via mcBLAS with
device-side routing and chunked packing for long-context prefill.
- Scalar Mul (tensor, double, tensor) for the routed-scaling factor.
- DeepseekMoe falls back to a stream-ordered workspace lease when
the dispatch handle provides none (python bindings).
rubik-hua
force-pushed
the
metax-021-ops
branch
from
November 25, 2026 10:48
d505a17 to
6483239
Compare
baominghelly
approved these changes
Nov 26, 2026
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.
feat(metax): add native MLA, DeepseekMoe and scalar Mul for 021
Support DeepseekV2-style 021 model inference on MetaX GPUs:
varlen-prefill and kvcache-decode providers for the 576/512 fused
latent cache, fp16/bf16.
device-side routing and chunked packing for long-context prefill.
the dispatch handle provides none (python bindings).
upstream mla_latent_prefill/decode cases (index-1 provider).
Together these run the fused MoE path end to end on MetaX with no
engine-side fallback: on 021-32B TP2 (C550, MACA 3.5.3) prefill TTFT
drops from 2340 ms to 207 ms (54.7 to 618 tok/s) and decode improves
from 46.7 ms to 42.0 ms per token versus the CPU-routed per-expert
Gemm fallback.
021模型所需要的算子实现
验证
python3 examples/test_infer.py --device metax --model=/mnt/infini/infrahi/infinilm-models/021/021-32B-A4B-256k-20261024/021-32B-A4B-256k-20261024 --tp 2 --disable-prefix-caching --enable-paged-attn --attn flash-attn --use-mla --prompt "你是谁,你能做啥"
python examples/bench.py --device metax
--model=/mnt/infini/infrahi/infinilm-models/021/021-32B-A4B-256k-20261024/021-32B-A4B-256k-20261024
--tp 2 --enable-paged-attn --use-mla --attn flash-attn --disable-prefix-caching
--warmup --batch-size 1 --input-len 128 --output-len 64
单元测试:
