Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
32df7c8
fix
willow-ahrens Sep 27, 2026
fde6db2
rename
willow-ahrens Sep 27, 2026
54108de
fix
willow-ahrens Sep 27, 2026
033d2ab
fix
willow-ahrens Sep 27, 2026
a8c7a69
replace
willow-ahrens Sep 27, 2026
3099170
fix
willow-ahrens Sep 27, 2026
3221770
fix
willow-ahrens Sep 27, 2026
f963ec9
Merge branch 'wma/more-tags' of github.com:SparseAutoschedulingBenchm…
willow-ahrens Sep 27, 2026
e7604e0
fix
willow-ahrens Sep 27, 2026
bef5cba
json
Sep 27, 2026
0893113
Merge branch 'wma/more-tags' of github.com:SparseArrayProgrammingSuit…
Sep 27, 2026
c6db270
fix
willow-ahrens Sep 27, 2026
49e3dc8
oops
willow-ahrens Sep 27, 2026
ca43452
fix
willow-ahrens Sep 27, 2026
faedecc
fix
willow-ahrens Sep 27, 2026
df33554
fix
willow-ahrens Sep 27, 2026
d57af28
fix
willow-ahrens Sep 27, 2026
3be8387
fix
willow-ahrens Sep 27, 2026
6e86020
fix
willow-ahrens Sep 27, 2026
a0cbfde
idk
willow-ahrens Sep 27, 2026
6c110cc
Merge branch 'wma/more-tags' of github.com:SparseApplicationBenchmark…
willow-ahrens Sep 27, 2026
81fac09
manifest new
Sep 27, 2026
e5e417b
Merge branch 'wma/more-tags' of github.com:SparseArrayProgrammingSuit…
Sep 27, 2026
1788e41
fial
Sep 27, 2026
8c1c53b
istuf
willow-ahrens Sep 27, 2026
f439bae
add overrides
willow-ahrens Sep 27, 2026
603a14a
fix
willow-ahrens Sep 28, 2026
4736854
fix
willow-ahrens Sep 28, 2026
6c982a0
add log
Sep 28, 2026
f4dffba
fixfix
willow-ahrens Sep 28, 2026
34ca9c9
idk
Sep 28, 2026
b576e90
very sparse
willow-ahrens Sep 28, 2026
7c438e5
fix
Sep 28, 2026
60c81be
fix
willow-ahrens Sep 28, 2026
5b21419
fix
willow-ahrens Sep 28, 2026
553f6ef
stuff
Sep 29, 2026
57f9c8e
Merge branch 'wma/more-tags' of github.com:SparseArrayProgrammingSuit…
Sep 29, 2026
9a855f4
new stats
Sep 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ jobs:
build:
#if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
run: |
poetry run ./bin/run_benchmark.py \
--trace-statistics \
--tag trace \
--tag suite-trace \
--chunk-count 4 \
--chunk-index ${{ matrix.chunk }} \
--timeout 30 \
Expand Down
39 changes: 18 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,13 @@ Datasets represent one run of a benchmark. Generators group similar data-generat

Tags can be applied to datasets, generators, or benchmarks. If a generator or benchmark is tagged, its datasets inherit that tag.

Common suite tags include:
Suites are listed by name in `suites`, and each one becomes a `suite-<name>` tag (for example, the `test` suite is selected with `--tag suite-test`). Common suites include:

- `test`: datasets that run in CI and cover dense/sparse cases, different sizes, and code paths.
- `standard`: canonical datasets in the suite.
- `trace`: datasets whose operation behavior should be traced into `statistics.json`.
- `dynamic`: datasets with random seeds or generated kernels.
- `AI`: AI-generated datasets.

Use ACM CCS XML to describe problem domains. Paste the XML into `concepts`, and SAPS generates lowercase hyphenated topic tags such as `applied-computing`, `physical-sciences-and-engineering`, or `aerospace`.
Use ACM CCS XML to describe problem domains. Paste the XML into `concepts`, and SAPS generates lowercase hyphenated topic tags prefixed with `concept-`, such as `concept-applied-computing`, `concept-physical-sciences-and-engineering`, or `concept-aerospace`.

