Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion python/sglang/srt/utils/weight_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,11 @@ def _build_check_entries(
continue # compared via its weight's comparable
if name in quantized_set:
qw = quantized_set[name]
yield CheckEntry(name, True, qw.comparable_cls(tensor, raw[qw.scale_name]))
yield CheckEntry(
name,
name not in skip_compare_names,
qw.comparable_cls(tensor, raw[qw.scale_name]),
)
else:
should_compare = name not in skip_compare_names and (
not _is_non_persistent_buffer_name(name)
Expand Down
7 changes: 6 additions & 1 deletion test/registered/rl/test_weight_checker_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,12 @@ def test_e_checksum_returns_ranks_with_hashes(self):
self.assertIn("checksums", first)
self.assertIn("parallelism_info", first)

info = first["parallelism_info"]
parallelism_info = first["parallelism_info"]
self.assertIsInstance(parallelism_info, list)
self.assertGreaterEqual(len(parallelism_info), 1)

info = parallelism_info[0]
self.assertEqual(info["role"], "target")
for key in (
"tp_rank",
"tp_size",
Expand Down
12 changes: 12 additions & 0 deletions test/registered/unit/utils/test_weight_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,18 @@ def test_substring_match_not_endswith(self):
[("weird.cos_sin_cache.foo.bar", False, RawComparable(t))],
)

def test_skip_set_marks_quantized_entry_not_compared(self):
qweight, sf_fp32, _ = _build_fp8_quant_pair()
raw = {"x.weight": qweight, "x.weight_scale_inv": sf_fp32}
quantized_set = {
"x.weight": QuantizedWeight(Fp8BlockComparable, "x.weight_scale_inv")
}
ref = Fp8BlockComparable(qweight, sf_fp32)
_assert_entries_close(
_build_check_entries(raw, {"x.weight"}, quantized_set),
[("x.weight", False, ref)],
)

# --- fp8 quant pair (real dequant on real fp8 tensors) ---

def test_fp8_quant_pair_yields_lazy_pair(self):
Expand Down
Loading