Add KernelSwift optimized inference kernels for T1-T4 - #105
Open
chenweihan02 wants to merge 4 commits into
Open
Conversation
Implement a NineToothed MXFP4 W4A16 grouped expert GEMM with vLLM/OCP-compatible decoding, routed expert mapping, tiled reduction, and FP32 accumulation. Expose a minimal Torch wrapper and public exports while preserving the operator semantics and validating dtype, shape, layout, and routing contracts. Add correctness tests, a disclosed portable reference benchmark, a remote-only reproduction script, and the dual-platform technical report.
Implement block-scaled FP8 GEMM with independent row and column scale layouts, masked K tiles, FP32 accumulation, and explicit output dtype handling. Expose a Torch-compatible wrapper and portable PyTorch/vLLM baseline capability probes without changing the submission kernel's mathematical behavior. Cover correctness, baseline disclosure, benchmark execution, remote-only reproduction, and dual-platform results.
Fuse RMS normalization, gated activation, optional affine scaling, and residual updates in NineToothed while specializing static semantic variants without changing the public API. Expose the Torch wrapper and public exports, and benchmark the fused operator against vLLM RMSNormGated with a focused runtime ablation. Add correctness tests, a remote-only reproduction script, and the dual-platform technical report.
Fuse MLA RoPE transformation, no-PE/PE concatenation, and paged KV cache writes with scalar and paired NineToothed kernels selected by backend capability. Expose minimal Torch wrappers while preserving vLLM-compatible cache semantics, slot mapping, data types, and fallback behavior. Add correctness tests, unmodified vLLM baseline benchmarks, warp ablation, remote-only reproduction material, dual-platform results, and the unified submission manifest.
chenweihan02
marked this pull request as ready for review
August 31, 2026 05:34
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.
KernelSwift 算子创新大赛
概述
本 PR 实现并优化 KernelSwift 算子创新大赛 T1-T4 的 NineToothed 算子、Torch wrapper、正确性测试、性能 benchmark、一键远程评测脚本和技术报告。
编译器与后端 B 部分由关联的 ninetoothed#215 提供。两部分作为同一作品统一构建和评测。
9ae4166080910d6b79203提交与赛题映射
ec8f4e18a5be7a7fc8074080910d主要实现
T1:MXFP4 W4A16 分组专家 GEMM
T2:Block-scaled FP8 GEMM
T3:Gated RMSNorm
RMSNormGated调用链作为性能 baseline。T4:MLA RoPE 与压缩 KV Cache 写入
RoPE.forward_cuda + concat_and_cache_mla调用链作为 baseline。A/B 架构边界
本 PR 只包含算子实现、Torch wrapper、测试、benchmark 和复现材料。通用 SSA、runtime 和目标平台 lowering 位于关联的
ninetoothedPR。算子数学接口、测试输入语义和 baseline 实现未被修改。benchmark 不被 submission kernel 导入,也没有按公开 case、隐藏数据或答案表选择实现路径。
正确性与编译器回归
pytestoutput:A+B 性能结果
所有 speedup 均按
baseline_latency / submission_latency计算,不使用 PyTorch eager latency。5.892741×,最低2.659205×2.970092×,最低1.504281×vllm_semantic_fallback_predecoded3.316458×,最低1.777644×1.508378×,最低1.202633×vllm_portable1.2626×,最低1.2403×1.3436×,最低1.3295×RMSNormGated2.199483×,最低1.4298×1.5766×,最低1.1648×T1/T2 目标镜像中的原生 PyTorch 接口不能执行相同语义工作负载,因此采用报告中明确披露的兼容 baseline。上述结果不表述为原生 PyTorch 或未经修改的上游 vLLM binary。
文档与复现
关联 PR