Skip to content
9 changes: 7 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ A complete benchmark contribution includes:
- A benchmark function: the sparse array program being measured.
- One or more generators: deterministic ways to produce inputs for that benchmark.
- Datasets: named generator configurations representing specific benchmark runs.
- Metadata: authors, references, motivation, concepts, suites, and AI disclosure.
- Metadata: authors, references, a description, implementation notes, concepts, suites, AI disclosure, and the data license of each generator, or of a dataset that overrides it. Each benchmark also states its correctness check: how its output is verified, and the optimizations that allows.
- Correctness tests: evidence that the benchmark computes the intended result.
- A rationale: evidence that the problem and selected data are representative or useful.

Expand Down Expand Up @@ -87,7 +87,9 @@ A `Generator` owns the logic for producing related datasets. A `Dataset` is one

Generators should be deterministic. If random data is needed, use fixed seeds and record enough metadata to reproduce the dataset. Large generated datasets should be cacheable through the storage backend unless there is a specific reason to opt out.

Concrete generators must be reachable from a benchmark so metadata, freshness checks, and dataset caching can discover them. If a generator is intentionally standalone data plumbing rather than part of a runnable benchmark, wrap it in a small `ShellBenchmark`: implement only the `generator` property and let the shell expose the generator under a `{generator.name}_shell` benchmark record.
Every generator declares the license of its data in a `license` property, returning a constant from `saps/licenses.py`. A `License` holds an SPDX expression, a `Ref` to where the license was found, the `date_accessed` on which it was read there, whether the terms make the data `redistributable`, and `notes` recording what the source says and any caveats. Data synthesized by SAPS code uses `licenses.SAPS`. For a new external source, find its license on the source's own pages and add a constant; use `AND` when one dataset combines data under several licenses, and `LicenseRef-<name>` for terms with no SPDX identifier. If no license can be found, make the constant `None` and say in a comment where you looked and when. A license file on a repository that only redistributes someone else's data does not count. When some of a generator's datasets come from a differently licensed source, those datasets override the dataset `license` property; it defaults to `INHERIT`, which takes the generator's license, and `Generator.dataset_license(dataset)` gives the license that applies. A `ReferenceGenerator` returns its source generator's license, and a `ReferenceDataset` its wrapped dataset's.

Concrete generators must be reachable from a benchmark so metadata, freshness checks, and dataset caching can discover them. If a generator is intentionally standalone data plumbing rather than part of a runnable benchmark, wrap it in a small `ShellBenchmark`: implement only the `generator` property and let the shell expose the generator under a `{generator.name}_shell` benchmark record. Put the generator in the `shell` suite so `--cache-datasets` prepares its data; reference generators are in it already.

A generator whose inputs come from a cached shell generator stays uncached, so each shared input is stored once. Put its expensive parts, such as reference outputs or a factored preconditioner, in a sibling `ReferenceGenerator` subclass: its `datasets` wrap the generator's own in `ReferenceDataset`, its `generate` returns a `DataInstance` holding only those parts, and the generator's `generate` merges in `XReferenceGenerator().cached_generate(ReferenceDataset(dataset))`. Give the reference generator its own `ShellBenchmark` so dataset caching prepares it.

Expand Down Expand Up @@ -151,8 +153,11 @@ Suites are listed by name in `suites`, and each one becomes a `suite-<name>` tag
- `test`: datasets that run in CI and cover dense/sparse cases, different sizes, and code paths.
- `standard`: canonical datasets in the suite.
- `standard-long`: canonical datasets that take hours each to prepare, such as the GAP graphs. They stay out of `standard`, and `--cache-datasets` skips them unless selected with `--tag suite-standard-long`; references of these datasets join this suite too.
- `shell`: shell and reference generators, whose data other datasets read.
- `trace`: datasets whose operation behavior should be traced into `statistics.json`.

`--cache-datasets` caches and uploads only datasets in `standard`, `standard-long`, `shell` or `test`, counting suites inherited from their generator or benchmark. Tracing and training read cached data, so a dataset in `trace` or `train` must also be in `standard`. To de-list a dataset, for example because its data has no license that allows redistribution, keep it in the code but in none of these suites; a de-listed shell or reference generator returns `[]` from `suites`.

Each benchmark also lists two suites that classify it, one by application and one by computational character:

- Application: `graphs`, `counting`, `solvers`, `timestepping`, `data-analytics`, `image-processing`, `machine-learning`, or `quantum`.
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ matrices remain commented out with their original metadata and are not exposed
by SNAP generators.

The OpenML shell caches the feature matrix together with train/test row indices
from a pinned task, repeat, fold, and sample. MNIST uses task 3573 and CIFAR-10 uses
task 167124, both at repeat 0, fold 0, sample 0. ANN generators consume these splits;
from a pinned task, repeat, fold, and sample. MNIST uses task 3573 and Fashion-MNIST uses
task 146825, both at repeat 0, fold 0, sample 0. ANN generators consume these splits;
clustering generators can still consume the complete feature matrix. Refresh old
OpenML caches that contain only the feature matrix with:

Expand All @@ -497,6 +497,10 @@ completed files. Source subdirectories are `suitesparse`, `frostt`,
use `artifacts/lth`. An explicit downloader `data_dir` takes precedence.
These source caches persist independently of job-local environments and `$TMPDIR`.
G-CARE records completed extraction so later loads reuse the extracted files.
So do the Model Counting Competition 2020-2024 archives under `mccomp/zenodo`.
`--cache-datasets` downloads the eight that the listed instances come from,
about 2 GB, or 4 GB on disk once unpacked; `scripts/scan_mccomp_pool.py`, which
lists the instances, reads all 20.


Each finishing task refreshes the combined files with the results saved so far.
Expand Down
11 changes: 11 additions & 0 deletions bin/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
# freshness covers.)
EXIT_STATUS_PREFIX = "saps: exit status "

# --cache-datasets prepares only datasets in these suites, by their own tag or
# one inherited from their generator or benchmark. Shell benchmarks are in the
# shell suite, so the shared data that other datasets read is prepared too. A
# dataset in none of them, such as one de-listed for its license, is never
# cached or uploaded. standard-long stays out unless selected with --tag.
CACHED_SUITE_TAGS = frozenset(
{"suite-standard", "suite-standard-long", "suite-shell", "suite-test"}
)


def report_exit_statuses(spawner):
"""Make an ASV spawner append each failing process's exit status to its output.
Expand Down Expand Up @@ -906,6 +915,8 @@ def needs_caching(
) -> bool:
if not generator["cacheable"]:
return False
if CACHED_SUITE_TAGS.isdisjoint(dataset["tags"]):
return False
manifest_key = dataset["asv_param"]
record = manifest.get(manifest_key)
if manifest_key in selected_cache_params:
Expand Down
Loading
Loading