Fix: quantize_activation_nvfp4 API - correct signature and return values
This commit is contained in:
@@ -1046,11 +1046,10 @@ def run_nvfp4_fused_router(
|
||||
device = hidden_states.device
|
||||
|
||||
# Quantize activation to NVFP4
|
||||
act_nvfp4, act_sf, _gsa, _gsb = quantize_activation_nvfp4(
|
||||
hidden_states, sf_vec_size=sf_vec_size)
|
||||
# Override global scales with provided values
|
||||
act_gsa = gsa if gsa is not None else _gsa
|
||||
act_gsb = gsb_val
|
||||
# Compute activation global scale
|
||||
act_amax = float(hidden_states.float().abs().max()) + 1e-8
|
||||
act_gs = act_amax / (6.0 * 448.0) # max E2M1 magnitude * E4M3 max
|
||||
act_nvfp4, act_sf = quantize_activation_nvfp4(hidden_states, act_gs)
|
||||
|
||||
def to_cute(t):
|
||||
ct = cutlass_torch.from_dlpack(t)
|
||||
|
||||
Reference in New Issue
Block a user