Support fp4 fp8 non gated moe (#13794)
Co-authored-by: Roi Koren <roik@nvidia.com> Co-authored-by: Tomer Natan <tbarnatan@computelab-frontend-8.nvidia.com>
This commit is contained in:
@@ -1194,6 +1194,23 @@ class ServerArgs:
|
||||
f"Disabling Radix Cache for {model_arch} as it is not yet supported."
|
||||
)
|
||||
self.disable_radix_cache = True
|
||||
elif model_arch in ["NemotronHForCausalLM"]:
|
||||
if self.model_config.quantization in [
|
||||
"modelopt",
|
||||
"modelopt_fp8",
|
||||
"modelopt_fp4",
|
||||
]:
|
||||
assert self.model_config.hf_config.mlp_hidden_act == "relu2"
|
||||
if self.model_config.quantization == "modelopt":
|
||||
self.quantization = (
|
||||
"modelopt_fp4"
|
||||
if self.model_config.hf_config.quantization_config["quant_algo"]
|
||||
== "NVFP4"
|
||||
else "modelopt_fp8"
|
||||
)
|
||||
else:
|
||||
self.quantization = self.model_config.quantization
|
||||
self.moe_runner_backend = "flashinfer_cutlass"
|
||||
elif model_arch in [
|
||||
"Qwen3MoeForCausalLM",
|
||||
"Qwen3VLMoeForConditionalGeneration",
|
||||
@@ -1491,9 +1508,11 @@ class ServerArgs:
|
||||
|
||||
def _handle_moe_kernel_config(self):
|
||||
if self.moe_runner_backend == "flashinfer_cutlass":
|
||||
assert (
|
||||
self.quantization == "modelopt_fp4" or self.quantization is None
|
||||
), "modelopt_fp4 quantization or bf16 is required for Flashinfer Cutlass MOE"
|
||||
assert self.quantization in [
|
||||
"modelopt_fp4",
|
||||
"modelopt_fp8",
|
||||
None,
|
||||
], f"Invalid quantization '{self.quantization}'. \nFlashInfer Cutlass MOE supports only: 'modelopt_fp4', 'modelopt_fp8', or bfloat16 (None)."
|
||||
assert self.ep_size in [
|
||||
1,
|
||||
self.tp_size,
|
||||
|
||||
Reference in New Issue
Block a user