Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ CANDIDATE ?= fused_index_topk
RUN_ID ?= itk-manual
EVAL_RUN_ID ?= h20-eval-$(shell date -u +%Y%m%dT%H%M%SZ)
MODE ?= screening
ARTIFACT_ROOT ?= /data/$(USER)/artifacts
RUNTIME_ROOT ?= /data/$(USER)
ARTIFACT_ROOT ?= $(RUNTIME_ROOT)/artifacts
CORRECTNESS ?= $(ARTIFACT_ROOT)/raw/$(RUN_ID)/$(VARIANT)/correctness.json
BENCHMARK ?= $(ARTIFACT_ROOT)/raw/$(RUN_ID)/$(VARIANT)/benchmark.json

.PHONY: test lint variants setup-h20 check bench evaluate nsys ncu
.PHONY: test lint variants setup-h20 check bench evaluate nsys ncu reproduce-smoke

test:
$(PYTHON) -m pytest
Expand Down Expand Up @@ -37,3 +38,6 @@ nsys:

ncu:
scripts/profile_ncu.sh --config $(CONFIG) --variant $(VARIANT) --target-length 16384 --stage indexer --run-id $(RUN_ID) --correctness $(CORRECTNESS) --output-root $(ARTIFACT_ROOT)/profiles

reproduce-smoke:
ITK_RUNTIME_ROOT=$(RUNTIME_ROOT) scripts/reproduce.sh --level smoke
39 changes: 39 additions & 0 deletions docs/REPRODUCING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# One-command smoke reproduction

The P0 path validates that the frozen H20 environment can be created, the
control plane is healthy, and both the FlashInfer baseline and FusedIndexTopK
candidate are exact on one deterministic short-context case.

On an H20 host, run:

```bash
ITK_RUNTIME_ROOT=/data/$USER ./scripts/reproduce.sh --level smoke
```

The command performs a hardware/toolchain preflight, runs
`scripts/setup_h20.sh`, executes Ruff and the unit tests, discovers configured
variants, and runs correctness at `Q=4096, N=6144`. It stops at the first failed
gate and never starts correctness after a failed setup or test stage.

Artifacts are written beneath:

```text
$ITK_RUNTIME_ROOT/artifacts/reproductions/<run-id>/
preflight.json
smoke-config.json
correctness/<variant>/correctness.json
logs/
report.json
REPORT.md
```

To reuse an already-created runtime (for example, on an offline machine), add
`--skip-setup`. Every run ID is immutable; choose a new `--run-id` to rerun.

This is a code/smoke reproduction gate, not a reproduction of the published
held-out replay performance numbers. Those numbers require the private replay
manifest and tensors described in [METHODOLOGY.md](METHODOLOGY.md).

On a CPU-only development machine the command is expected to fail at
preflight, but it still writes a diagnostic `preflight.json` and `REPORT.md`.
Use `make lint` and `make test` for the CPU-only control-plane checks.
6 changes: 6 additions & 0 deletions scripts/reproduce.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail

project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
export PYTHONPATH="${project_root}/src${PYTHONPATH:+:${PYTHONPATH}}"
exec python3 -m index_topk_perflab.reproduction "$@"
Loading
Loading