From f3dbadb82b235fc9dddb60f639621114b7d98f76 Mon Sep 17 00:00:00 2001 From: Alison Shao <54658187+alisonshao@users.noreply.github.com> Date: Sat, 2 May 2026 00:58:15 -0700 Subject: [PATCH] fix: accept 0-indexed safetensors shard names in CI weight validator (#24237) --- python/sglang/srt/model_loader/ci_weight_validation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/sglang/srt/model_loader/ci_weight_validation.py b/python/sglang/srt/model_loader/ci_weight_validation.py index b5220e922..4be11ef1d 100644 --- a/python/sglang/srt/model_loader/ci_weight_validation.py +++ b/python/sglang/srt/model_loader/ci_weight_validation.py @@ -1426,7 +1426,10 @@ def _validate_sharded_model( for group_key, group_info in shard_groups.items(): total_shards = group_info["total"] found_shards = set(group_info["found_shards"]) - expected_shards = set(range(1, total_shards + 1)) + # Shards may be 0-indexed (e.g. inclusionAI/Ring-2.5-1T) or 1-indexed + # (e.g. deepseek-ai/DeepSeek-V3); both are valid HF conventions. + min_idx = min(found_shards) if found_shards else 1 + expected_shards = set(range(min_idx, min_idx + total_shards)) # Check for missing shards missing_shards = expected_shards - found_shards