Repository navigation
Releases
v1.1.0-rc.2
Added
- A release pipeline.
release.ymlturns avX.Y.Ztag into published artifacts:
it callswheels.ymlfor the build, verifies every wheel carries the tag's version,
then publishes to PyPI via trusted publishing (OIDC — no stored token), attaches
wheels + SBOMs +SHA256SUMSto a GitHub Release, and attests build provenance. A
crates.io job is wired but dormant untilCARGO_REGISTRY_TOKENis set. Before this,
the repo had 39 tags and 0 Releases, and every publish was a human with a token.
One-time PyPI publisher setup is inSUPPORT.md.
Changed
- MSRV raised to 1.96, and it is now a policy rather than a constant.
rust-versionwas
1.89— the version where AVX-512 intrinsics stabilised, i.e. a hard lower bound
inherited as if it were a target. The floor now follows latest stable minus two
releases, reviewed each release, never below 1.89 (seeSUPPORT.md). This is
independent ofrust-toolchain.toml, which pins the toolchain CI builds with.
Release-candidate mapping.
1.1.0-rc.0is published on crates.io for all 23
crates, andv1.1.0-rc.1is tagged. Both were cut from this section rather than
from dated1.1.0-rc.*headings, so there is no separate entry to read for them —
everything below is what shipped in those candidates. The next non-RC release
promotes this section to a dated## [1.1.0]heading.
Changed
- Transactional WebGPU cancellation: resident training now carries each
operation'sAbortSignalthrough GPU submission. Optimizer kernels retain
their existing candidate owners, but signalled execution defers explicit
root-owner commit copies until submitted compute finishes uncancelled.
Cancellation after compute submission therefore returns a recoverable
failure without changing parameters or optimizer state; retry remains valid.
Calls without a signal keep the one-command-buffer fast path. - Compiled autocast parity:
tritium.torch.ternary_linearnow makes its
selective CPU/CUDA autocast casts visible totorch.compile. Compiled CUDA
graphs preserve the fp32 master weight for resident native kernels while
casting only activation-facing tensors to fp16, matching eager execution
instead of silently falling back to fp32 composite projection. Compiled
first-order backward uses an opaque dispatcher VJP boundary so native packed
caches remain available without tracing storage pointers through fake tensors. - Python distribution rename: install release candidates with
pip install pytritium; the import namespace remainsimport tritium.
This aligns packaging with ADR 0033 and avoids claiming the generictritium
distribution name. The Rust workspace and wheel now share the
1.1.0-rc.1candidate version (rendered as PEP 4401.1.0rc1in wheel
metadata). - Stable API baseline:
scripts/check-semver.shnow compares the seven
frozen Rust crates with the latest reachable stable SemVer tag (v1.0.0for
this candidate), replacing the obsolete pre-freezev0.5.*default. See the
v1.0 → v1.1 migration guide.
Added
-
Source-bound Stage-7 PyTorch data:
Stage7TokenEvidencePacknow exposes
strict, same-handle token-pack admission to thepytritiumwheel without
expanding token payloads into Python scalar lists.Stage7CausalData.open
selects a bounded partition window, terminally rehashes the retained payload
handle, records both ordered-member and raw-token identities, and yields
replayable causal-LM batches. This is the production input boundary for the
SmolLM2-135M smoke and 1.7B recipe driver; it does not claim capture, fitting,
package, quality, or Stage-7 completion by itself. -
Executable Stage-7 135M smoke:
run_stage7_smoke_modelnow performs and
strictly resumes capture, additive PTQ fitting, explicit allocation, native
SALT V2 packaging, and causal evaluation from terminally validated token
evidence.run_stage7_smollm2_smokeadditionally binds the exact frozen
SmolLM2-135M source, tokenizer, 128-sequence C4 prefix, complete rank-2 tensor
inventory, and qualifier-compatible execution/artifact receipts. SALT V2
packages remain byte-identical version 1 for G128-only tensors; tensors whose
row geometry requires G64 use canonical version 2 with an explicit scale
geometry byte. Eager and seek-backed readers, streamed writing, CPU, compact
host, physical CUDA exact/gather, and packed ONNX kernels have G64 parity
coverage. This engineering path does not claim recipe quality, Stage-7
qualification, or G64 campaign promotion; those still require frozen physical
evidence and matched-quality gates. -
Governed Stage-7 recipe freeze:
scripts/qualify-stage7-recipe-freeze.pyvalidates the immutable
SmolLM2-1.7B campaign inventory, disjoint calibration/evaluation provenance,
successive-halving promotions, matched-byte output-aware curvature win,
R3 gap closure, task retention, physical/native prerequisite receipts, and
scale-only/short-PV token caps. It derives exact rank-2 matrix inventory from
pinned safetensors, strictly reopens every SALT V2 package through the native
parser, binds four disjoint revision/seed/tokenizer/token-stream partitions,
complete relay/window policy, source-complete S2KF sensitivity lineage, and
HESTIA gradcheck plus portable-v3 CPU/CUDA conformance. It records soft-method
wins, ties, losses, or tradeoffs, binds each reported refinement metric to its
exact evaluated hard-checkpoint artifact, and emits either a content-bound
recipe/checkpoint freeze or terminal negative result for valid missing-rate,
physical, native, or quality-gate failures. Malformed, contradictory,
cherry-picked, or hash-consistent non-package traces fail closed.
Stage-7 data admission now reopens a canonical 16 MiBu32letoken payload,
verifies all 2,048 per-sequence spans against exact source-row provenance and
the shared SmolLM tokenizer identity, rejects duplicate samples, and freezes
the official C4/OpenWebMath/StarCoderData revisions. The new
tritium salt build-stage7-evidence-packcommand converts content-bound,
preselected source rows into that cross-language manifest transactionally.
tritium salt inspect-stage7-evidence-packthen binds that pack to the
campaign-frozen pack ID and exact model tokenizer, validates all manifest and
payload semantics through a retained seek-backed handle, reads one bounded
partition window, and emits its ordered token digest for model execution.
StarCoder provenance distinguishes configdefault,data_dir=python, and
source fieldcontent; fixed token geometry is rejected before bounded read. -
QAT-hard convolution artifacts:
TernaryConv1dandTernaryConv2d
now hard-convert into inference-only composite reference modules backed by
additive packed storage, preserve shared/grouped convolution and padding
semantics, and export/reload through QAT-hard artifact schema v2. Typed
per-consumer contracts bind complete module geometry and reject same-size
shell substitutions. Complete tensor-alias ledgers include persistent
buffers; transactional reload cannot mutate a supplied shell on failure;
shared state remains tied across whole-model dtype/device moves. Native
no-dense-shadow packed convolution dispatch remains a separate
optimized-runtime gate. -
SALT reconstruction-fidelity report (
tritium report salt-model): loads an fp
(bf16/f16/f32) safetensors master, SALT-quantizes every 2D weight at a sweep of
bits-per-weight budgets, and reports whole-model (and optional--per-tensor)
reconstruction error — MSE/RMSE/MAE/max-abs plus relative-Frobenius error and cosine
similarity, the weight-space proxies for output divergence (true output KL is a
forward-pass measurement layered on top, and needs general-architecture model support
not yet present). The arch-agnostic way to see where ternary quantization hurts and
how added bits/sensitivity-allocation recover it. Needs the fp master — an
already-quantized checkpoint (EXL3/GGUF-Qx) carries no fp reference and won't parse as
fp here. -
tritium_quantize::{ReconStats, ReconAccum, reconstruction_stats, ReconError}—
the reconstruction metric, with aReconAccumof raw moments that folds tensors and
reduces to a true whole-model statistic (frob_rel/cosine are ratios of summed
moments, not averages of per-tensor ratios). Purely additive (semver-minor). -
--sensitivity {uniform,energy}ontritium quantize(previously hardcoded
Uniform) — exposes SALT's plane-allocation sensitivity on the model-quantize path,
matchingtritium report salt. (Note:energy≈uniformwhenever reconstruction
error tracks weight magnitude; a meaningfully different allocation needs a true
loss-sensitivity signal viaSensitivity::Custom.) -
Sharded + streaming model loading for
report salt-model: accepts a single
.safetensors, a*.safetensors.index.json(readsweight_map), or a directory, and
mmaps each shard so a 50GB+ master (e.g. a 27B bf16) is paged in per-tensor rather
than read fully into RAM. Each shard is mapped once; shard + tensor order is
deterministic. -
Parallel
report salt-model: the (independent) 2D tensors are quantized on a
bounded worker pool (min(cores, 12)), turning a 27B sweep from ~an hour into minutes.
Output is bit-identical to the sequential path — an indexedpar_iter().collect()
preserves tensor order, so the global moments fold in the same sequence.
Full changelog: CHANGELOG.md
v1.1.0-rc.1
Release candidate for the 1.1 line. Pre-release: the frozen API tier from 1.0.0 still holds, but 1.1 surfaces are not yet stable.
This tag is a source milestone. No binaries are attached to it, deliberately — the artifacts currently on PyPI and crates.io for the 1.1.0-rc line were built from the release branch rather than from this exact commit, so attaching them here would overstate their provenance. Tag-built, attested artifacts land with the release pipeline.
Where the RC line is published
| registry | package | version |
|---|---|---|
| crates.io | 23 crates (tritium-core, tritium-cli, …) |
1.1.0-rc.0 |
| PyPI | tritium-torch — Linux x86_64, macOS arm64, Windows x64 (abi3, CPython 3.9–3.14) |
1.1.0rc1 |
pip install tritium-torch
cargo add tritium-core --version 1.1.0-rc.0
See CHANGELOG.md for the running 1.x notes.
v1.0.0 — first stable release
First stable release of Tritium.
cargo add tritium-core # 23 crates published at 1.0.0
First stable release. The v1.0 Definition of Done (ADR 0012) is met: the public API and C ABI are frozen
(tiered — see below), the real-model GPU capstone is proven on real hardware, and every prior milestone
gate (v0.10→v0.90) re-runs green on this commit.
Frozen-API ergonomics pass (pre-publish polish)
Before locking the frozen tier, a final ergonomics audit + refactor (the last cheap moment for breaking
changes — applied while unpublished). Highlights:
- Forward-compat:
#[non_exhaustive]added to every extensible public enum/struct that lacked it —
quantize (Sensitivity,BaseScaleScope,QuantError,AllocError), format (SafeTensorsError,
GgufFile,TensorInfo,FormatError::SafeTensors), testkit (Tolerance,ConformanceVector),
ffi (TritiumStatus, now also#[repr(i32)]). Free now, impossible post-publish. - One-crate authoring:
tritium-testkitandtritium-spec/-runtimere-export the backend trait +
shared types, so a downstream backend author depends on one crate, not three. TernaryBackendshape:mpgemm/mpgemm_with_act_quantnow take anMpGemm<'_>params struct
(kills the transposableact/scales&[f32]footgun); the downcast escape hatchas_any→as_concrete
(no longer clashes withDeviceBuffer::as_any);BackendErrorgainedsource()chaining.- quantize:
QuantConfiglost its lifetime (Sensitivity::Custom(Vec<f64>)) so configs are storable;
ScaleGroup→BaseScaleScope(disambiguated fromcore::ScaleGranularity). - format:
GgufValue::as_i64/as_f64/as_f32/as_bool/as_array;read_safetensorsfree fn mirroring
read_gguf;source()chaining onFormatError. - C ABI (ABI v1):
tritium_generategained a versionedconst TritiumGenerateOptions*(NULL = greedy
default) so sampling/stop-tokens/backend-select can be added later without a new symbol or ABI break;
newtritium_last_error()andtritium_model_load_bytes(); header lengths nowsize_t. - core:
Trit: Ord;DisplayonDType/TernaryFormat;TritError: core::error::Errorunconditionally.
The on-disk conformance JSONL is byte-identical (serde renames), so the frozen-set drift gate stays green.
The evolving tier (tritium-nn/-train/-cuda + interop + -serve) keeps its 1.x breaking-change runway.
Real-model GPU capstone — PROVEN (RTX 4090, sm_89)
Real microsoft/bitnet-b1.58-2B-4T runs correctly end-to-end on the GPU. All five acceptance gates pass:
cuda_perplexity_within_1pct— ours 1.3987 vs transformers ref 1.4028 (rel 2.96e-3)cuda_greedy_matches_transformers— 256/256 tokens token-exactcpu_cuda_parity— identical token IDs over 32 steps, worst logit rel 2.26e-6cuda_batch_decode_matches_single— N=2 batch == single, argmax-identicalqat_heal_gate— layerwise distillation 94.6% convergence (PPL 1.40)
Getting here required fixing two latent CUDA resident-decode bugs (302d059): a shared-memory aliasing bug
in the fused rmsnorm_quant_f32 kernel (the block-wide absmax reduction reused the RMSNorm-output shared
buffer s_x as scratch → clobbered activations → garbage logits, PPL ~10⁵–10⁶) and an unscaled tiled
mpgemm (f_tiled instead of f_tiled_scaled) in the per-layer decode forward. A teeth-proven conformance
gate rmsnorm_quant_bit_matches_host was added (51b041d) so the kernel can't silently regress again.
API / C-ABI freeze (tiered)
v1.0 freezes a stable core under semver; other crates are an evolving tier that may take breaking
changes in 1.x minor releases (rationale + per-crate detail in docs/v1.0-api-freeze-audit.md, ADR 0012):
- Frozen (semver-gated):
tritium-core,-spec,-format,-runtime,-cpu,-quantize,-testkit,
and the C ABI (TRITIUM_ABI_VERSION = 1, cbindgen-drift + C11/C++17 gated). - Evolving (not semver-gated; may break in 1.x minors):
tritium-nn,-train,-cuda, the interop
crates (-candle,-burn,-onnx), and-serve— these track fast-moving upstreams and ongoing
perf/training work.
Gates green on the release commit
cargo fmt --check, cargo clippy --workspace --all-targets -D warnings, the full CPU workspace test
suite, cargo-semver-checks (vs v0.5.10 baseline), and the CPU fresh-env capstone — all green. GPU
validation is fenced (ADR-0011 amendment): CUDA conformance + the real-model capstone above on the
local 4090; Metal (M1) / ROCm (MI300X) / wgpu (4090) parity from prior fenced sessions; the GPU CI lanes
remain dispatchable workflow_dispatch recipes.
Docs
Reproducible quickstart, model zoo (the BitNet 2B4T I2_S→TQ2_0 load path + loader type-id contract), and
benchmark methodology (roofline ceilings + divan microbench + e2e tok/s, with honest fenced-measurement
boundaries) — docs/book/.