fix: Salt failure is a hard error#406
Conversation
Signed-off-by: Rashid Kaleem <230885705+arekay-nv@users.noreply.github.com>
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
There was a problem hiding this comment.
Code Review
This pull request introduces early validation for dataset salting during the benchmark setup phase. It adds a validate_saltable method to ensure that all dataset samples are compatible with salting (i.e., they are dictionaries containing a string prompt and no input_tokens) before any subprocesses are spawned. The review feedback highlights a critical bug in validate_saltable where iterating over self.data directly will fail if it is a pandas.DataFrame (as it would iterate over column names instead of rows), and provides a code suggestion to handle this case.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
What does this PR do?
Makes salt failures a hard error instead of a silent skip. Previously, when
--warmup-saltwas on (the default) but a sample couldn't be salted,Dataset._apply_saltlogged a warning (or silently passed the sample through) and the warmup ran with no cache-busting — the exact condition salt exists to prevent, failing quietly.Now
salt=Truerequires every sample to be adictwith a text (str)promptand noinput_tokens; anything else raisesDatasetValidationErrorat dataset-load time, before any load is issued.Key changes:
Dataset.validate_saltable()— rejects non-dictsamples,input_tokens(pre-tokenized; adapters send these verbatim so a saltedpromptnever reaches the server), missingprompt, and non-strprompt. Error names the offending sample index + remediation._load_datasetswhenwarmup.enabled and warmup.salt, so an unsaltable dataset fails before worker/aggregator subprocesses spawn. Also called fromwith_salt()so the salting mechanism stays self-protecting._apply_saltcollapses to a single dict-merge ({**data, "prompt": f"[{salt}] {data['prompt']}"}) — the multimodal-list handling,input_tokenswarnings, and silent passthroughs are deleted; the contract is guaranteed upstream.promptthat is a list (image/video workloads) or a dataset withinput_tokens(e.g. gpt-oss-120b, DeepSeek-R1 via/v1/completions) will fail warmup instead of silently skipping salt. Fix: set--warmup-salt=false/warmup.salt: false.n_requestssubset would never issue. Stricter than the old per-sample skip; intended by the hard-error design.Type of change
Related issues
Testing
Checklist