Skip to content

Reorganize c++ source files in sgl-kernel with multiple folders - #4025

Merged
merrymercy merged 6 commits into
mainfrom
lianmin/reorg-kernel
Mar 3, 2025
Merged

merrymercy merged 6 commits into
mainfrom
lianmin/reorg-kernel

Conversation

@merrymercy

@merrymercy merrymercy commented Mar 3, 2025

Copy link
Copy Markdown
Contributor

Organize them into different folders

  • allreduce
  • gemm
  • moe
  • ...

@merrymercy merrymercy changed the title Reorganize c++ source files in sgl-kernel Reorganize c++ source files in sgl-kernel with multiple folders Mar 3, 2025
@merrymercy
merrymercy merged commit 6b45a21 into main Mar 3, 2025
@merrymercy
merrymercy deleted the lianmin/reorg-kernel branch March 3, 2025 13:32
0826joyce pushed a commit to 0826joyce/sglang-perf-opt that referenced this pull request May 19, 2026
@elvischenv elvischenv mentioned this pull request Aug 11, 2026
5 tasks
elvischenv added a commit to elvischenv/sglang that referenced this pull request Aug 11, 2026
Unlike post1/post2, which only rebuilt the companion wheels, post3 and
post4 carry real source changes.

post3 reverts the SM90 CUTLASS MoE backend (flashinfer-ai/flashinfer#3738
plus dependents sgl-project#4025 and sgl-project#4080). That work first shipped in 0.6.16 — it
is not in 0.6.15.post1 — so the revert returns those kernels to roughly
the state this repo already runs against today, rather than regressing
anything. It drops six public symbols and one parameter:

    preprocess_moe_weights_for_sm90_mixed_gemm_humming
    sm90_mixed_gemm_humming_weight_preprocess_trace_dispatch
    bits_from_float / float_from_bits / quant_to_fp4_val / dequant_fp4_val
    use_wfp4afp8_humming= on cutlass_fused_moe / cutlass_fused_moe_workspace_size

SGLang uses none of them. `interleave_moe_{scales,weights}_for_sm90_mixed_gemm`
move back from `fused_moe/prepare.py` to `fused_moe/core.py` but keep
their signatures and stay exported from `flashinfer.fused_moe`, which is
where mxfp4.py and mxfp4_flashinfer_cutlass_moe.py import them from.

post4 adds `from __future__ import annotations` to
`flashinfer/comm/fd_exchange.py`. That module is new in 0.6.16 and
annotates `array.array[int]`, which is only subscriptable on Python 3.12+.
`flashinfer/comm/mnnvl.py` imports it unconditionally, so on Python
3.10/3.11 — both allowed by our `requires-python = ">=3.10"` — importing
`flashinfer.comm.mnnvl` raised

    TypeError: type 'array.array' is not subscriptable

taking out the MNNVL comm-fusion and MoE all-to-all paths. Verified on a
real 3.11 interpreter: post2's fd_exchange raises, post4's imports fine.
The published Docker image is Python 3.12 and was unaffected; this only
bit source installs on older interpreters.

Checked against 0.6.15.post1 with the full symbol sweep: no API SGLang
uses is removed, and every changed signature is purely additive.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
elvischenv added a commit to elvischenv/sglang that referenced this pull request Aug 11, 2026
Unlike post1/post2, which only rebuilt the companion wheels, post3 and
post4 carry real source changes.

post3 reverts the SM90 CUTLASS MoE backend (flashinfer-ai/flashinfer#3738
plus dependents sgl-project#4025 and sgl-project#4080). That work first shipped in 0.6.16 — it
is not in 0.6.15.post1 — so the revert returns those kernels to roughly
the state this repo already runs against today, rather than regressing
anything. It drops six public symbols and one parameter:

    preprocess_moe_weights_for_sm90_mixed_gemm_humming
    sm90_mixed_gemm_humming_weight_preprocess_trace_dispatch
    bits_from_float / float_from_bits / quant_to_fp4_val / dequant_fp4_val
    use_wfp4afp8_humming= on cutlass_fused_moe / cutlass_fused_moe_workspace_size

SGLang uses none of them. `interleave_moe_{scales,weights}_for_sm90_mixed_gemm`
move back from `fused_moe/prepare.py` to `fused_moe/core.py` but keep
their signatures and stay exported from `flashinfer.fused_moe`, which is
where mxfp4.py and mxfp4_flashinfer_cutlass_moe.py import them from.

post4 adds `from __future__ import annotations` to
`flashinfer/comm/fd_exchange.py`. That module is new in 0.6.16 and
annotates `array.array[int]`, which is only subscriptable on Python 3.12+.
`flashinfer/comm/mnnvl.py` imports it unconditionally, so on Python
3.10/3.11 — both allowed by our `requires-python = ">=3.10"` — importing
`flashinfer.comm.mnnvl` raised

    TypeError: type 'array.array' is not subscriptable

taking out the MNNVL comm-fusion and MoE all-to-all paths. Verified on a
real 3.11 interpreter: post2's fd_exchange raises, post4's imports fine.
The published Docker image is Python 3.12 and was unaffected; this only
bit source installs on older interpreters.

Checked against 0.6.15.post1 with the full symbol sweep: no API SGLang
uses is removed, and every changed signature is purely additive.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant