From 92327edc61ca94fbee3252bef3e8c219a3f22b29 Mon Sep 17 00:00:00 2001 From: sam sammandam Date: Mon, 11 May 2026 22:21:44 -0700 Subject: [PATCH] Apply CLI override_parameters into metadata.json parameters Fixes #365 (Checkpointing Benchmark: Invalid Submission Due to Incorrect Operation Count) The submission_checker reads num_checkpoints_write/read from metadata['parameters'] (YAML defaults), but split-phase submissions need the CLI overrides reflected there. Previously the overrides only landed in metadata['override_parameters'] which the checker ignores - causing 10W+10R per phase to aggregate to 20W+20R and INVALID. Fix: at metadata serialization time, apply override_parameters (dotted keys) into the nested parameters dict, so parameters reflects the effective config. override_parameters is still emitted unchanged for full audit. Signed-off-by: sam sammandam --- mlpstorage_py/benchmarks/base.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/mlpstorage_py/benchmarks/base.py b/mlpstorage_py/benchmarks/base.py index cd820e90..7956506f 100755 --- a/mlpstorage_py/benchmarks/base.py +++ b/mlpstorage_py/benchmarks/base.py @@ -294,6 +294,24 @@ def _execute_command( return stdout, stderr, return_code + @staticmethod + def _apply_dotted_overrides(params, overrides): + """Apply override_parameters (dotted keys) into a nested params dict. + + Fixes #365: makes metadata['parameters'] reflect the effective + run configuration (YAML defaults + CLI overrides), which is what + the submission_checker reads. + """ + import copy + out = copy.deepcopy(params) + for dotted, value in (overrides or {}).items(): + parts = dotted.split('.') + cur = out + for p in parts[:-1]: + cur = cur.setdefault(p, {}) + cur[parts[-1]] = value + return out + @property def metadata(self) -> Dict[str, Any]: """Generate metadata dict capturing the benchmark run configuration. @@ -322,9 +340,16 @@ def metadata(self) -> Dict[str, Any]: 'result_dir': self.run_result_output, } - # Parameters - prefer combined_params if available (includes YAML + overrides) + # Parameters - YAML defaults with CLI overrides applied (fixes #365). + # combined_params from process_dlio_params() does not fold CLI + # overrides into nested keys (e.g. checkpoint.num_checkpoints_*), + # so the submission_checker (which reads from `parameters`) + # under-counts two-phase submissions. Apply override_parameters + # here so `parameters` reflects the effective run config; + # `override_parameters` is still emitted unchanged for audit. if hasattr(self, 'combined_params'): - metadata['parameters'] = self.combined_params + metadata['parameters'] = self._apply_dotted_overrides( + self.combined_params, getattr(self, 'params_dict', {})) else: metadata['parameters'] = {}