Repository navigation
feat(benchmarks): add pysweep, a declarative sweep runner for the ChatQnA benchmark - #207
Draft
kkurzacz-intel wants to merge 11 commits into
Draft
kkurzacz-intel wants to merge 11 commits into
kkurzacz-intel wants to merge 11 commits into
Conversation
kkurzacz-intel
commented
Nov 25, 2026
kkurzacz-intel
commented
Nov 25, 2026
…tQnA benchmark pysweep runs benchmark.py across a declared grid of configurations and records, per run, the configuration that was observed on the deployment, not just the one that was asked for. Each deployment knob is a Property that reads the live value, applies a desired one and verifies it; client knobs are benchmark.py's own options. Deployment combinations are the outer loop (applied and verified once), client combinations the inner loop, and every run adds a row to one summary CSV (knobs, TTFT/TPOT mean and p90). This first part ships the framework with every client knob and one deployment knob, llms.max_new_tokens (Runtime-API plane, through the system_fingerprint API). retriever.k and reranker.top_n follow in a stacked PR; the llms.model swap is designed (DESIGN.md) but not included. - benchmark.py: parse_args(argv) and run_benchmark() split out of main(), so pysweep can run one load test per combination in-process. Running it as a script is unchanged. - The benchmark's tokenizer (-m) is derived from the model the pipeline is observed to serve, mapped to its HF repo id through the model catalog (models-rag.yaml first, then models.yaml). - Keycloak user tokens are minted per worker and re-minted before every run; for the sweep the UI client's access-token lifespan is set to 1h (an arbitrary value that only has to outlast one run) and restored afterwards. - Preflight: question files are checked before anything is applied. - tox env pysweep_unit_tests, now also in the unit-test CI matrix. Ported from intel-innersource/applications.ai.enterprise.ai-erag#143 and adapted to this repo (config.erag.yaml, env lookup from the installer layout instead of /root/ai-solutions). Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
…constants Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
…nd drop extra prose Rename examples/ to configs/ and config.yaml to general.yaml, strip the comments from both YAML files, and remove explanatory docstrings from the package and the max_new_tokens property. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
Drop module docstrings, cut docstrings to one line or remove them where the name says it, and keep only one-line comments for non-obvious constraints. Remove the comments from the pysweep tox env; the --confcutdir reason moves to the README. No code changes. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
Each run is now a record of run metadata, settings (observed deployment knobs and declared client knobs, plus the derived tokenizer) and results (TTFT, TPOT and end-to-end mean/p50/p90/p99, token counts, throughput), logged as YAML when the run finishes. The sweep writes them to results.json under runs, with the sweep date and the commit_info of the checked-out commit, and keeps the summary CSV with the same records as dotted columns. commit_info (sha, committer datetime, author, subject, branch) is read with git and is mandatory: the preflight fails without it, including on a detached HEAD. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
kkurzacz-intel
force-pushed
the
kkurzacz/pysweep-core
branch
from
November 26, 2026 09:45
81e7b61 to
c454d75
Compare
…/ and properties/ Move the modules that talk to the deployment into cluster/ (auth.py, fingerprint.py, served_model.py, model_catalog.py), the ones that record where results come from into provenance/ (commit_info.py, paths.py), and the Property interface next to the knobs in properties/base.py. Only imports change, plus paths.REPO_ROOT counting one more parent directory. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
A new pre_bench section in the sweep config holds what every run shares and is done once, before the first run; it takes single values only and is never part of the product. Its first setting, pre_bench.edp.vector_db.num_vectors, is applied by pre_bench.seed.seed(): it loads the vector DB through EDP until it holds at least that many vectors, first with the documents in documents.csv and then with Simple English Wikipedia split by wikiparse.py, two files at a time, as prepare_1M_vectors.sh does. Unlike the script it skips files EDP already has, checks every download and upload, caches downloads in ~/.cache/pysweep/seed, and fails when the data runs out first. The declared value is recorded in every run as settings.edp.vector_db.num_vectors. pre_bench runs before the summaries directory is cleared, so a failed seed keeps the previous results, and the preflight checks that the seeding inputs exist. configs/sweep.yaml seeds 50000 vectors, as the SPR nightlies do. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
They ask about the pubmed documents pre_bench seeds, as the nightly benchmarks do, so retrieval finds real matches. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
… run settings.edp.vector_db.num_vectors is now the number of vectors EDP holds, read after each deployment combination is applied (once EDP is idle), like the deployment knobs, instead of the declared pre_bench target. The EDP state reader moves from pre_bench/seed.py to cluster/vector_db.py, which seed() and the runner share. With EDP disabled nothing is recorded under settings.edp, and declaring pre_bench.edp.vector_db.num_vectors fails the preflight. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
results.json (schema_version 2) now carries a metadata object with commit_info and hardware, the CPU, memory and OS of the node serving the model: CPU model, sockets, cores, threads and NUMA nodes from /proc/cpuinfo in a model-server pod, vendor, family and AMX from Node Feature Discovery labels, memory and OS from the node object. Only SPR and GNR are recognized; any other CPU raises with the values found. Collection is switched by metadata in general.yaml (default true) and done in the preflight, before pre_bench or any run; when enabled every part is mandatory. With metadata: false the document has no metadata key. The RBAC preflight checks the model-server pods and nodes access. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
…cuments Each download is tried 3 times, 10s apart. A documents.csv entry that still fails is skipped with a warning instead of stopping pre_bench, as prepare_1M_vectors.sh does: Project Gutenberg answers the Intel proxy with HTTP 503, so the three books were never part of the nightlies' data either. The Wikipedia dump is retried but not skipped. Signed-off-by: Kurzacz, Kamil <kamil.kurzacz@intel.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
pysweep: a runner that executes
benchmark.pyacross a declared grid of configurations and records, per run, the configuration the deployment was observed to have, not only the one that was requested.Propertyclasses thatreadthe live value,applya desired one and verify it. This PR ships one,llms.max_new_tokens, on the Runtime-API plane (thesystem_fingerprintAPI).benchmark.py's own options, all required, so no result can silently run on the tool's defaults.run,settings.deployment,settings.client,resultswith TTFT/TPOT/end-to-end mean, p50, p90 and p99, token counts and throughput). It's logged as YAML when the run finishes and collected inresults.jsonunderruns, with the sweepdateandcommit_info(sha, commit datetime, author, subject, branch).benchmark_summary_results.csvkeeps the same records as dotted columns.results.json(schema_version2) groups what the results come from undermetadata:commit_infoandhardware(CPU model, family, topology and AMX of the node serving the model, from/proc/cpuinfoin a model-server pod and Node Feature Discovery labels; memory, OS, kernel). It's switched bymetadataingeneral.yaml(defaulttrue) and collected in the preflight, so a git or hardware problem stops the sweep before anything runs; when enabled every part is mandatory, and only SPR and GNR CPUs are recognized.pre_benchsection holds what every run shares and is done once before the first run (single values, never part of the product). Its first setting,pre_bench.edp.vector_db.num_vectors, seeds the vector DB through EDP: the documents indocuments.csv, then Simple English Wikipedia split bywikiparse.py, asprepare_1M_vectors.shdoes, but skipping files EDP already has, checking every upload and caching downloads. Every run records the vector DB size EDP actually holds assettings.edp.vector_db.num_vectors, read after each deployment combination like the other observed settings;configs/sweep.yamlseeds 50000 and uses the pubmed questions, as the SPR nightlies do.cluster/(auth, fingerprint client, served model, model catalog, vector DB state),provenance/(metadata: commit info, hardware; paths),properties/(thePropertyinterface and the knobs) andpre_bench/.-m) is derived: it's the model the pipeline is observed to serve, mapped to its HF repo id through the model catalog (models-rag.yamlbeforemodels.yaml).benchmark.py:parse_args(argv)andrun_benchmark()are split out ofmain(), so pysweep can run load tests in-process. Running it as a script is unchanged.pysweep_unit_tests, added to the unit-test CI matrix.Docs:
src/tests/e2e/benchmarks/chatqna/pysweep/README.md(how to run) andDESIGN.md(both config planes; the K8s-specllms.modelknob is designed there but not part of this stack).Stack
llms.max_new_tokens.retriever.kandreranker.top_n.Testing
tox -e pysweep_unit_tests: 236 passed.max_new_tokens[64, 128] × concurrency [1, 4]: 4 runs, 0 errors; observed max output tokens 64 and 128.max_new_tokens[64, 128, 512, 1024] × concurrency [12 … 128] ×input_tokens[128, 256], 15 min per run, ~12.5h): 48 runs, 0 errors, no 401s across the token re-mints.benchmark.py --helpstill works standalone.Ported from intel-innersource/applications.ai.enterprise.ai-erag#143 and adapted to this repo (
config.erag.yaml; env lookup derived from the installer layout instead of/root/ai-solutions).