fix: set gs and ws2 fields for Nvfp4Linear in fused router test

This commit is contained in:
2026-06-01 06:49:43 +00:00
parent 61c04f7152
commit 2abb4a19d9

View File

@@ -40,10 +40,10 @@ def test_fused_router():
gate_lin = Nvfp4Linear(in_features=K, out_features=N, device=device)
gate_lin.fp4 = [w_fp4.contiguous()]
gate_lin.sf = [w_sf.contiguous()]
gate_lin.gsb = [ws2_val]
gate_lin.gsb = None
gate_lin.gs = [1.0] # default global scale
gate_lin.ws2 = [ws2_val]
gate_lin._activation_global_scale = None # set at runtime
gate_lin._ensure_stacked = lambda *a, **kw: None
gate_lin._ensure_initialized = lambda *a, **kw: None
gate_lin.finalize_weights()
# e_bias