Every benchmark, generator, and dataset provides `concepts`. Use `"<ccs2012></ccs2012>"` as a stub until you have a classification. You can use the [ACM CCS 2012 generator](https://dl.acm.org/ccs/ccs.cfm), copy its XML output, and paste it in as `concepts`:

Expand All @@ -120,20 +118,19 @@ Manual suite tags are written to `metadata.json` under `suites`. Topic tags gene

These tags describe the general character of a problem, and are generated programatically by running --trace-statistics:

- `high-dimensional`: 5 or more dimensions in a tensor.
- `tensor`: 3 or more dimensions in a tensor.
- `large-query`: 5 or more operands on one line.
- `elementary-ops`: PEMDAS-only.
- `transcendental-ops`: contains sin, cos, pow, exp, or related operations.
- `shape-ops`: reshape, concat, transpose, squeeze, or similar operations.
- `linalg-ops`: contains `xp.linalg` or solver-like operations. `dot` is okay.
- `fancy-ops`: min, max, and, or, shift, or similar operations.
- `index-ops`: contains indexing.
- `nonzero-fill`: uses a fill value other than zero.
- `iterative`: loops over a matrix or repeats until convergence.
- `dense`: exclusively dense problems.
- `hypersparse`: contains hypersparsity, such as `nnz << n` for a dimension.
- `dynamic-sparsity`: sparse-sparse interactions may change the sparsity pattern.
- `feature-high-dimensional`: 5 or more dimensions in a tensor.
- `feature-tensor`: 3 or more dimensions in a tensor.
- `feature-large-query`: 5 or more operands on one line.
- `feature-elementary-ops`: PEMDAS-only.
- `feature-transcendental-ops`: contains sin, cos, pow, exp, or related operations.
- `feature-shape-ops`: reshape, concat, transpose, squeeze, or similar operations.
- `feature-linalg-ops`: contains `xp.linalg` or solver-like operations. `dot` is okay.
- `feature-fancy-ops`: min, max, and, or, shift, or similar operations.
- `feature-index-ops`: contains indexing.
- `feature-nonzero-fill`: uses a fill value other than zero.
- `feature-dense`: exclusively dense problems.
- `feature-hypersparse`: contains hypersparsity, such as `nnz << n` for a dimension.
- `feature-dynamic-sparsity`: sparse-sparse interactions may change the sparsity pattern.

## Freshness

Expand All @@ -147,15 +144,15 @@ SAPS records freshness so generated artifacts can be checked against the code th
Freshness is checked for:

- `metadata.json`: benchmark, generator, and dataset metadata.
- `statistics.json`: trace-derived tags for datasets selected by the `trace` suite.
- `statistics.json`: trace-derived tags for datasets selected by the `suite-trace` tag.
- `manifest.json`: cached dataset digests and freshness records.
- Remote storage: every manifest record must point to an object that exists in the configured backend.

After changing benchmark code, generator code, metadata, dependency imports, or storage behavior, regenerate the affected artifacts:

```bash
poetry run ./bin/generate_metadata.py
poetry run ./bin/run_benchmark.py --trace-statistics --tag trace --timeout 30 --show-stderr
poetry run ./bin/run_benchmark.py --trace-statistics --tag suite-trace --timeout 30 --show-stderr
poetry run ./bin/generate_metadata.py --statistics statistics.json
poetry run ./bin/run_benchmark.py --cache-datasets
```
Expand Down Expand Up @@ -208,7 +205,7 @@ Dataset digests should be content hashes of serialized data. Freshness records b

Tracing runs selected benchmark cases with `frameworks/saps_tagger.py`. The tagger records observed array operations and sparsity-relevant behavior, then writes those derived tags to `statistics.json`.

A dataset is selected for tracing when the benchmark, generator, or dataset has the `trace` suite tag. Use `trace` for representative datasets that should describe the benchmark's operation mix. Avoid tracing huge datasets unless their scale is necessary for the behavior being observed.
A dataset is selected for tracing when the benchmark, generator, or dataset is in the `trace` suite (tagged `suite-trace`). Use `trace` for representative datasets that should describe the benchmark's operation mix. Avoid tracing huge datasets unless their scale is necessary for the behavior being observed.

Tracing should not change the semantics of a benchmark. It is a metadata pass over selected benchmark executions.

Expand Down
41 changes: 28 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ poetry run ./bin/run_benchmark.py

Useful runner options:

- `--tag test`: run datasets tagged for CI-sized correctness/performance checks.
- `--tag standard`: run canonical suite datasets.
- `--tag suite-test`: run datasets tagged for CI-sized correctness/performance checks.
- `--tag suite-standard`: run canonical suite datasets.
- `--re REGEX`: include benchmark, generator, or dataset names matching a regex.
- `--no-re REGEX`: exclude matching benchmark, generator, or dataset names.
- `--metrics time peakmem`: collect one or both metrics.
Expand All @@ -40,8 +40,8 @@ Useful runner options:
For example:

```bash
poetry run ./bin/run_benchmark.py --tag test --quick --timeout 30
poetry run ./bin/run_benchmark.py --tag standard --metrics time peakmem
poetry run ./bin/run_benchmark.py --tag suite-test --quick --timeout 30
poetry run ./bin/run_benchmark.py --tag suite-standard --metrics time peakmem
poetry run ./bin/run_benchmark.py --re bfs --no-re toy
```

Expand All @@ -68,10 +68,24 @@ SAPS_COMPETITION_ARGS="--metrics time peakmem" \
```

Slurm stdout and stderr logs go to the directory where you submit the job:
`competition-%A_%a.log`, `upload-%j.log`, `trace-%A_%a.log`, or
`competition-%A_%a.log`, `upload-%A_%a.log`, `trace-%A_%a.log`, or
`finalize-metadata-%j.log`. The refresh launcher (`scripts/submit-refresh-jobs.sh`)
also preserves the directory where you invoked it for all three jobs' logs.
You can submit the Slurm scripts from the repository root or any subdirectory.
also preserves the directory where you invoked it for all three (or four, with
`--with-competition`) jobs' logs. You can submit the Slurm scripts from the
repository root or any subdirectory.

Dataset uploads run as an eight-task array. Set `SAPS_UPLOAD_CHUNK_COUNT` when
using the refresh launcher to change the number of upload tasks. Tracing waits
for every upload task to succeed.

Pass `--with-competition` to `scripts/submit-refresh-jobs.sh` to also submit a
competition run once the upload/trace/merge chain finishes successfully
(`sbatch --dependency=afterok:<merge job>`), instead of submitting
`scripts/run-competition.slurm` separately:

```bash
scripts/submit-refresh-jobs.sh --with-competition
```

The competition script emails `ahrens@gatech.edu` when the array finishes or
fails. Notifications cover the whole array. Override the recipient at submission
Expand Down Expand Up @@ -371,14 +385,15 @@ To benchmark your own sparse framework, create a Python file that defines an `xp
Then run:

```bash
poetry run ./bin/run_benchmark.py --config saps.conf.json --tag test --quick
poetry run ./bin/run_benchmark.py --config saps.conf.json --tag suite-test --quick
```

A framework wrapper is responsible for:

- `from_binsparse(array)`: convert SAPS `BinsparseFormat` inputs into framework arrays.
- `to_binsparse(array)`: convert framework outputs back into `BinsparseFormat`.
- `compute(array)` and `lazy(array)`: force or preserve evaluation as appropriate for the framework.
- `replace(arr, old, new)`: return an array with matching values replaced, including implicit sparse values; NaN matches NaN. Leave the input unchanged.
- `einsum(...)` and Array API operations used by benchmarks.
- `__getattr__`: commonly used to forward Array API calls to the wrapped module.

Expand All @@ -393,13 +408,13 @@ poetry run pytest
```

Correctness checks run only in `--check-suite` mode. Normal timing and tracing runs skip checks, even
when selecting `--tag test`.
when selecting `--tag suite-test`.

For a quick runner smoke test over CI-sized datasets:

```bash
poetry run ./bin/run_benchmark.py \
--tag test \
--tag suite-test \
--check-suite \
--metrics time \
--quick \
Expand All @@ -409,7 +424,7 @@ poetry run ./bin/run_benchmark.py \
Freshness tests check that generated artifacts still match the source code and metadata in the repository:

- `metadata.json` matches benchmark, generator, and dataset metadata.
- `statistics.json` contains current trace-derived tags for datasets selected by the `trace` tag.
- `statistics.json` contains current trace-derived tags for datasets selected by the `suite-trace` tag.
- `manifest.json` records current dataset freshness.
- Every concrete generator is reachable through a benchmark, including shell benchmarks for intentionally standalone generators.
- Every manifest record points to a dataset object that exists in the configured remote storage backend.
Expand Down Expand Up @@ -460,12 +475,12 @@ Trace statistics are generated by running selected benchmarks with the tagger fr
```bash
poetry run ./bin/run_benchmark.py \
--trace-statistics \
--tag trace \
--tag suite-trace \
--timeout 30 \
--show-stderr
```

Datasets get traced when their generated metadata has the `trace` tag. Tracing executes the benchmark with `frameworks/saps_tagger.py`, records which array operations and sparsity-relevant behaviors were observed, and writes those derived tags to `statistics.json`. Fold fresh trace-derived tags into `metadata.json` with:
Datasets get traced when their generated metadata has the `suite-trace` tag. Tracing executes the benchmark with `frameworks/saps_tagger.py`, records which array operations and sparsity-relevant behaviors were observed, and writes those derived tags with a `feature-` prefix to `statistics.json`. Fold fresh trace-derived tags into `metadata.json` with:

```bash
poetry run ./bin/generate_metadata.py --statistics statistics.json
Expand Down
13 changes: 12 additions & 1 deletion bin/run_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,12 +807,23 @@ def needs_caching(
def in_chunk(
_benchmark: dict,
_generator: dict,
_dataset: dict,
dataset: dict,
dataset_number: int,
) -> bool:
if args.cache_datasets:
# Other upload workers can make entries fresh before we start.
# Assign by cache key so filtering those entries cannot shift chunks.
dataset_number = int.from_bytes(
hashlib.sha256(dataset["asv_param"].encode()).digest()[:8], "big"
)
return dataset_number % args.chunk_count == args.chunk_index

metadata = _filter_metadata(metadata, in_chunk)
chunk_kept = sum(
len(generator["datasets"])
for benchmark in metadata
for generator in benchmark["generators"]
)

benchmarks = _metadata_to_asv_benchmarks(metadata, benchmarks, benchmark_metrics)
if args.cache_datasets:
Expand Down
20 changes: 18 additions & 2 deletions competition.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"//": "Competition config using ASV-native include entries. Each include is one competitor environment with its own dependencies.",
"environment_type": "virtualenv",
"install_command": ["in-dir={env_dir} python -mpip install {build_dir}"],
"timeout": 60,
"timeout": 120,
"rounds": 1,
"resume": true,
"metrics": ["time"],
"tag": ["standard"],
"tag": ["suite-standard"],
"saps_dir": "competition/run_local/task_0",
"env_dir": "competition/run_local/task_0/env",
"results_dir": "competition/run_local/task_0/results",
Expand Down Expand Up @@ -67,6 +67,22 @@
"SAPS_REPO_ROOT": "."
}
},
{
"python": "3.12",
"req": {
"array-api-compat": "1.15.0",
"lark": "1.3.1",
"networkx": "3.6",
"numpy": "2.3",
"scipy": "1.17.1",
"sparse": "0.17.0",
"ssgetpy": "1.0rc2"
},
"env_nobuild": {
"SAPS_FRAMEWORK": "frameworks/saps_smart.py",
"SAPS_REPO_ROOT": "."
}
},
{
"python": "3.12",
"req": {
Expand Down
Empty file.
Loading
Loading