[Kernel] Add KDA NVFP4 GEMM for Qwen3.x on SM120 (#36865)

Co-authored-by: Song Bian <biansonghz@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xiaoyu Zhang
2026-09-02 08:16:54 +08:00
committed by GitHub
co-authored by Song Bian Cursor
parent 6d34a4d3ce
commit c593527f33
24 changed files with 2829 additions and 67 deletions
@@ -49,10 +49,15 @@ def _module_defines(module_path: str) -> set[str]:
Importing would pull in Triton / CuTe-DSL / FlyDSL, none of which are
installed on the CPU CI lane -- so this reads the source instead.
"""
path = _PACKAGE_DIR / (module_path.replace(".", "/") + ".py")
if not path.exists():
path = _PACKAGE_DIR / module_path.replace(".", "/") / "__init__.py"
assert path.exists(), f"{PACKAGE}.{module_path} does not exist"
if module_path.startswith("sglang."):
spec = importlib.util.find_spec(module_path)
assert spec is not None and spec.origin is not None, module_path
path = pathlib.Path(spec.origin)
else:
path = _PACKAGE_DIR / (module_path.replace(".", "/") + ".py")
if not path.exists():
path = _PACKAGE_DIR / module_path.replace(".", "/") / "__init__.py"
assert path.exists(), f"{PACKAGE}.{module_path} does not exist"
names: set[str] = set()
for node in ast.parse(path.read_text(encoding="utf-8")).body:
@@ -85,7 +90,12 @@ def _scan_root(root: str) -> tuple[frozenset[str], tuple[str, ...]]:
for path in root_dir.rglob("*.py"):
rel = path.relative_to(_REPO_ROOT).as_posix()
if rel.startswith("python/sglang/kernels/ops/diffusion/"):
if rel.startswith(
(
"python/sglang/kernels/ops/diffusion/",
"python/sglang/kernels/kda_kernels/",
)
):
continue
try:
source = path.read_text(encoding="utf-8")