fix: Fix DSR1 perf regression due to unnecessarily falling back to triton gemm (#28073)
This commit is contained in:
@@ -499,10 +499,10 @@ def flashinfer_gemm_w8a8_block_fp8_linear_with_fallback(
|
||||
|
||||
input_2d = input.view(-1, input.shape[-1])
|
||||
backend = _get_flashinfer_groupwise_backend()
|
||||
# TRTLLM backend requires K >= 256 and weight scales in UE8M0/R128c4
|
||||
# packed format. Fall back to triton when scales are plain float32.
|
||||
# Fall back to triton for non-supported formats.
|
||||
# TODO: Check if flashinfer supports other output dtypes besides bf16.
|
||||
if backend == "trtllm" and (
|
||||
input_2d.shape[1] < 256 or not getattr(weight_scale, "format_ue8m0", False)
|
||||
input_2d.shape[1] < 256 or input_2d.dtype != torch.bfloat16
|
||||
):
|
||||
return triton_w8a8_block_fp8_linear(
|
||||
input, weight, block_size, weight_scale, input_scale, bias
|
||||
|
||||
@@ -249,18 +249,6 @@ def get_architecture_class_name(model_config: ModelConfig) -> str:
|
||||
return get_model_architecture(model_config)[1]
|
||||
|
||||
|
||||
def post_load_weights(model: nn.Module, model_config: ModelConfig):
|
||||
# Model weight loading consists of two stages:
|
||||
# 1. Initial weight loading.
|
||||
# 2. Post-processing of weights, including assigning specific member variables.
|
||||
# For `dummy_init`, only the second stage is required.
|
||||
if hasattr(model, "post_load_weights"):
|
||||
if model_config.hf_config.architectures[0] == "DeepseekV3ForCausalLMNextN":
|
||||
model.post_load_weights(is_nextn=True)
|
||||
else:
|
||||
model.post_load_weights()
|
||||
|
||||
|
||||
def should_deepgemm_weight_requant_ue8m0(
|
||||
weight_block_size, output_dtype=None, weight_shape=None
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user