Configure and call dumper in main SGLang logic (#19093)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user