---
id: pr-deepgemm-316
repo: deepseek-ai/DeepGEMM
pr: 316
title: Add various optimizations and Mega MoE benchmarks
author: zheanxu
date: '2026-04-24'
url: https://github.com/deepseek-ai/DeepGEMM/pull/316
source_category: upstream-code
architectures:
- sm100
- sm90
tags:
- Mega MoE
- attention_kv
- benchmark
- benchmark_test
- gemm_quant
- moe
- moe_routing
- scheduler_autotune
techniques:
- autotuning
- fine-grained-quantization
- tile-scheduling
hardware_features:
- blackwell
- fp4
- fp8
- hopper
kernel_types:
- attention
- gemm
- moe
- scheduler
languages:
- cuda-cpp
- ptx
captured_at: '2026-05-16'
status: merged
merge_sha: 891d57b4db1071624b5c8fa0d1e51cb317fa709f
inclusion_reason: Mine shape sets, tolerance rules, warmup logic, and profile commands before mutating code.
changed_paths:
- README.md
- csrc/apis/attention.hpp
- csrc/apis/mega.hpp
- csrc/jit_kernels/heuristics/mega_moe.hpp
- csrc/jit_kernels/impls/sm100_fp8_fp4_mega_moe.hpp
- csrc/jit_kernels/impls/smxx_fp8_fp4_paged_mqa_logits.hpp
- deep_gemm/__init__.py
- deep_gemm/include/deep_gemm/comm/barrier.cuh
- deep_gemm/include/deep_gemm/impls/sm100_fp4_mqa_logits.cuh
- deep_gemm/include/deep_gemm/impls/sm100_fp4_paged_mqa_logits.cuh
- deep_gemm/include/deep_gemm/impls/sm100_fp8_fp4_mega_moe.cuh
- deep_gemm/include/deep_gemm/impls/sm100_fp8_paged_mqa_logits.cuh
- deep_gemm/include/deep_gemm/impls/sm90_fp8_paged_mqa_logits.cuh
- deep_gemm/include/deep_gemm/layout/mega_moe.cuh
- deep_gemm/include/deep_gemm/ptx/ld_st.cuh
- deep_gemm/include/deep_gemm/scheduler/paged_mqa_logits.cuh
- deep_gemm/mega/__init__.py
- scripts/quick_plot_pm.py
- scripts/run_ncu_mega_moe.sh
- tests/test_attention.py
- tests/test_mega_moe.py
artifact_dir: evidence/pull-bundles/deepgemm/gh-316
head_ref_oid: 9fd94601a07a2a91f73c6434705db29e1aa382ee
---
# Add various optimizations and Mega MoE benchmarks

- Repository: `deepseek-ai/DeepGEMM`
- PR: [316](https://github.com/deepseek-ai/DeepGEMM/pull/316)
- Decision: `Mine shape sets, tolerance rules, warmup logic, and profile commands before mutating code.`
- Reason: Mine shape sets, tolerance rules, warmup logic, and profile commands before mutating code.

## Changed Paths

- `README.md`
- `csrc/apis/attention.hpp`
- `csrc/apis/mega.hpp`
- `csrc/jit_kernels/heuristics/mega_moe.hpp`
- `csrc/jit_kernels/impls/sm100_fp8_fp4_mega_moe.hpp`
- `csrc/jit_kernels/impls/smxx_fp8_fp4_paged_mqa_logits.hpp`
- `deep_gemm/__init__.py`
- `deep_gemm/include/deep_gemm/comm/barrier.cuh`
- `deep_gemm/include/deep_gemm/impls/sm100_fp4_mqa_logits.cuh`
- `deep_gemm/include/deep_gemm/impls/sm100_fp4_paged_mqa_logits.cuh`
- `deep_gemm/include/deep_gemm/impls/sm100_fp8_fp4_mega_moe.cuh`
- `deep_gemm/include/deep_gemm/impls/sm100_fp8_paged_mqa_logits.cuh`
- `deep_gemm/include/deep_gemm/impls/sm90_fp8_paged_mqa_logits.cuh`
- `deep_gemm/include/deep_gemm/layout/mega_moe.cuh`
- `deep_gemm/include/deep_gemm/ptx/ld_st.cuh`
- `deep_gemm/include/deep_gemm/scheduler/paged_mqa_logits.cuh`
- `deep_gemm/mega/__init__.py`
- `scripts/quick_plot_pm.py`
- `scripts/run_ncu_mega_moe.sh`
- `tests/test_attention.py`
- `tests/test_mega_moe.py`

## Evidence Bundle

`evidence/pull-bundles/deepgemm/gh-316`
