Add prefixed _log helper in dumper (#24506)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user