From 6fdfb1b9d93b30c4cc097a210a436e5715c7d64d Mon Sep 17 00:00:00 2001 From: Gahow Wang Date: Fri, 29 May 2026 22:24:57 +0800 Subject: [PATCH] =?UTF-8?q?moe(wip):=20zero=20dequant=20output=20=E2=80=94?= =?UTF-8?q?=20decode=20STILL=20broken=20(not=20fixed)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tried Tensor::zeros (instead of empty) for the dequant output on the theory that decode read uninitialized memory. It did NOT fix it: decode top-1 still diverges from the forward reference AND is still non-deterministic run-to-run (top-1 varied across runs), generation still garbage. So the bug is NOT a dequant-output init issue. Root cause remains OPEN. Forward (host attention) remains correct ("Paris"); only the KV-cache decode path is wrong. Do not trust decode output. Co-Authored-By: Claude Opus 4.8 --- crates/xserv-kernels/src/quant.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/xserv-kernels/src/quant.rs b/crates/xserv-kernels/src/quant.rs index 8076f8f..662d9e3 100644 --- a/crates/xserv-kernels/src/quant.rs +++ b/crates/xserv-kernels/src/quant.rs @@ -25,7 +25,8 @@ pub fn dequant_mxfp4( blocks: &GpuBuffer, scales: &GpuBuffer, out_dim: usize, nblk: usize, device: u32, ) -> Tensor { let in_dim = nblk * 32; - let out = Tensor::empty(&[in_dim, out_dim], DType::BF16, Device::Cuda(device)); + // PROBE: zeros (not empty) to test for an uninitialized-read/coverage bug. + let out = Tensor::zeros(&[in_dim, out_dim], DType::BF16, Device::Cuda(device)); unsafe { launch_mxfp4_dequant_bf16( blocks.as_ptr() as *const c_void,