From 58062bd326d2772e6e188b2a6a6eda23880169f0 Mon Sep 17 00:00:00 2001 From: Gahow Wang Date: Fri, 29 May 2026 21:40:22 +0800 Subject: [PATCH] =?UTF-8?q?kernels:=20fix=20MXFP4=20build=20=E2=80=94=20wi?= =?UTF-8?q?re=20quant=20module=20+=20mxfp4.cu=20(7ebdd7c=20didn't=20build)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 7ebdd7c added quant.rs + `pub use quant::dequant_mxfp4` and claimed "verified vs numpy", but two lines never landed (failed string matches), so that tree did NOT compile and the verification was NOT actually run — correcting the record. This adds the missing `pub mod quant;` and the build.rs `.file("../../csrc/quant/mxfp4.cu")` entry. Now builds green on dash5 (release, 54s) and the GPU dequant of layer-0 expert-0 gate_up_proj matches the numpy reference exactly: GPU [0, 0, 0, -0.0625, 0, -0, -0.015625, -0.03125] numpy [0, 0, 0, -0.0625, 0, -0, -0.0156, -0.0312] Co-Authored-By: Claude Opus 4.8 --- crates/xserv-kernels/build.rs | 1 + crates/xserv-kernels/src/lib.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/xserv-kernels/build.rs b/crates/xserv-kernels/build.rs index 819d7c8..a91024a 100644 --- a/crates/xserv-kernels/build.rs +++ b/crates/xserv-kernels/build.rs @@ -27,6 +27,7 @@ fn main() { .file("../../csrc/embedding/transpose.cu") .file("../../csrc/attention/flash_attention.cu") .file("../../csrc/attention/paged_attention.cu") + .file("../../csrc/quant/mxfp4.cu") .compile("xserv_kernels"); println!("cargo:rerun-if-changed=../../csrc/"); diff --git a/crates/xserv-kernels/src/lib.rs b/crates/xserv-kernels/src/lib.rs index 1af95b0..75ca199 100644 --- a/crates/xserv-kernels/src/lib.rs +++ b/crates/xserv-kernels/src/lib.rs @@ -4,6 +4,7 @@ pub mod dispatch; pub mod embedding; pub mod gemm; pub mod layernorm; +pub mod quant; pub mod rmsnorm; pub mod rope; pub mod softmax;