---
id: pr-sglang-16723
repo: sgl-project/sglang
pr: 16723
title: '[Rework] Add SwapAB Optimization for triton fused_moe_kernel on SM90.'
author: Insideyyy
date: '2026-01-10'
url: https://github.com/sgl-project/sglang/pull/16723
source_category: upstream-code
architectures:
- sm90
tags:
- arch_pipeline
- benchmark_test
- compiler_runtime
- moe_routing
- sm90
techniques:
- kernel-fusion
- pipeline-stages
hardware_features:
- hopper
kernel_types:
- compiler
- moe
- runtime
languages:
- cuda-cpp
- triton
captured_at: '2026-05-16'
status: merged
merge_sha: 67b61a4e8d0dba9c8c1d52a42769f658ad20bc0b
inclusion_reason: Separate routing, permutation, top-k, and expert GEMM costs; keep tail-token and expert-layout tests attached to the idea.
changed_paths:
- python/sglang/srt/layers/moe/fused_moe_triton/fused_moe_triton_kernels.py
artifact_dir: evidence/pull-bundles/sglang/gh-16723
head_ref_oid: 22c03af45f61f329cda39a9bf1a398e1165b53e4
---
# [Rework] Add SwapAB Optimization for triton fused_moe_kernel on SM90.

- Repository: `sgl-project/sglang`
- PR: [16723](https://github.com/sgl-project/sglang/pull/16723)
- Decision: `Separate routing, permutation, top-k, and expert GEMM costs; keep tail-token and expert-layout tests attached to the idea.`
- Reason: Separate routing, permutation, top-k, and expert GEMM costs; keep tail-token and expert-layout tests attached to the idea.

## Changed Paths

- `python/sglang/srt/layers/moe/fused_moe_triton/fused_moe_triton_kernels.py`

## Evidence Bundle

`evidence/pull-bundles/sglang/gh-16723`
