Repository navigation
Benchmark Infrastructure
Эта страница перенесена из документации репозитория, чтобы справочные материалы по методам, экспериментам и бенчмаркам жили в wiki, а не в кодовой ветке.
This document is the development contract for benchmark code, experiment entrypoints, result artifacts, and public comparison tables.
Use it when adding a new benchmark direction, changing Kernel Learning
experiments, or updating benchmark/results.
The canonical benchmark runtime package is:
benchmark.industrialNew benchmark code must import from benchmark.industrial or from a thematic
package below it. Do not add compatibility imports for removed versioned
packages. Historical result folders such as benchmark/results/v2_kernel_learning
can be used as data sources, but they are not runtime packages.
The current package layout is:
benchmark/industrial/
datasets/ dataset discovery and local split loading
evaluation/ metrics, result analysis, aggregation helpers, markdown
experiments/ manifests, persistence, registries, presets, progress
legacy/ old wrappers that delegate to the canonical runtime
models/ model specs and adapter factories
visualization/ reusable plotting helpers
api.py public suite helpers
classification.py
regression.py
forecasting.py
core.py typed benchmark contracts
cli.py
Implementation should live next to the thematic public entrypoint. A package
__init__.py may expose a short public index, but it should not become the only
place that gathers implementations from unrelated modules.
All suite-style benchmark runs should converge to:
typed_config.build_suite_config() -> run_registered_suite(...)The shared runtime types live in benchmark.industrial.core:
BenchmarkSuiteConfigDatasetSpecModelSpecRunSpecArtifactSpecTaskType
Shell scripts may parse CLI arguments or environment variables, but they should normalize those inputs into typed config objects before the run starts. The runner should not spread defaults across several scripts.
Data-like defaults belong in JSON files next to the thematic package when that keeps implementation code smaller and easier to review. Use this for model lists, metrics, dataset ids, run metadata, and output templates. Implementation modules should load, validate, normalize, and convert JSON payloads into typed records.
Current defaults and manifest entrypoints:
benchmark/experiments/kernel_learning/defaults.json
benchmark/industrial/experiments/preset_defaults.json
benchmark/industrial/examples/*_manifest.json
benchmark/results/showcase/showcase_manifest.json
Manifest-driven runs should use:
from benchmark.industrial.experiments.manifests import build_suite_config_from_manifestand registry-backed runs should use:
from benchmark.industrial.experiments.registry import run_registered_suiteExperiment runners are grouped by task or use case. The current Kernel Learning layout is the reference structure:
benchmark/experiments/kernel_learning/
classification/
run_ucr.py
run_ucr_two_stage.py
regression/
run_tser.py
forecasting/
run_m4.py
analysis/
analyze_stage1.py
configs.py
controls.py
defaults.json
Rules for new runners:
- Put the executable script in the task package.
- Keep it thin: parse user input, build a typed config, call shared runtime.
- Reuse
benchmark.industrial.experimentsfor persistence, progress, registry entries, and resolved configs. - Reuse
benchmark.industrial.evaluationandbenchmark.industrial.visualizationfor aggregation and plots. - Do not write result files from ad-hoc helpers when a shared writer already exists.
benchmark/results has three different responsibilities. Keep them separate.
benchmark/results/
kernel_learning/ current resumable run artifacts
v2_kernel_learning/ historical Kernel Learning reference artifacts
showcase/ canonical comparison tables and report packs
server_results/ historical raw artifacts, archive candidate
ts_* historical raw artifacts, archive candidates
The canonical result entrypoint is:
python -m benchmark.results.showcaseThe showcase reads benchmark/results/showcase/showcase_manifest.json and
builds:
benchmark/results/showcase/
README.md
showcase_manifest.resolved.json
tables/
source_inventory.csv
benchmark_overview.csv
current_best_per_dataset.csv
archive_candidates.csv
<benchmark_group>/
summary.md
tables/
plots/
Use these tables first:
-
tables/benchmark_overview.csvfor coverage by benchmark direction. -
tables/source_inventory.csvfor source provenance and archive status. -
tables/current_best_per_dataset.csvfor the best current Industrial result per dataset.
Raw run folders, checkpoints, logs, and historical fitted pipelines must not be mixed into public comparison tables directly. If they are needed for a report, add them to the showcase manifest as sources or archive candidates.
Benchmark tables and example artifacts are maintained assets, not one-off local files. Every public manifest should state who owns it, when it was last refreshed, and which command rebuilds it.
| Asset | Owner | Refresh cadence | Refresh command | Escalation path |
|---|---|---|---|---|
benchmark/results/showcase/showcase_manifest.json |
IndustrialTS benchmark maintainers | before each merge that changes benchmark results; otherwise quarterly | python -m benchmark.results.showcase |
update the manifest or mark the comparison scope explicitly |
examples/artifacts/artifact_catalog.json |
IndustrialTS benchmark maintainers | before each merge that changes examples or report artifacts | python -m examples.artifacts |
move oversized/raw payloads to the external archive and keep only manifests in git |
examples/real_world_examples/external_data_manifest.json |
IndustrialTS benchmark maintainers | whenever the public archive layout changes | manual archive verification against expected_path entries |
update the Yandex Disk archive link and per-source subfolders |
benchmark/results/kernel_learning/* |
experiment owner for the current KL run | after full-run reruns or resumed benchmark batches | task-specific runner under benchmark/experiments/kernel_learning
|
keep failed/skipped records visible with status and reason |
Post-merge refresh checklist:
- Run
python -m benchmark.results.showcaseafter changing benchmark result sources. - Run
python -m examples.artifactsafter changing example artifacts or cloud bundle contents. - Check
benchmark/results/showcase/tables/source_inventory.csvfor missing files. - Check
benchmark/results/showcase/tables/benchmark_overview.csvfor unexpected coverage drops. - Confirm that external local data is described in
examples/real_world_examples/external_data_manifest.json, not committed as raw payload.
Artifact size policy:
- Commit lightweight report files only:
.md,.csv,.json,.png,.jpg,.jpeg,.svg, and reviewed.ipynbfiles. - Keep a single committed generated artifact under 5 MB unless there is an explicit review reason.
- Keep the committed
examples/artifacts/cloud_bundleunder 100 MB; larger raw data, archives, checkpoints, and full run folders belong in the external archive.
Registered suite runs should persist enough information to rebuild aggregate tables without rerunning training:
benchmark/results/<family>/<suite>/<run_id>/
records/
runs.jsonl
metrics.jsonl
predictions.jsonl
kernel_diagnostics.jsonl optional Kernel Learning artifact
kernel_selection.jsonl optional Kernel Learning artifact
aggregate/
runs.csv
metrics.csv
predictions.csv
leaderboard.csv
run_metadata.json
summary.md
resolved_config.json
resolved_manifest.json
run_summary.json
artifact_manifest.json
Task-specific additions are allowed, but the shared files above are the stable contract for aggregation and showcase generation.
The canonical aggregation layer is:
benchmark.industrial.evaluation.aggregationUse it when a runner or notebook needs to rebuild reference-style
aggregate/* artifacts from saved records/* files. The public entrypoints
are:
-
resolve_task_aggregation_rulefor task-specific metric direction, grouping, count column, and prediction index rules; -
load_benchmark_artifact_framesfor loadingruns,metrics,predictions,errors, and optional Kernel Learning diagnostics; -
build_benchmark_aggregate_tablesfor deterministic in-memory aggregate tables; -
render_benchmark_aggregate_artifactsfor writingleaderboard.csv,metrics.csv,predictions.csv,runs.csv,run_metadata.json,summary.md, andartifact_manifest.json.
Use benchmark.industrial.evaluation.result_analysis for result ingestion and
comparison logic:
load_result_sourcesnormalize_result_tablebuild_best_per_dataset_framebuild_mean_rank_framebuild_topk_summary_framebuild_source_delta_framebuild_model_diagnostics_frame
Use benchmark.industrial.visualization.benchmark_results for report packs:
from benchmark.industrial.visualization.benchmark_results import (
render_benchmark_result_analysis_pack,
)Metric direction must be explicit for each benchmark direction:
- classification: usually
accuracy,higher; - regression: usually
rmse,lower; - forecasting: usually
mae,lower, or the task-specific public metric.
Failed and skipped runs should stay in run records with a status and reason. Canonical comparison tables should use successful metric rows only unless the report explicitly analyses failures.
Kernel Learning is the first reference benchmark pipeline for this infrastructure.
Typed config builders live in:
benchmark.experiments.kernel_learning.configsTask entrypoints:
benchmark/experiments/kernel_learning/classification/run_ucr.py
benchmark/experiments/kernel_learning/classification/run_ucr_two_stage.py
benchmark/experiments/kernel_learning/regression/run_tser.py
benchmark/experiments/kernel_learning/forecasting/run_m4.py
Default model specs, generator sets, metrics, and output templates live in:
benchmark/experiments/kernel_learning/defaults.json
Current full-run artifacts are expected under:
benchmark/results/kernel_learning/
Historical v2 Kernel Learning artifacts remain valid reference inputs under:
benchmark/results/v2_kernel_learning/
Do not import or recreate the old v2 runtime. Treat it as result data only.
Use this checklist for every new benchmark direction.
- Create or reuse a thematic package under
benchmark/industrialfor runtime code. - Add typed config builders or manifest support that returns
BenchmarkSuiteConfig. - Put default model lists, metrics, dataset ids, and output templates in a package-local JSON file when they are table-like data.
- Add a thin runner under
benchmark/experiments/<family>/<task>/. - Make the runner call
run_registered_suiteor another sharedbenchmark.industrialsuite function. - Persist
records,aggregate, resolved config, run summary, and artifact manifest. - Reuse shared aggregation and visualization helpers for final tables and plots.
- Add the result source to
benchmark/results/showcase/showcase_manifest.jsonif it should appear in public comparisons. - Add tests for config normalization, manifest validation, result aggregation, and at least one smoke run or dry-run path.
- Update this document only when the infrastructure contract changes.
- Do not add new ad-hoc
run_*.pyfiles at the repository root or directly underbenchmarkwhen they belong to a task package. - Do not store raw generated outputs inside
benchmark.industrial. - Do not hard-code long model catalogs or dataset lists in implementation files when a JSON defaults file is clearer.
- Do not copy large historical result folders into showcase directories.
- Do not treat
benchmark/results/v2_kernel_learningas a runtime package. - Do not add a large
__init__.pythat hides implementations scattered across unrelated files.
Recommended local checks after benchmark infrastructure changes:
$env:PYTHONPATH=(Get-Location).Path
$env:PYTEST_DISABLE_PLUGIN_AUTOLOAD='1'
& "D:\data_old\WORK\Repo\Industiral\IndustrialTS\venv_3.9_new\Scripts\python.exe" -m pytest -q `
tests/unit/benchmark/test_results_showcase.py `
tests/unit/examples/test_real_world_result_analysis.pyFor Kernel Learning-specific changes, also use:
& "D:\data_old\WORK\Repo\Industiral\IndustrialTS\venv_3.9_new\Scripts\python.exe" -m pytest -q `
tests/unit/core/kernel_learning `
tests/unit/models/test_kernel_learning_experiment_scripts.pyRegenerate the result showcase after updating result sources:
& "D:\data_old\WORK\Repo\Industiral\IndustrialTS\venv_3.9_new\Scripts\python.exe" -m benchmark.results.showcase