Configure and call dumper in main SGLang logic (#19093)

This commit is contained in:
fzyzcjy
2026-02-22 16:14:27 +08:00
committed by GitHub
parent cc63c99f11
commit 31f0c11405
4 changed files with 105 additions and 6 deletions
@@ -20,9 +20,7 @@ def main(args):
)
if args.filter:
df_target = df_target.filter(pl.col("filename").str.contains(args.filter))
assert all(
c in df_target.columns for c in ["rank", "step", "dump_index", "name"]
)
assert all(c in df_target.columns for c in ["rank", "step", "dump_index", "name"])
df_baseline = read_meta(args.baseline_path)
print("df_target", df_target)
@@ -41,9 +39,7 @@ def main(args):
baseline_step = location_info.baseline_step
baseline_token_slice = location_info.baseline_token_slice
else:
baseline_step = (
row["step"] - args.start_id + args.baseline_start_id
)
baseline_step = row["step"] - args.start_id + args.baseline_start_id
baseline_token_slice = None
tensor_dim_desc = None
+5
View File
@@ -168,6 +168,10 @@ class _Dumper:
# ------------------------------- public :: core ---------------------------------
@property
def may_enable(self) -> bool:
return self._config.enable or self._config.server_port_parsed is not None
def step(self):
"""This should be called on all ranks at the end of each iteration."""
@@ -237,6 +241,7 @@ class _Dumper:
self,
model: "torch.nn.Module",
) -> Optional["_NonIntrusiveDumper"]:
self._ensure_http_server()
mode = self._config.non_intrusive_mode
if mode == "off":
return None