Skip to content

fix(eval): count a single-row PAI-Bench-C shard as pending - #317

Draft
tarang-tj wants to merge 1 commit into
NVIDIA:mainfrom
tarang-tj:fix/paibench-c-single-row-shard
Draft

tarang-tj wants to merge 1 commit into
NVIDIA:mainfrom
tarang-tj:fix/paibench-c-single-row-shard

Conversation

@tarang-tj

Copy link
Copy Markdown

Ports the fix for NVIDIA/cosmos#376 (diagnosis by @JIN-strong; their PR NVIDIA/cosmos#377 targets the old repository layout) into run_paibench_c.sh.

Bug. The shard writer joins rows with "\n" and never writes a trailing newline. The launcher then counts pending rows with wc -l, which counts newlines, so a shard with exactly one pending row reads as 0, logs "all tasks done, skipping", and that video is never generated. Larger shards are undercounted by one but still run.

Fix. Write every row with its own terminating newline (one changed line plus a comment). An empty shard still produces an empty file, so the zero case behaves as before.

Verification (CPU only). I ran the old and new write expressions through the same wc -l < file | tr -d ' ' the launcher uses:

rows written old count new count
0 0 0
1 0 1
2 1 2
3 2 3

Every file parses back to the same rows either way. bash -n passes. The Python block sits inside a quoted heredoc (<<'PY'), so the backticks in the new comment are not expanded. I have not run a full GPU benchmark.

This touches a different region of the script than #315, so the two should not conflict.

The shard writer joined rows with "\n" and wrote no trailing newline, while
the launcher counts pending rows with `wc -l`, which counts newlines. A shard
with exactly one pending row therefore read as 0 and its GPU worker was
skipped, leaving that video ungenerated. Terminate every row with a newline
so the count matches the rows written.

Diagnosis from NVIDIA/cosmos#376.

Signed-off-by: Tarang (TJ) Jammalamadaka <tarangjammalamadaka9@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant