fix(kvcache): consolidate per-option workload params in mlpstorage (#498, #500)#501
Merged
dslik merged 1 commit intoJun 24, 2026
Conversation
, #500) The mlperf_wrapper.py script was unconditionally injecting WORKLOAD_PARAMS on every kv-cache.py invocation, overriding user --config YAML and CLI flags even in OPEN mode. CLOSED/OPEN gating already lives in mlpstorage_py/cli/kvcache_args.py, so the wrapper-side squashing was both redundant in CLOSED and actively harmful in OPEN. WORKLOAD_PARAMS now lives only in mlpstorage_py.benchmarks.kvcache. KVCacheBenchmark._build_option_kvcache_args emits the per-option flags: verbatim in CLOSED, with user CLI flags superseding per-option defaults in OPEN. max-concurrent-allocs stays at the option's mandated value because it has no OPEN CLI flag. mlperf_wrapper.py becomes a pure rank-aware launcher: --rank-output-base, --rank-cache-base, --seed-base, --start-delay, --end-delay; everything else forwards verbatim to kv-cache.py. Per-rank --seed/--output/--cache-dir are appended last so argparse store-action takes them over forwarded duplicates. allow_abbrev=False prevents a forwarded --seed from collapsing into --seed-base.
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
dslik
approved these changes
Jun 24, 2026
dslik
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the code. Will merge and run additional tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #498 and #500. Both issues report the same root cause:
kv_cache_benchmark/mlperf_wrapper.pywas unconditionally injectingWORKLOAD_PARAMSas explicit CLI flags on everykv-cache.pyinvocation, overriding the user's--configYAML and CLI flags even in OPEN mode. CLOSED/OPEN gating already lives inmlpstorage_py/cli/kvcache_args.py, so the wrapper-side squashing was redundant in CLOSED and actively harmful in OPEN.WORKLOAD_PARAMSnow lives only inmlpstorage_py.benchmarks.kvcache— single source of truth for what option N means at the kv-cache.py level.KVCacheBenchmark._build_option_kvcache_args(option, is_closed)emits per-option flags: verbatim in CLOSED, with user CLI flags superseding per-option defaults in OPEN.max-concurrent-allocsalways stays at the option's mandated value because it has no OPEN CLI flag.mlperf_wrapper.pyreduced to a pure rank-aware launcher: takes--rank-output-base,--rank-cache-base,--seed-base,--start-delay,--end-delay; everything else forwards verbatim tokv-cache.py. Per-rank--seed/--output/--cache-dirare appended last so argparse store-action takes them over forwarded duplicates.allow_abbrev=Falseprevents a forwarded--seedfrom collapsing into--seed-base.Base branch note
This PR is currently based on
feat/drop-caches-timeout-cli(PR #492) to keep the diff clean. Once #492 lands, please retarget the base tomain.Test plan
tests/unit/test_mlperf_wrapper.py— 14 tests covering rank detection, new wrapper API, forwarded-arg passthrough, per-rank override ordering, andWORKLOAD_PARAMSremovaltests/unit/test_benchmarks_kvcache.py— 69 tests including newTestWorkloadParamsConstant,TestBuildOptionKvcacheArgs(CLOSED verbatim, OPEN user-override, max-concurrent-allocs invariant), andTestWrapperCommandForwardsPerOptionArgs(end-to-end wrapper-cmd assertions for CLOSED and OPEN)--config+ open mode to confirm user YAML values flow through