Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0889d5c
refactor(05-01): consolidate MLPSTORAGE_* env-var names, add ENV_FALL…
FileSystemGuy Jul 3, 2026
b9a1bab
refactor(05-01): drop tempdir-fallback warn block; rename downstream …
FileSystemGuy Jul 3, 2026
f2b9d76
refactor(05-01): import MLPSTORAGE_*_ENVVAR names from config, not lo…
FileSystemGuy Jul 3, 2026
7c3b4ed
refactor(05-04): rename run_summary Environment MLPERF_* rows to MLPS…
FileSystemGuy Jul 3, 2026
3113ef0
feat(05-03): add req_checkpoint_folder kwarg + MLPSTORAGE_ help text
FileSystemGuy Jul 3, 2026
7f013c6
feat(05-03): rewrite training --data-dir gate to D-02 verbatim template
FileSystemGuy Jul 3, 2026
bcfa007
feat(05-02): rewrite _check_universal_required_present per D-01/D-02/…
FileSystemGuy Jul 3, 2026
ee549b7
feat(05-03): drop required=True on --checkpoint-folder, plumb marker …
FileSystemGuy Jul 3, 2026
cbbb534
test(05-05): rename test_config.py MLPERF_/DEFAULT_ symbols to MLPSTO…
FileSystemGuy Jul 3, 2026
7c7d1b8
test(05-06): add env-var migration regression tests (TEST-12, D-17)
FileSystemGuy Jul 3, 2026
7c2b245
test(05-06): add import-direction invariant tests (D-11, D-18)
FileSystemGuy Jul 3, 2026
7efeeb5
test(05-05): rename MLPERF_/DEFAULT_ symbols across CLI + run_summary…
FileSystemGuy Jul 3, 2026
5861b9c
test(05-06): add loud-error contract tests (TEST-13, ENV-06, D-19)
FileSystemGuy Jul 3, 2026
484d10f
test(05-05): delete test_main_warnings.py (D-15 / TEST-16)
FileSystemGuy Jul 3, 2026
10b108d
test(06-03): add 6-run unet3d + 3-run resnet50 training fixtures
FileSystemGuy Jul 4, 2026
1a78c0a
test(06-03): add 10-op happy + 7-op partial checkpointing fixtures
FileSystemGuy Jul 4, 2026
e0d535b
test(06-03): add vdb in-summary-recall + recall_stats fallback fixtures
FileSystemGuy Jul 4, 2026
c2e429a
test(06-03): add kvcache multi-option fixture (D-16 flattening, D-22 …
FileSystemGuy Jul 4, 2026
ca2b7c1
test(06-03): add whatif training fixture (D-29 skip-rules-strict anchor)
FileSystemGuy Jul 4, 2026
f39a523
test(06-03): add multi-orgname submission fixture (D-08 collection an…
FileSystemGuy Jul 4, 2026
bf35393
test(06-03): add empty-model-dir fixture (D-03 header-only anchor)
FileSystemGuy Jul 4, 2026
0772c4b
test(06-03): add degenerate fixtures (D-23 empty, NaN, missing summary)
FileSystemGuy Jul 4, 2026
34adfeb
feat(06-02): add fmean import and D-24 verbatim INVALID message const…
FileSystemGuy Jul 4, 2026
ec1d26f
feat(06-02): add _aggregate_workload_metrics dispatch + four per-type…
FileSystemGuy Jul 4, 2026
4f55fe9
docs(06-01): add Rules.md §2.1.28 aggregateResultsFile per D-30/D-34
FileSystemGuy Jul 5, 2026
55b96dc
feat(06-04): rewrite _process_workload_groups per D-05/D-23/D-26/D-27
FileSystemGuy Jul 5, 2026
3ec4c84
feat(06-04): rewrite generate_reports to bottom-up build per D-02
FileSystemGuy Jul 5, 2026
dda2e37
feat(06-04): replace sorted(fieldnames) with D-11 grouped assembly
FileSystemGuy Jul 5, 2026
b2ef67d
test(06-05): add 7-class aggregation regression contracts (D-19..D-29…
FileSystemGuy Jul 5, 2026
58225aa
test(06-06): add reportgen output-shape + end-to-end tests; phase 6 c…
FileSystemGuy Jul 5, 2026
4a774d2
feat(07-02): add _MANPAGE_SYNC_ALLOWLIST and MANPAGE_ENV_VAR_TIERS to…
FileSystemGuy Jul 5, 2026
f692781
docs(07-03): rewrite ENVIRONMENT section as six per-tier markdown tables
FileSystemGuy Jul 5, 2026
cc6a68e
docs(07-03): add Aggregate Interpretation subsection under RESULTS DI…
FileSystemGuy Jul 5, 2026
d92f4a3
docs(07-03): L473/L150 --systemname bullet — drop reportgen, rename t…
FileSystemGuy Jul 5, 2026
c5576a6
docs(07-03): L847 reportgen --systemname — required→optional + D-23 v…
FileSystemGuy Jul 5, 2026
8515ffb
docs(07-03): rename all MLPERF_* prose references to MLPSTORAGE_* (SC…
FileSystemGuy Jul 5, 2026
e99857f
test(07-04): add env-var/ManPage inventory sync test (DOC-05 gate)
FileSystemGuy Jul 5, 2026
2b4af94
feat(07.5-01): add S3DLIO constants and tier entries to config.py
FileSystemGuy Jul 5, 2026
0f7a184
feat(07.5-01): add Storage-backend tier to ManPage.md; extend AWS-bor…
FileSystemGuy Jul 5, 2026
cbe0728
fix(07.5-01): update sync test to recognize 'storage-backend' as 7th …
FileSystemGuy Jul 5, 2026
336fa2f
feat(07.5-02): add _check_storage_backend_env() to Benchmark base class
FileSystemGuy Jul 5, 2026
36a4eab
feat(07.5-02): extend sync test with MANPAGE_STORAGE_BACKEND_ENV_VARS…
FileSystemGuy Jul 5, 2026
f1258f3
feat(07.5-02): add D-14 storageBackendEnvVarDeclaration rule to Rules.md
FileSystemGuy Jul 5, 2026
e12e813
fix: align _enumerate_on_disk_model_dirs to return <model>/run/ for t…
FileSystemGuy Jul 5, 2026
af88ede
merge: resolve conflicts from PR #707 (Phase 6 aggregation) merging t…
FileSystemGuy Jul 7, 2026
43294f7
fix: remove §2.1.28 aggregateResultsFile from Rules.md
FileSystemGuy Jul 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 111 additions & 18 deletions ManPage.md

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ The `mlpstorage` tool must be used to run the benchmarks, submitters are not all

1.1. **mlpstorageGeneratesHierarchy** -- The `mlpstorage` command must obtain (somehow) the pathname of the output file directory hierarchy and directly create and/or append to the files within that hierarchy to successively build out the submission folder. We don't want the submitter to manually create anything in that hierarchy except for the SystemDescription.* files (if we can help it).

1.2. **storageBackendEnvVarDeclaration** -- Submitters MUST NOT set any documented s3dlio-side env var (§ENVIRONMENT → Storage-backend in ManPage.md) during the timed run unless the run's configuration file explicitly declares it. Results from runs with undeclared storage-backend env vars MUST be submitted as OPEN category. mlpstorage warns at run start when HIGH-risk vars are detected.

For cloud-specific credential and endpoint env vars consumed by s3dlio for Azure or GCS backends, see s3dlio's [Environment_Variables.md](https://github.com/mlcommons/s3dlio/blob/main/docs/Environment_Variables.md).

# 2. Core/Common Rules for All Submissions

## 2.1. Core/Common POSIX API Rules
Expand Down Expand Up @@ -666,7 +670,7 @@ is better), and the **aggregate Storage Throughput in tokens/s**.
A run is launched with `mlpstorage <closed|open|whatif> kvcache run [OPTIONS]`
(the division is the first positional, post-PR #412 modal CLI). The results
directory must first be initialised once with `mlpstorage init <orgname>
<results-dir>`, and every run requires `--systemname` (or the `MLPERF_SYSTEMNAME`
<results-dir>`, and every run requires `--systemname` (or the `MLPSTORAGE_SYSTEMNAME`
environment variable). The command executes **all three Options sequentially**,
each repeated `trials` times, by prefixing `mpirun` to `mlperf_wrapper.py`. The
Option's parameters are built by `mlpstorage` (`_build_option_kvcache_args`) and
Expand Down
34 changes: 33 additions & 1 deletion mlpstorage_py/benchmarks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ def _run(self):

from functools import wraps

from mlpstorage_py.config import PARAM_VALIDATION, DATETIME_STR, MLPS_DEBUG, EXEC_TYPE
from mlpstorage_py.config import (
PARAM_VALIDATION,
DATETIME_STR,
MLPS_DEBUG,
EXEC_TYPE,
_S3DLIO_HIGH_RISK_ENV_VARS,
)
from mlpstorage_py.errors import ConfigurationError, ErrorCode, FileSystemError
from mlpstorage_py.run_directory import (
DEFAULT_COLLISION_BUMP_BUDGET,
Expand Down Expand Up @@ -991,6 +997,30 @@ def _fs_separation_paths(self) -> Optional[tuple]:
f"_fs_separation_paths() for CAP-03"
)

def _check_storage_backend_env(self) -> None:
"""Warn when HIGH-risk s3dlio env vars are set (Phase 7.5 D-07, D-08).

Checks ``os.environ`` for entries in ``_S3DLIO_HIGH_RISK_ENV_VARS``
and emits a WARNING for each one found, but only when the active
storage library is s3dlio (``STORAGE_LIBRARY == 's3dlio'``).

Rationale for the STORAGE_LIBRARY guard (D-07): training-only
deployments that never use s3dlio should not see s3dlio warnings.
The guard avoids false positives without requiring per-var allowlists.

The warning uses the D-08 verbatim template so that automated tests
(test_d08_warning_prefix_in_benchmark_source) can lock the wording.
"""
if os.environ.get('STORAGE_LIBRARY') != 's3dlio':
return
for var_name in sorted(_S3DLIO_HIGH_RISK_ENV_VARS):
if var_name in os.environ:
self.logger.warning(
f"s3dlio env var '{var_name}' is set — this may alter measured benchmark results. "
"Declare it in your config or submit as OPEN category. "
"See ManPage §ENVIRONMENT → Storage-backend for impact."
)

def _pre_execution_gate(self) -> None:
"""Run all pre-execution capacity/environment gates (CAP-01 in
Slice 3; CAP-02 shared-FS verification is appended in Slice 4 of
Expand Down Expand Up @@ -1066,6 +1096,8 @@ def _pre_execution_gate(self) -> None:
# design decision D-601-1). --skip-fs-separation-gate bypasses the
# raise but still writes the sidecar so the validator gets telemetry.
self._run_fs_separation_probe()
# Phase 7.5 D-07: warn when HIGH-risk s3dlio env vars are set.
self._check_storage_backend_env()

def _run_fs_separation_probe(self) -> None:
"""Run the CAP-03 FS-separation probe and write the sidecar.
Expand Down
22 changes: 19 additions & 3 deletions mlpstorage_py/cli/checkpointing_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@

import sys

from mlpstorage_py.config import DEFAULT_HOSTS, EXEC_TYPE, LLM_MODELS, LLM_MODELS_CLOSED, EXIT_CODE
from mlpstorage_py.config import (
DEFAULT_HOSTS, EXEC_TYPE, LLM_MODELS, LLM_MODELS_CLOSED, EXIT_CODE,
ENV_FALLBACK_CHECKPOINT_FOLDER,
)
from mlpstorage_py.cli.common_args import (
HELP_MESSAGES,
add_universal_arguments,
Expand Down Expand Up @@ -137,14 +140,27 @@ def _add_checkpointing_core_args(parser, command):
),
)

# Checkpoint folder required for run only
# Checkpoint folder required for run only. The argparse-level required=True
# was replaced by post-parse enforcement (Phase 5 D-08 / D-09 / ENV-06) so
# the ENV_FALLBACK_CHECKPOINT_FOLDER default (sourced from
# MLPSTORAGE_CHECKPOINT_FOLDER env var) can satisfy the requirement. The
# loud-error gate lives in cli_parser._check_universal_required_present
# keyed off the _mlps_req_checkpoint_folder marker we set below. The
# --checkpoint-folder argument stays defined ONLY here (never in
# common_args.py) so no other benchmark inherits it.
if command == "run":
parser.add_argument(
'--checkpoint-folder', '-cf',
type=str,
required=True,
default=ENV_FALLBACK_CHECKPOINT_FOLDER,
help=HELP_MESSAGES['checkpoint_folder']
)
# Plumb the post-parse-gate marker locally, next to the arg definition,
# so the flag and its enforcement gate stay co-located (D-09). The
# symmetric req_checkpoint_folder kwarg on add_universal_arguments
# exists for defensive future callers; the checkpointing flow uses
# this local set_defaults.
parser.set_defaults(_mlps_req_checkpoint_folder=True)

# num-checkpoints-read/write are available in all modes so closed submitters
# can split write and read into two invocations (set =0 on one side) with a
Expand Down
50 changes: 38 additions & 12 deletions mlpstorage_py/cli/common_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from mlpstorage_py.config import (
CHECKPOINT_RANKS_STRINGS, MODELS, ACCELERATORS, ACCELERATORS_CLOSED, DEFAULT_HOSTS,
LLM_MODELS_STRINGS, MPI_CMDS, EXEC_TYPE, DEFAULT_RESULTS_DIR, DEFAULT_SYSTEMNAME,
LLM_MODELS_STRINGS, MPI_CMDS, EXEC_TYPE, ENV_FALLBACK_RESULTS_DIR, ENV_FALLBACK_SYSTEMNAME,
VECTOR_DTYPES, DISTRIBUTIONS
)

Expand Down Expand Up @@ -129,7 +129,10 @@ def add_arguments(self, actions):
'reportgen': "Generate a report from the benchmark results.",

# Checkpoint folder is used for training and checkpointing
'checkpoint_folder': "Location for checkpoint files for training or checkpointing workloads",
'checkpoint_folder': (
"Location for checkpoint files for training or checkpointing workloads. "
"Defaults to MLPSTORAGE_CHECKPOINT_FOLDER env var if set."
),

# Checkpointing help messages
'checkpoint_run': "The checkpoint command executes checkpoint saves and restores for a given model.",
Expand Down Expand Up @@ -186,7 +189,7 @@ def add_arguments(self, actions):
# System-under-test name (LAY-04 / D-10) — folder under results/ in canonical layout
'systemname': (
"System-under-test name (folder under results/). "
"Defaults to MLPERF_SYSTEMNAME env var if set."
"Defaults to MLPSTORAGE_SYSTEMNAME env var if set."
),

# MPI help messages
Expand Down Expand Up @@ -219,22 +222,34 @@ def add_arguments(self, actions):
}


def add_universal_arguments(parser, req_results, req_systemname=False):
def add_universal_arguments(parser, req_results, req_systemname=False, req_checkpoint_folder=False):
"""Add arguments common to all benchmarks and commands.

Args:
parser: Argparse parser to add arguments to.
req_results: Whether --results-dir is required. The requirement is
enforced POST-PARSE (see ``check_universal_arguments_present``)
so the ``MLPERF_RESULTS_DIR`` env-var-sourced default counts as
satisfying it. Using ``required=True`` here would short-circuit
so the ``MLPSTORAGE_RESULTS_DIR`` env-var-sourced default counts
as satisfying it. Using ``required=True`` here would short-circuit
argparse before the env-var default applies — that's the CR-02
bug we fixed.
req_systemname: Whether --systemname is required. Defaults to False
so pure utility call sites (lockfile, etc.) keep working without
opting in. Emitting commands (datagen/run/configview/datasize/
reportgen/history) MUST opt in per CONTEXT.md D-10 / LAY-04.
Same post-parse enforcement model as ``req_results``.
req_checkpoint_folder: Whether --checkpoint-folder is required for
this invocation. Defaults to False. When True, plumbs the
``_mlps_req_checkpoint_folder`` marker onto the argparse namespace
via ``parser.set_defaults`` so the post-parse gate
(``cli_parser._check_universal_required_present``) can enforce
non-emptiness with the D-02 loud-error line. NOTE: the
``--checkpoint-folder`` argument itself is registered in
``mlpstorage_py/cli/checkpointing_args.py`` — NOT here — so no
other benchmark accidentally inherits it (see Phase 5 D-09). This
kwarg exists for symmetry with ``req_results`` / ``req_systemname``
and for defensive future callers; the checkpointing flow plumbs
the marker locally in its own arg builder.
"""
standard_args = parser.add_argument_group("Standard Arguments")
# NOTE on the env-var fallback (CR-02): argparse's ``required=True``
Expand All @@ -245,11 +260,12 @@ def add_universal_arguments(parser, req_results, req_systemname=False):
# emitting subcommand. We drop ``required=True`` entirely and instead
# stash a marker on the namespace (via an argparse.SUPPRESS-defaulted
# action) that ``check_universal_arguments_present`` consumes at the
# post-parse validation layer to enforce non-emptiness.
# post-parse validation layer to enforce non-emptiness. Env-var names:
# MLPSTORAGE_RESULTS_DIR / MLPSTORAGE_SYSTEMNAME (see config.py D-10).
standard_args.add_argument(
'--results-dir', '-rd',
type=str,
default=DEFAULT_RESULTS_DIR,
default=ENV_FALLBACK_RESULTS_DIR,
help=HELP_MESSAGES['results_dir']
)
if req_results:
Expand All @@ -260,19 +276,29 @@ def add_universal_arguments(parser, req_results, req_systemname=False):
parser.set_defaults(_mlps_req_results=True)

# --systemname: required on emitting commands (Rules.md §2.1.8 systemname
# subdir), optional elsewhere. Default = DEFAULT_SYSTEMNAME = "" unless
# MLPERF_SYSTEMNAME env var is set. Same env-var-fallback bug as above:
# we keep argparse's ``required=False`` and gate emptiness post-parse.
# subdir), optional elsewhere. Default sourced from ENV_FALLBACK_SYSTEMNAME
# = "" unless the MLPSTORAGE_SYSTEMNAME env var is set. Same env-var-fallback
# bug as above: we keep argparse's ``required=False`` and gate emptiness
# post-parse.
standard_args.add_argument(
'--systemname', '-sn',
type=str,
required=False,
default=DEFAULT_SYSTEMNAME,
default=ENV_FALLBACK_SYSTEMNAME,
help=HELP_MESSAGES['systemname']
)
if req_systemname:
parser.set_defaults(_mlps_req_systemname=True)

# --checkpoint-folder marker: per D-09, the `--checkpoint-folder` argument
# is registered in checkpointing_args.py (NOT here). This branch only plumbs
# the ``_mlps_req_checkpoint_folder`` namespace marker for callers that
# prefer symmetric opt-in via ``add_universal_arguments``. The checkpointing
# flow instead plumbs this marker locally next to its arg definition to keep
# the flag and its enforcement gate co-located.
if req_checkpoint_folder:
parser.set_defaults(_mlps_req_checkpoint_folder=True)

standard_args.add_argument(
'--config-file', '-c',
type=str,
Expand Down
22 changes: 16 additions & 6 deletions mlpstorage_py/cli/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
"""

import argparse
import os
import sys

from mlpstorage_py.config import (
MODELS, MODELS_CLOSED, MODELS_OPEN, ACCELERATORS, ACCELERATORS_CLOSED,
DEFAULT_HOSTS, EXEC_TYPE, EXIT_CODE
DEFAULT_HOSTS, EXEC_TYPE, EXIT_CODE, ENV_FALLBACK_DATA_DIR
)

from mlpstorage_py.cli.common_args import (
Expand Down Expand Up @@ -171,9 +172,11 @@ def _add_training_core_args(parser, command, accel_choices):
parser.add_argument(
'--data-dir', '-dd',
type=str,
default=ENV_FALLBACK_DATA_DIR,
help=(
"Dataset location. For file storage, this is a filesystem path. "
"For object storage, this is an object key prefix or full object URI."
"For object storage, this is an object key prefix or full object URI. "
"Defaults to MLPSTORAGE_DATA_DIR env var if set."
)
)

Expand Down Expand Up @@ -293,14 +296,21 @@ def validate_training_arguments(args):

# Object-mode --data-dir enforcement runs here (post-YAML) so --config-file
# can populate data_dir for object workflows. File-mode enforcement happens
# earlier in cli_parser.parse_arguments via parser.error().
# earlier in cli_parser.parse_arguments via parser.error(). Message text is
# the D-02 verbatim template (Phase 5 D-02 / D-07) — do NOT paraphrase; it
# is pinned by loud-error tests.
if command in ('datagen', 'run') and protocol == 'object' and not getattr(args, 'data_dir', None):
print(
f"ERROR: --data-dir is required for training {command} with object storage.\n"
" Specify --data-dir <key-prefix-or-URI> on the command line, or set\n"
" 'data_dir:' in the file passed via --config-file.",
f"error: --data-dir/-dd is required: pass it on the command line or set MLPSTORAGE_DATA_DIR",
file=sys.stderr,
)
# D-05 migration hint: fires only when the user set the legacy env var
# but not the new one — actionable at exactly the moment of failure.
if os.environ.get('MLPERF_DATA_DIR') and not os.environ.get('MLPSTORAGE_DATA_DIR'):
print(
f"hint: MLPERF_DATA_DIR is set but is no longer read; rename it to MLPSTORAGE_DATA_DIR",
file=sys.stderr,
)
sys.exit(EXIT_CODE.INVALID_ARGUMENTS)

if getattr(args, 'o_direct', False) and protocol != 'file':
Expand Down
Loading
Loading