fix(flux): start each MLPerf run with an empty result file - #1071
fix(flux): start each MLPerf run with an empty result file#1071gphuang wants to merge 2 commits into
Conversation
The MLLOG logger opens MLLOG_OUTPUT_FILE append-only and the path is derived from RUN_INDEX, so relaunching a run under the same index concatenates two runs into one result_N.txt. The compliance checker then reports every once-per-run key twice -- run_start, init_stop, opt_name and all the submission metadata -- and the failures look like a broken submission rather than a relaunch. Truncate the file where the run is set up, next to the mkdir that creates its directory. One file is one run.
MLLOG_OUTPUT_FILE is overridable and need not sit under RESULTS_DIR, and the script runs with set -e, so truncating a path in a directory that does not exist would abort the run on a bare redirect error. Give the file the same mkdir courtesy RESULTS_DIR already gets.
Note: author review of the full diffReviewed Blocking (fixed). Considered and not blocking. Truncating a caller-supplied path is destructive, but the caller named it as this run's output file, so one-run-one-file is the expected semantics rather than a surprise. The truncation sits before the cache-drop and before any GPU work, so a permission problem fails the run in the first second instead of four hours in. Checks run. Ready to merge. |
Note: handing this over — it fixes a file this chain introducedThis targets The change is two lines in Fix is to truncate at setup so one file always holds one run: mkdir -p "$(dirname "${MLLOG_OUTPUT_FILE}")"
: > "${MLLOG_OUTPUT_FILE}"The This matters most for a multi-seed campaign, where relaunches are routine and each run needs its own parseable log. |
|
Closing to keep the trail clean — this was avoidable without a code change. The trap is real: Leaving the mechanism recorded here so the next person recognises the symptom: twenty duplicate-key compliance failures on a run that was actually fine, cleared by splitting the log at the second |
Summary
The MLLOG logger opens
MLLOG_OUTPUT_FILEappend-only, andrun_and_time.shderives that path fromRUN_INDEXalone. Relaunching a run under the same index therefore writes both attempts into oneresult_N.txt, and the compliance checker reports every once-per-run key twice.This turned up on a real MXFP6 Flux convergence run. A first attempt died early, the fixed relaunch converged, and the checker then reported ~20 failures —
run_start,init_stop,opt_name,train_samples,eval_samplesand all the submission metadata, each "required EXACTLY_ONE occurrence but found 2". None of them were real. Splitting the file at the secondinit_startand re-running the checker left exactly one finding, the knownmxfp6vocabulary gap this script already documents.The fix truncates the file where the run is set up, next to the
mkdirthat creates its directory. One file is one run.Test plan
bash -n examples/mlperf/flux1/megatron/run_and_time.shmlperf_logging.compliance_checker --ruleset 6.0.0on the manually split log from the affected run: all duplicate-key findings cleared, only themxfp6precision-vocabulary failure remainsRUN_INDEXproduces a single-runresult_N.txt(covered by the issue 306 ten-run campaign)