Fix FP8 KV Cache Support in FA3 Backend (#7148)

This commit is contained in:
Yuhong Guo
2025-06-25 17:14:40 +08:00
committed by GitHub
parent fe2a0f962f
commit a1c1ebe935
3 changed files with 72 additions and 18 deletions

View File

@@ -239,7 +239,7 @@ class ModelRunner:
"SGLANG_LOG_EXPERT_LOCATION_METADATA"
):
logger.info(
f"Initial expert_location_metadata: {get_global_expert_location_metadata().debug_str()}"
f"Initial expert_location_metadata: {get_global_expert_location_metadata()}"
)
set_global_expert_distribution_recorder(
@@ -866,7 +866,9 @@ class ModelRunner:
else:
self.kv_cache_dtype = torch.float8_e5m2
elif self.server_args.kv_cache_dtype == "fp8_e4m3":
if is_cuda():
if _is_hip: # Using natively supported format
self.kv_cache_dtype = torch.float8_e4m3fnuz
else:
self.kv_cache_dtype = torch.float8_e4m3fn
else:
raise ValueError(