trnsparse 0.3.1 — NKI 0.3.0 namespace + simulator dispatch
Clears `[Unreleased]` with the three-commit trnsparse#23 landing. No kernel-body changes; no public API changes; no numeric drift. Upgrade is safe for anyone already on v0.3.0.
Changed
- Migrated NKI imports to the
nki.*namespace (NKI 0.3.0 Stable, Neuron SDK 2.29, April 2026). Legacyneuronxcc.nki.*shim is no longer used.pyproject.toml[neuron]extra gainsnki>=0.3.0alongsideneuronxcc>=2.24andtorch-neuronx>=2.9. Hosts without annkiwheel (macOS, non-Linux archs) still hitHAS_NKI=Falseand get the torch fallback. testCI job now filters-m "not neuron and not nki_simulator"so each test runs in exactly one job.
Added
TRNSPARSE_USE_SIMULATOR=1dispatch branch throughnki.simulate(kernel)(np_args). Bypasses torch_xla + NEFF compile; kernels run on CPU for correctness iteration. Hardware still owns perf numbers.nki-simulatorCI job onubuntu-latest— installsnki>=0.3.0from the AWS pip index, runs the simulator suite on every push/PR. Kernel correctness gate without AWS cost. Catches Python-trace-level errors (bad kwargs, dropped ops, shape mismatches); MLIR verifier errors remain hardware-only.tests/test_nki_sim.py— curated simulator suite (4 tests: CSR aligned + rectangular, BSR block-dense + block-diagonal). Skips cleanly off-hardware.scripts/run_simulator_tests.sh— SSM runner for the simulator suite on trn1.tests/conftest.py— registers thenki_simulatorpytest marker.
Validation
- 37 CPU tests pass unchanged.
- 15 hardware tests on trn1.2xlarge — all green post-migration (60s).
- 4 simulator tests green on both trn1 and ubuntu-latest.
Closes #23.