Skip to content

fix(kvcache): consolidate per-option workload params in mlpstorage (#498, #500)#501

Merged
dslik merged 1 commit into
feat/drop-caches-timeout-clifrom
fix/issue-498-500-kvcache-wrapper-consolidation
Jun 24, 2026
Merged

fix(kvcache): consolidate per-option workload params in mlpstorage (#498, #500)#501
dslik merged 1 commit into
feat/drop-caches-timeout-clifrom
fix/issue-498-500-kvcache-wrapper-consolidation

Conversation

@FileSystemGuy

Copy link
Copy Markdown
Contributor

Summary

Closes #498 and #500. Both issues report the same root cause: kv_cache_benchmark/mlperf_wrapper.py was unconditionally injecting WORKLOAD_PARAMS as explicit CLI flags on every kv-cache.py invocation, overriding the user's --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 redundant in CLOSED and actively harmful in OPEN.

  • WORKLOAD_PARAMS now lives only in mlpstorage_py.benchmarks.kvcache — single source of truth for what option N means at the kv-cache.py level.
  • New 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-allocs always stays at the option's mandated value because it has no OPEN CLI flag.
  • mlperf_wrapper.py reduced to a pure rank-aware launcher: takes --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.

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 to main.

Test plan

  • tests/unit/test_mlperf_wrapper.py — 14 tests covering rank detection, new wrapper API, forwarded-arg passthrough, per-rank override ordering, and WORKLOAD_PARAMS removal
  • tests/unit/test_benchmarks_kvcache.py — 69 tests including new TestWorkloadParamsConstant, TestBuildOptionKvcacheArgs (CLOSED verbatim, OPEN user-override, max-concurrent-allocs invariant), and TestWrapperCommandForwardsPerOptionArgs (end-to-end wrapper-cmd assertions for CLOSED and OPEN)
  • Manual verification on a real KV cache run with --config + open mode to confirm user YAML values flow through

, #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.
@FileSystemGuy FileSystemGuy requested a review from a team as a code owner June 24, 2026 04:34
@github-actions

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@FileSystemGuy FileSystemGuy requested a review from dslik June 24, 2026 04:59

@dslik dslik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the code. Will merge and run additional tests.

@dslik dslik merged commit faf12ad into feat/drop-caches-timeout-cli Jun 24, 2026
2 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants