Releases: defai-digital/axquant
Release list
v1.6.1
Fixed
- Fused expert shape derivation no longer treats an even Qwen expert count
as DeepSeek dualw1+w3gate concat. Multiplicity is taken from
per-index membership in the fused member list (DeepSeek gate still uses
multiplicity 2). fused_expert_moduleskips integratedmtp.*experts, matching
fused_expert_tensor_target, so the quant predicate does not invent
mtp.*.switch_mlp.*modules for byte-preserved MTP sidecars.- HyperConnection / HyperHead learnable
.scalepaths no longer expand to
.scalesaliases (avoids ambiguous converted-tensor binding). - Qwen exact MTP benchmark profile fails closed when the profile contract is
not met (no silent mismatch).
Notes / operators
- Patch over v1.6.0 DeepSeek V4 development convert support. No migration for
existing non-DeepSeek artifacts. - DeepSeek convert still needs an
mlx-lmbuild withdeepseek_v4; packs
remain development evidence only.
v1.6.0
Added
- DeepSeek V4 (
model_type=deepseek_v4) as a development-convertible MoE
family: inspect, plan-manual, and convert on mixed FP4+FP8 Flash sources via
dequant → affine re-pack under the plan predicate. - Experimental 2-bit / 3-bit manual recipes for Flash
(examples/deepseek-v4-experimental-{2,3}bit-v0.1.yaml). - Development model-card product classes for
2bit/3bit(and
*-experimentalvariants).
Changed
- Convert path handles DeepSeek V4 sanitizer renames: HC tensors, shared-expert
w1/w2/w3→ proj names, routerffn.gate.bias→e_score_correction_bias,
FusedSwitchGLU gate+up fuse, and MultiLinearwo_areshape. - Inventory reconstructs logical parameters for FP4 expert bodies packed in
I8/U8 (expert_dtype: fp4); HyperConnection learnable.scaleis not
treated as quant metadata. - Integrated MTP is byte-preserved into
mtp.safetensorswithout MLX expert
fusion; protected-MTP verify allows native source packing (including FP4). - Convert dequants leftover
QuantizedMultiLinearmodules that public
mlx_lm.utils.dequantize_modelskips (DeepSeekattn.wo_a).
Notes / operators
- DeepSeek V4 conversion needs an
mlx-lmbuild that ships
mlx_lm.models.deepseek_v4(not all PyPI 0.31.x wheels). See
docs/compatibility.md. - Published Flash packs are development evidence only (not certified).
2-bit / 3-bit remain experimental; measured BPW is higher than the product
class because of protected tensors and MTP. - No migration step for existing non-DeepSeek artifacts or plans.
v1.5.1
Fixed
- Ext4T layout planner no longer schedules
rename_or_move/
rename_to_canonicalwhen a basename is a name-conflict (same name,
different content) or when another action already claims the destination
path, so executing a plan cannot clobber a distinct package. - Ext4T
preferred_locationclassifiesaxquant/logsandaxquant/scripts
before name heuristics (smoke/tmp/candidate), andhost_localalso
follows the source logs category, so operational log trees stay
non-fleet-synced and non-deleteable. - Ext4T package indexing skips package-root symlinks (and marks a direct
symlink fingerprint incomplete) so content hashing cannot collide with
the real tree and schedule deleting the target while keeping a dangling
link. - Coding-suite and general-holdout overlap now use
axquant-token-5gram-v2(same CJK-aware tokenization as
campaign-overlap), so pure non-ASCII records no longer collapse to
empty strings and false-positive exact matches. Coding suite manifests
must be regenerated. - GPTQ column encoding uses the joint
round(w/s + z)form shared with
AWQ/portable affine (fixes banker's-rounding half-integer disagreements
withround(w/s)+z), and the standalone GPTQ plugin packs codes at
float16 storage scale.
v1.5.0
Changed
- The flagship formal-host identifier is now
df-macbookpro-m5(was
mbp-m5), following the owner's canonical DNS naming for the certification
machine (df-macbookpro-m5.defai.digital, Apple M5 Max MacBook Pro). The
identifier is a schema literal on the formal host contract, host evidence,
preflight, reproduction review, and hardware authorization records; it is
the mandatory certified-claim hardware scope id, the required
hardware-df-macbookpro-m5archive record name, and the exact string
campaign-preflightcompares against the machine's live hostname. No
campaign was ever frozen and no claim was ever rendered under the old id,
so nothing published or bound is invalidated. Documents and audits citing
mbp-m5as the formal host now readdf-macbookpro-m5.
v1.4.1
Fixed
campaign-overlap --id-fieldis now repeatable and tried in order per
record (defaultid, thentask_id), so one overlap run can span
mixed-schema campaign datasets — calibration corpora keyed byid
alongside strictQualityTasksuites keyed bytask_id. Previously a
single id field applied to every file, and no field exists in both
shapes:QualityTask(extra="forbid") rejects an addedid, and the
frozen calibration dataset cannot gain atask_idwithout invalidating
its digest bindings. Reports are unchanged (record ids never leave the
loader), so existing overlap reports stay reproducible.
v1.4.0
Install
Install this release from PyPI: axquant 1.4.0.
Fixed
campaign-overlapnormalization now tokenizes non-ASCII scripts
(axquant-token-5gram-v2): ASCII word runs stay whole tokens and every
other letter (CJK, Kana, Hangul, accented Latin) becomes a
single-character token, so shingles exist for unspaced scripts. The v1
normalizer dropped every non-[a-z0-9_]character, which made any
CJK-only record — including the shipped reference calibration
dataset's multilingual rows — fail closed with "normalizes to empty
text" and blocked flagship campaign freezes. ASCII-only inputs produce
byte-identical reports under v2;CampaignOverlapReportnow records
the v2 algorithm id. The Qwen3-Next coding-suite normalizer is
unchanged.
Changed
- Quantized MTP sidecars now emit AX Engine's executable MLX-packed layout
(mlx-affine-packed-u32):mx.quantizeuint32-packed codes plus BF16 group
scales/biases under the engine's<base>.scales/<base>.biaseskey
convention, each tensor verified by anmx.dequantizeround trip against
the BF16-cast source. This replaces the 1.3.0axquant-portable-affine-u8
format, which no runtime could execute (the capability gate always refused,
so no artifact was ever produced in it). Reading the engine's
mtp_take_weightloader showed the executable contract already exists —
AXQuant now targets it instead of inventing a second layout.
Added
quantize-mtp-sidecar --runtime-jsonstampsmtp_sidecar_bitsinto
mtplx_runtime.json(viaannotate_mtp_runtime_sidecar_bits) so the engine
dequantizes packed projections at the declared width instead of the 4-bit
default; sidecar bits are restricted to the engine runtime contract
(2/4/6/8).- The capability probe records the engine's reported
supported_bitsand
packingwhen present (ax-engine mtp-capabilityoutput), and sidecar
quantization fails closed when the requested bits or emitted packing fall
outside the reported capability. benchmark-kernels --from-ax-engineingests the engine's
ax-engine.kernel-latency-raw.v1document (emitted by the new
axquant-kernel-latency-probemicrobench) into a host-scoped
axquant.kernel-latency.v1table withruntime=ax-engineentries; the
planner's latency provider now infers the runtime from single-runtime
tables, so engine tables plug intoplan --latency-tabledirectly.
Fixed
- Quantized MTP sidecar bits are restricted to {4, 6, 8} — the intersection
of the engine loader's tolerance with AXQuant's ownmtp_sidecar_bits
runtime contract. Previously a 2-bit sidecar could be produced that
AXQuant's inspector and runtime validators would then reject. benchmark-kernels --from-ax-enginerefuses documents reporting packing
methods the toolkit does not recognize instead of silently relabeling them
as affine measurements.annotate_mtp_runtime_sidecar_bits(and--runtime-jsonhelp) now states
that stamping rewrites the file and therefore invalidates any recorded
sha256 binding to the original — stamp packaging copies, not validated
bundles.- KV serving-quality reports reject a boolean
quantized_layers_activein
the execution summary instead of countingtrueas one active layer. - The flagship M7 MTP-admissibility helper guards its own evidence loads
(unreadable files become named gate issues if reached), and a regression
test pins the audit-level contract: a damaged benchmark bundle aborts the
whole audit with a named checksum error rather than emitting gate verdicts
against a tampered evidence set.
v1.3.0
AXQuant v1.3.0
AXQuant 1.3.0 strengthens evidence-led post-training quantization on Apple Silicon. It adds
measured interaction and kernel-latency signals to planning, formalizes MTP A/B admissibility,
and keeps all new performance choices fail-closed when the required evidence is absent.
Highlights
- Measured interaction selection.
refine-select --interactionuses development-role
measurements only and rejects formal-holdout or incomplete dataset provenance. - Kernel-latency-aware planning.
benchmark-kernelsrecords host-scoped decode/prefill
latency, whileplan --latency-tableuses it only to break quality near-ties. Plans without a
table retain their prior deterministic behavior. - Formal MTP evidence. MTP on/off comparisons must bind the same frozen host, controls,
datasets, seeds, checkpoint, and zero-fallback execution before they can authorize a claim. - Opt-in quantized Qwen 3.6 MTP sidecar.
quantize-mtp-sidecarpreserves the existing
byte-preserved default and requires a recorded passing AX Engine capability check before it can
emit the portable-affine sidecar. - Measured KV serving-quality reports. The new report binds an exact executed per-layer KV
plan to short- and long-context retention against BF16 KV.
Safety and compatibility
- Experimental 2/3-bit assignments are limited to robust MLP/expert projections; attention and
protected roles retain 4-bit-or-higher candidates. - Converted-checkpoint verification now accepts only documented MLX output identity transforms
and remains fail-closed on membership, precision, parameter-count, metadata, or shape drift. - Qwen3-ASR and Qwen3-VL paths have stricter normalization, backend, and media-generation smoke
checks. - Existing serialized plans preserve their recorded hardware-profile semantics. Re-plan to opt
into the newax-engine-apple-silicon-affine-dwq-v3defaults andgptq-actmethod.
Installation
Download the wheel below and install it with:
python -m pip install axquant-1.3.0-py3-none-any.whlOr install the immutable tag directly:
python -m pip install "axquant @ git+https://github.com/defai-digital/axquant.git@v1.3.0"Verification
Download SHA256SUMS.txt alongside the wheel or sdist and verify it with:
shasum -a 256 -c SHA256SUMS.txtThe tag points to commit d35b19453f9077e00d0654f2e22de8a257b696fa.
Availability
PyPI publishing remains intentionally gated until the project’s Trusted Publisher is configured.
The release assets below are the canonical v1.3.0 distributions.
For the complete change list, see CHANGELOG.md.
v1.2.0
Added
analyze --capture-points: measured probing on plain dense backbones (MiniCPM5, Qwen3 dense,
Mistral, …) via--capture-points output; the default("output", "hidden")fails closed
with a hint on those layouts.refine --lm-head-floor, matchingplan; the governed8bitpath still requires measured
support.- Structured
mtp_sidecar_bitsruntime contracts in copied (byte-preserved) MTP sidecar
metadata. - New evaluation task categories: JSON, tool-use, multilingual, and long-context.
Changed
- Calibration evidence is checksum-bound end to end: AWQ/GPTQ analysis records the
activation-capture manifest digest, tokenized-cache manifest digest, cache key, and dataset
ID; the planner carries the bindings; conversion rejects a mismatched capture and packages
activation_capture_manifest.jsonwith the checkpoint; publication preparation and release
audit independently revalidate it. - Completed capture directories are immutable (
completion.jsonpresent → no overwrite), and
every committed resume chunk is validated against checkpoint row accounting. scripts/hf_to_mlx_bf16.pyrequires--revision <40-char SHA>, converts into a staging
directory, atomically renames on success, and writesaxquant_source.jsonwith the immutable
source identity.- Mixed-precision plans are labeled by target BPW instead of inheriting a flat storage-class
name.
Fixed
- Qwen3-Next adapter: fused
switch_mlp/switch_glu3-D weights now classify asexpert.
Pre-fix artifacts may have retained most expert weights at BF16 and must be regenerated. - Capture resume now fails closed on binding drift (model, cache,
--max-rows, segments, token
budget) instead of silently mixing runs. - AWQ/GPTQ convert-time refinement no longer crashes on bfloat16 module weights (the default
dtype of real checkpoints). - Affine/DWQ/AWQ quantizers build the per-group grid from the float16-stored scale (rounded
up, never down), restoring the documented ≤ scale/2 per-element round-trip bound. plan/refineinject BF16 for policy-preserved tensors (norms, LM head, vision) when 16 is
omitted from--bits, matching manual planning, instead of failing per tensor; manual
tied-weight harmonization now refreshes scale/outlier strategies and stored BPW.- Feasibility audits require MTP evidence only from MTP-declaring architectures, making the
Qwen3-Next direct-track N0 gate satisfiable with tool-produced reports. - Measured probe/KV-probe runs no longer abort when the calibration token count leaves a
single-token trailing replay batch. - The
kv-execruntime check now fails when executed per-layer KV bits differ from the plan
(previously reported but not enforced), and benchmark trial timeouts kill the whole
AX Engine process group instead of orphaning the generation. - MTP benchmark aggregates pair numerators and denominators over counter-reporting trials
only, instead of inflatingeffective_tokens_per_forwardwhen some trials lack counters. prepare_development_model_cardsanitizes the manifest's calibration reference along with
the plan's (local-path leak that also broke the release-audit M1 equality invariant).- Release audit records issues instead of crashing on wheels missing
axquant/__init__.py,
corrupt measurement-set or calibration files, and non-scalar benchmark metadata; hardware
registry checks record all-failed raw benchmarks instead of raising. --kv-default-bitsrejects sub-policy-floor values (2/3) at parse time instead of failing
late in planning.scripts/hf_to_mlx_bf16.pywrites the lm_head-synthesized shard aside and swaps atomically;
saving onto the mmap-backed source silently corrupted every tensor in the shard.- Ext4T scripts: union-sync verification compares content only (mtime-only differences no
longer deadlock syncs), empty-array expansions no longer crash stock macOS bash 3.2 under
set -u, shell-config marker blocks no longer corrupt an rc file lacking a trailing
newline, live log/publish directories are moved aside before migrate-and-delete, and
--status/argument handling exit correctly. - Architecture-gate errors and inventory warnings name the adapter registry instead of
hardcoding Qwen 3.6 (the checks were already registry-wide). - Ext4T planning treats
axquant/logspackages as host-local: layout moves only — no
cross-host mirroring, duplicate deletion, or fingerprint-driven renames of mutable log
trees; index loading reports the exact file and line for corrupt or incomplete records.
See the v1.1.x → v1.2.0 migration guide for action items.
v1.1.1
AXQuant v1.1.1 is a stability release for the AWQ/GPTQ calibration path introduced in v1.1.0 — no new quantization algorithms. Certification remains evidence-gated; this release does not claim certified public model releases.
Fixed
- BF16 capture crash:
capture-activationsfailed on every real BF16 checkpoint becausenp.asarrayrejects bfloat16 MLX buffers at the PEP 3118 check. Activations are now cast inside MLX before numpy export. Found by a real-model smoke on Mac Studio M2 Ultra; tiny fp32 fixtures never exercised it. Regression tests cover both the conversion and its premise. - GPTQ peak memory: Hessian accumulated in float32 (float64 only on factorization retry), diagonal damping without materializing identity matrices, group-level (not full-width) static grids, and prompt freeing of intermediates — measured 6.7 GB → 4.7 GB peak RSS at in = 8192 (−30%), identical numerical output.
Added
- Resumable activation capture: segmented replay (
--segment-batches) with a binding-verifiedcapture_progress.json; an interrupted capture resumes byte-identically instead of starting over. Final artifacts are deflate-compressed, can be grouped into shard archives (--modules-per-shard), andload_capture_activationsnow fails closed without thecompletion.jsonmarker. - Real-hardware integration tests:
tests/test_integration_mac.py(markerintegration, Apple Silicon only) drives tokenize → capture → measured AWQ/GPTQ probe → GPTQ plan → realmlx_lm.convertend to end, plus a resume byte-equality smoke. Run withpytest -m integration. - CI:
macos-14job runs the full MLX test suite on Apple Silicon; Ubuntu job runs ruff + mypy. README badge added. - Signed release artifacts: a
v*tag workflow builds sdist/wheel, emitsSHA256SUMS.txt, and signs dists with keyless Sigstore build-provenance attestation. Note: this workflow ships in v1.1.1 itself, so attestations begin with the next tag. - Docs:
docs/migration-v1.1.md(v1.0.x → v1.1.x renames and state invalidation),docs/compatibility.md(environment matrix),docs/known-issues.md.
Verification
- 528 tests passing locally (macOS arm64, Python 3.13, mlx 0.32.0) and on Mac Studio M2 Ultra (Python 3.12), including the new integration tests; ruff and strict mypy clean.
- Real-model smoke on Mac Studio M2 Ultra (MiniCPM5-1B BF16, 168 modules): tokenized cache → activation capture → measured probe — mean task-loss delta at 4-bit: GPTQ 0.0000 vs affine 0.0015, the first real-model confirmation that the GPTQ refinement materially reduces measured degradation.
Known limitations carried forward
- Measured probing through the CLI still defaults
capture_pointsto("output", "hidden"); plain dense backbones (non-multimodal layouts such as MiniCPM5/Qwen3-dense) only expose logits, so CLI measured probing on those families fails closed today. The library API acceptscapture_points=("output",)and works (used by the smoke above). A CLI escape hatch is planned for a follow-up. - The
v*release workflow ships in this tag, so signed dist attestations begin with the next release; v1.1.1 itself carries source artifacts only.
v1.1.0
AXQuant v1.1.0 adds GPTQ Hessian error-compensated quantization and completes the AWQ calibration path end to end. Certification remains evidence-gated; this release does not claim certified public model releases.
Added
- GPTQ (
src/axquant/gptq.py) — classic second-order error compensation (damped Cholesky, LazyBatchUpdates) as a weight pre-transform before portable MLX-LM affine packing; bits 2/3/4/6/8, group sizes 32/64/128. Registered asGptqPluginin the numpy reference registry. capture-activations— new pipeline stage that replays a verified tokenized calibration cache through the BF16 model and records per-module Linear input activations into a checksum-boundActivationCaptureManifest(axquant.activation-capture.v1).load_capture_activationsfails closed on model identity, shape, or checksum drift.- Measured AWQ/GPTQ probing —
analyze --methods awq,gptq --calibration-activations <dir>produces measured AWQ/GPTQ candidates, with hardware costs normalized against the affine packing control. - Convert-time AWQ/GPTQ from the CLI —
convert --calibration-activations <dir>loads the capture artifact and executes refinement before affine packing, with per-module execution records. This makes AWQ plans convertible end to end for the first time. - Planner integration — GPTQ in the default hardware profile,
gptq-hessianscale strategy, role-policy ranking after AWQ for attention/MLP, GPTQ in therefine-awq-dwqladder, and a GPTQ release-audit evidence kind.
Changed
- The conversion calibration mapping is method-agnostic:
convert_model(awq_activations=...)is renamed tocalibration_activations=and shared by AWQ and GPTQ. - MLX probe backend version bumped (
axquant-mlx-isolated-probe-v4→v5); prior probe resume state is invalidated. - Packaging classifier reconsidered for the 1.x line: Beta is kept, as certified Hub model release evidence (MTP speed, size floors) remains open.
Verification
- 516 tests passing, including MLX-gated end-to-end coverage of capture, measured AWQ/GPTQ probing, and GPTQ conversion;
ruff check,ruff format --check, and strictmypy srcclean. - On synthetic correlated-activation fixtures, GPTQ reduces output reconstruction error by roughly half versus plain RTN at 4-bit.