Add prefixed _log helper in dumper (#24506)

This commit is contained in:
fzyzcjy
2026-05-06 16:54:20 +08:00
committed by GitHub
parent 23172224b9
commit 61104d7d0a
2 changed files with 36 additions and 22 deletions
+13 -1
View File
@@ -20,6 +20,7 @@ from sglang.srt.debug_utils.dumper import (
_Dumper,
_format_tags,
_get_default_exp_name,
_log,
_map_tensor,
_materialize_value,
_MegatronPlugin,
@@ -377,10 +378,21 @@ class TestTorchSave:
_torch_save({"fn": lambda: None}, path)
captured = capsys.readouterr()
assert "[Dumper] Observe error=" in captured.out
assert "[Dumper, rank=" in captured.out
assert "Observe error=" in captured.out
assert "skip the tensor" in captured.out
class TestLog:
def test_log_format(self):
with _capture_stdout() as captured:
_log("hello")
out = captured.getvalue()
assert "hello" in out, out
assert "[Dumper, rank=" in out, out
assert ", t=" in out, out
class TestCollectiveTimeout:
def test_watchdog_fires_on_timeout(self):
block_event = threading.Event()