From ebff77ab8bfaa116efcf49065c1dc4a1700f75b9 Mon Sep 17 00:00:00 2001 From: Curtis Anderson Date: Wed, 23 Sep 2026 15:17:41 -0700 Subject: [PATCH 1/2] CI: pytest-xdist (-n auto) in every suite that has work; real-mpirun probe tests move to the kvcache job; matrix comments rebalanced from measured wall-clock --- .github/workflows/test.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3dd8c34..ced6659a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,17 +13,24 @@ jobs: fail-fast: false matrix: python-version: ['3.12'] - # Two parallel groups sized for GitHub's 2-vcpu runners: - # - kvcache runs alone (its suite dominates wallclock) - # - the other three run sequentially in the second group + # Two parallel groups, balanced by measured wall-clock (2026-09-23): + # - kvcache (238 tests averaging 0.5s of allocation setup each) plus + # the four real-mpirun probe tests (a fixed ~10s quiesce window + # each, 35% of the main suite when run serially); + # - the main suite minus those four, then the package and vdb suites. + # Every suite that has more than a few seconds of work runs under + # pytest-xdist (`-n auto`: one worker per runner vCPU). Both heavy + # suites were verified xdist-clean; the main suite drops from ~175s + # serial to ~30s at four workers, kvcache from ~100s to ~40s. group: - name: kvcache commands: | - uv run pytest kv_cache_benchmark/tests + uv run pytest kv_cache_benchmark/tests -n auto + uv run pytest tests/integration/test_shared_fs_probe_real_mpi.py -n auto - name: others commands: | - uv run pytest tests - uv run pytest mlpstorage_py/tests + uv run pytest tests -n auto --ignore=tests/integration/test_shared_fs_probe_real_mpi.py + uv run pytest mlpstorage_py/tests -n auto uv run pytest vdb_benchmark/tests name: test (${{ matrix.python-version }}, ${{ matrix.group.name }}) @@ -72,6 +79,8 @@ jobs: # both have a top-level package named `tests` whose conftest.py modules # collide under pytest's rootdir-relative import (ImportPathMismatchError). # Each suite's pyproject defines its own `slow` marker and `-m 'not slow'` - # default, so subprocess-level invocation is correct. + # default, so subprocess-level invocation is correct. The real-mpirun file + # is --ignore'd in `others` only because `kvcache` runs it explicitly: + # every test still runs exactly once per workflow run. - name: Run ${{ matrix.group.name }} test suite(s) run: ${{ matrix.group.commands }} From 93fea147f796c3c996e573957176b46e73c7c4be Mon Sep 17 00:00:00 2001 From: Curtis Anderson Date: Wed, 23 Sep 2026 15:17:41 -0700 Subject: [PATCH 2/2] pytest-xdist in the test extra; version 3.0.46 -> 4.0.1 --- pyproject.toml | 3 ++- uv.lock | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 97105286..4301b75e 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "mlpstorage" -version = "3.0.46" +version = "4.0.1" description = "MLPerf Storage Benchmark Suite" readme = "README.md" license = {text = "Apache-2.0"} @@ -31,6 +31,7 @@ test = [ "pytest>=7.0", "pytest-cov>=4.0", "pytest-mock>=3.0", + "pytest-xdist>=3.0", ] full = [ "dlio-benchmark", diff --git a/uv.lock b/uv.lock index 1260ae95..c6ba8990 100644 --- a/uv.lock +++ b/uv.lock @@ -288,6 +288,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/cf/8e/2c93805e93e724a90156004a9212572ec86473974deede4605a33b8b169a/elasticsearch-9.4.1-py3-none-any.whl", hash = "sha256:71ab71c3d1b20fd88c2922fb82c3277cce7ea03c160686e7b9368b265c2b4cac", size = 993647, upload-time = "2026-05-26T16:28:36.556Z" }, ] +[[package]] +name = "execnet" +version = "2.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/bf/89/780e11f9588d9e7128a3f87788354c7946a9cbb1401ad38a48c4db9a4f07/execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd", size = 166622, upload-time = "2025-11-12T09:56:37.75Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ab/84/02fc1827e8cdded4aa65baef11296a9bbe595c474f0d6d758af082d849fd/execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec", size = 40708, upload-time = "2025-11-12T09:56:36.333Z" }, +] + [[package]] name = "filelock" version = "3.29.4" @@ -518,7 +527,7 @@ wheels = [ [[package]] name = "mlpstorage" -version = "3.0.46" +version = "4.0.1" source = { editable = "." } dependencies = [ { name = "dlio-benchmark", marker = "sys_platform == 'linux'" }, @@ -542,6 +551,7 @@ test = [ { name = "pytest", marker = "sys_platform == 'linux'" }, { name = "pytest-cov", marker = "sys_platform == 'linux'" }, { name = "pytest-mock", marker = "sys_platform == 'linux'" }, + { name = "pytest-xdist", marker = "sys_platform == 'linux'" }, ] vectordb = [ { name = "elasticsearch", marker = "sys_platform == 'linux'" }, @@ -609,6 +619,7 @@ requires-dist = [ { name = "pytest", marker = "extra == 'test'", specifier = ">=7.0" }, { name = "pytest-cov", marker = "extra == 'test'", specifier = ">=4.0" }, { name = "pytest-mock", marker = "extra == 'test'", specifier = ">=3.0" }, + { name = "pytest-xdist", marker = "extra == 'test'", specifier = ">=3.0" }, { name = "python-dotenv", specifier = ">=1.0.0" }, { name = "pyyaml", specifier = ">=6.0" }, { name = "pyyaml", marker = "extra == 'vectordb'", specifier = ">=6.0" }, @@ -1138,6 +1149,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/5a/cc/06253936f4a7fa2e0f48dfe6d851d9c56df896a9ab09ac019d70b760619c/pytest_mock-3.15.1-py3-none-any.whl", hash = "sha256:0a25e2eb88fe5168d535041d09a4529a188176ae608a6d249ee65abc0949630d", size = 10095, upload-time = "2025-09-16T16:37:25.734Z" }, ] +[[package]] +name = "pytest-xdist" +version = "3.8.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "execnet", marker = "sys_platform == 'linux'" }, + { name = "pytest", marker = "sys_platform == 'linux'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/78/b4/439b179d1ff526791eb921115fca8e44e596a13efeda518b9d845a619450/pytest_xdist-3.8.0.tar.gz", hash = "sha256:7e578125ec9bc6050861aa93f2d59f1d8d085595d6551c2c90b6f4fad8d3a9f1", size = 88069, upload-time = "2025-07-01T13:30:59.346Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ca/31/d4e37e9e550c2b92a9cbc2e4d0b7420a27224968580b5a447f420847c975/pytest_xdist-3.8.0-py3-none-any.whl", hash = "sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88", size = 46396, upload-time = "2025-07-01T13:30:56.632Z" }, +] + [[package]] name = "python-dateutil" version = "2.9.0.post0"