An implementation and tooling suite for porting the EXL3 quantization and model conversion pipeline from NVIDIA CUDA to Intel Arc GPUs (Xe2-LPG / Xe-HPG / Xe2-HPG) using SYCL, oneAPI, and PyTorch XPU.
Compatible with upstream ExLlamaV3 format and downstream Intel Arc inference runtimes such as exl3xpu.
| Metric | Status / Value | Verification Source |
|---|---|---|
| Phase / Maturity |
Gates 0, 1, 2, 3 Closed & Discrete Arc Fully Qualified (Phase 3 full 32-layer conversion P3-09, P3-11 verification, P3-12 validation PPL, P3-13 vLLM runtime execution, and initial Hugging Face release complete; discrete-Arc track P3-15..P3-18 fully qualified across Arc B580 and Arc Pro B60 per B60_B580.md & reports/discrete_vs_140v.md; Phase 4 architecture extensions: P4-12 [x] / P4-13 [x] / P4-14 [x]) |
reports/gate_3.md, reports/discrete_vs_140v.md, exl3_quant/converter.py
|
| Unit Test Suite | 272 / 272 passed (100%) on discrete GPUs (8 platform-conditional skips, 129.5 s on B580) | python -m unittest discover -s tests -p "test_*.py" |
| CUDA Ground Truth (E4) |
Deferred, not waived — skip_cuda.md / SKIP-CUDA-2026-10-21-01; evidence capped at E3
|
skip_cuda.md, docs/deviation_log.md §6 |
| Qualified Hardware Platforms | Intel Arc 140V (Lunar Lake iGPU), Intel Arc B580 (Battlemage dGPU, 12 GB), Intel Arc Pro B60 (Battlemage dGPU, 24 GB) |
docs/compatibility_manifest.md, reports/discrete_inventory.md
|
| Downstream Oracle Parity |
100% Bit-Exact (CPU Ref & XPU SYCL vs exl3xpu.ref) |
tests/test_oracle_parity.py, tests/test_xpu_quantizer.py
|
| Upstream Pinned Commit | turboderp-org/exllamav3 @ 4d7b69c7 |
docs/algorithm_contract.md |
| Published Checkpoints | 1. alpha2beta/Qwen3.8-9B-Distill-EXL3-K2 (2. alpha2beta/JEV-9B-EXL3-K2 (3. alpha2beta/JEV-9B-EXL3-K4 ( |
Hugging Face Hub / reports/discrete_vs_140v.md
|
| XPU Encoder Throughput | 1,711.5 tiles/s (Arc B580) / 1,464.2 tiles/s (Arc Pro B60) / 724.8 tiles/s (Arc 140V) |
reports/discrete_probe.md, artifacts/benchmarks/encoder_b580.json
|
| Sustained Layer Conversion | Peak Alloc 649.7 MiB, 0 B Swap Growth across repeated iterations | artifacts/benchmarks/phase2_layer_bench.json |
| Mmap Shard Streaming (P3-03) | Streaming residual RSS 2.8 MiB over a 424 MiB sharded checkpoint | artifacts/benchmarks/phase3_stream_bench.json |
Development and qualification span both integrated and discrete Intel Arc architectures:
- Host / GPU: Intel Core Ultra 7 258V with Intel Arc 140V integrated graphics (
0x64A0), Xe2-LPG, 8 Xe-cores (subslices), 64 XVEs, 32 GB shared LPDDR5X (UMA). - Toolchain: Arch Linux x86_64, oneAPI 2026.0 (
icpx), Compute Runtime26.35.39758.10, Level Zero1.17.39758, PyTorch XPU2.14.0+xpu. - Operating Profile: Unified physical memory pool; live headroom enforced under a 6.0 GiB OS/driver reserve. Full 32-layer conversion completed for
empero-ai/Qwen3.8-9B-Distillin 15.0 h. Seedocs/140v.mdandreports/gate_3.md.
-
Host / GPU: Intel Arc B580 Graphics (
0x56BE), Xe2-HPG, 20 subslices / 160 XVEs, 2850 MHz boost clock, 12 GB dedicated GDDR6 (11.35 GiB usable VRAM). - Throughput: 1,711.5 tiles/s (2.36× vs 140V). Full-layer conversion speedup: 2.83×.
-
Operating Profile:
EXL3_MEMORY_RESERVE_GIB=4.0,EXL3_MEMORY_REFLECT_OUTSTANDING=1,EXL3_MAX_LAYERS_PER_RUN=1. Full 32-layer conversion ofautotrust/JEV-9B($K=2$ ) completed in 5.00 h; verified clean (1,045/1,045 checks, 0 failures).
-
Host / GPU: Intel Arc Pro B60 Graphics (
0x56B3), Xe2-HPG, 20 subslices / 160 XVEs, 2400 MHz boost clock, 24 GB dedicated GDDR6 (22.71 GiB usable VRAM). - Throughput: 1,464.2 tiles/s (2.02× vs 140V). Full-layer conversion speedup: 2.43×.
-
Operating Profile: Standard memory defaults (6.0 GiB reserve, unreflected mode). Full 32-layer conversion of
autotrust/JEV-9Bat high-fidelity$K=4$ completed in 6.07 h; verified clean (1,045/1,045 checks, 0 failures; relative Frobenius error 0.0865, MSE$1.64 \times 10^{-6}$ ).
For cross-platform benchmarking and comparisons, refer to reports/discrete_vs_140v.md.
1. SYCL XPU Tile Encoder (csrc/quantize_xpu/ & exl3_quant/xpu_quantizer.py)
Native Intel Arc SYCL implementation of the EXL3 forward Trellis Viterbi search and circular traceback:
-
Exact fp16 Dynamic Programming: Add-Compare-Select (ACS) dynamic programming using exact fp16
__hsub2and single-roundedsycl::fmaaccumulation (O-6on-device verified), bit-for-bit identical to the CPU reference. -
Two-Pass Tail-Biting Circular Closure: Pass 1 (
$roll = 128$ ) unconstrained forward/backward to findend_state; Pass 2 ($roll = 0$ ) wrap-constrained bypre_state = end_stateemitting the optimal path. -
Traceback Placement Architectures:
-
gpu_resident: GPU-resident circular traceback baseline with sub-millisecond traceback latency (<0.25 ms per wave). Selected as default (reports/traceback_decision.md). -
d2h_cpu: Device-to-host edge transfer followed by CPU traceback. -
usm_host: Direct host-accessible edge writes via SYCL host-allocated USM.
-
-
Geometry & Cache Sweeps: Evaluated SIMD16 vs SIMD32 workgroups and SLM vs global cost storage. SLM achieves +49% higher throughput at
$K \in {3, 4}$ ; global cost storage excels at$K=2$ by avoiding SLM occupancy bottlenecks. -
Shape Support: Fully supports
$K \in {1, 2, 3, 4}$ , all 3 codebooks (mul1,mcg,3INST), standard$L=256$ tiles, and$L=160$ n-gram rows.
2. Bounded Scratch Arena & Memory Policy (exl3_quant/xpu_quantizer.py, exl3_quant/memory_policy.py)
Adaptive, pressure-aware memory manager replacing upstream's unbounded get_temp_buffers:
-
Single-Slot Stream Arena (
ScratchArena): Event-aware reuse and eviction synchronized with the current PyTorch XPU stream. Prevents cross-$K$ memory leaks. -
Dual-View Accounting: Jointly samples OS
/proc/meminfoand framework allocator (torch.xpu.mem_get_info/memory_allocated). Enforces a strict 6.0 GiB OS/driver reserve. -
Configurable reserve (P3-09): the admission reserve can be overridden per run with
EXL3_MEMORY_RESERVE_GIB(float GiB) orEXL3_MEMORY_RESERVE_BYTES(integer bytes); unset keeps the 6.0 GiB default. The reserve is device-pool headroom: on an integrated (UMA) device the scratch arena draws from the same DRAM as the host, so a host with a small device pool but plenty of RAM headroom can end up with no admissible budget at all while the system is in no danger. The override makes that trade-off explicit and auditable (the P3-09 full-model run uses 4 GiB with the measured headroom recorded inprogress.mdStep 26). -
Pre-Admission Abort & Adaptive Fallback: Pre-checks requests against usable headroom; raises
MemoryPressureErrorbefore exhausting memory. Automatically retries with halved batch capacities ($B \to B/2$ ) without changing tile semantics.
3. Block LDLQ Decomposition & Preprocessing (exl3_quant/ldlq.py)
Direct contract transcription of the blockwise Cholesky/LDLQ factorization (quantize.py:416-490):
-
Contract-Conformant Inversion: Inverts block diagonal
$L_{bb}^{-1}$ and folds into$M_{:, block} = L_{:, block} L_{bb}^{-1}$ . -
Retry-Only Damping Schedule: Preserves upstream's adaptive diagonal regularisation (
$2 \cdot \sigma_{\text{reg}} \cdot \text{mean}(\text{diag}(H))$ with up to 10 retries) without artificial pre-emptive damping. -
Operator Attribution Probe: Probed 17 operator/dtype pairs on Lunar Lake XPU; catalogued explicit CPU fallback boundaries (e.g.,
torch.linalg.choleskyon XPU falls back to CPU). -
One-Sided LDLQ Error Feedback (
P2-08):ldlq()reproduces upstream's bottom-up span/block traversal (quantize.py:493-609): additive target correction from the strictly-lowerLslice, tensor-core tile permutation, un-permuted reconstruction, and trailing-span residual feedback. Tile encoding is a pluggable callback with bit-exact reference and Arc XPU adapters that reuse a singleScratchArena.
4. Contract-Conformant CPU Reference Encoder (exl3_quant/reference_encoder.py)
Direct host-CPU transcription of the upstream CUDA kernel quantize_tiles_kernel.cuh:23-313:
-
16-bit State Space:
$S = 65536 \gg K$ tracked states,$Kr = 16 - K$ , candidate branch states$\sigma = (k \ll Kr) \mid e$ , predecessor$pred = \sigma \gg K$ . -
Exact fp16 Fused Metric: Single-rounding
__hfma2emulation using float64 intermediate accumulation with strict<first-branch tie-breaking. - Vectorized NumPy Acceleration: Precomputes candidate branch tables, executing 256-step dynamic programming in ~15 ms per tile on CPU.
5. Format Primitives & Bitpacking (exl3_quant/trellis_format.py)
Device-independent format contract transcribed from pack.cu, codebook.cuh, and quantize.py:
-
Procedural Codebooks: Bit-exact LUTs for
mul1(913 distinct levels in[-3.453125, 3.34765625]),mcg(10,746 levels), and3INST(10,598 levels). -
Tensor-Core Permutation: Exact 256-element permutation table
tensor_core_perm()and inversetensor_core_perm_inv(). -
State-History Container: Upstream MSB-first packing (16 spans
$\times$ 16 elements, low$K$ bits per state) withSWAP16half-word swap (pack_trellis,swap16_storage,decode_states,decode_tile_values).
6. Scratch Memory Estimator (exl3_quant/scratch_estimator.py)
Predicts exact VRAM requirements based on the pinned allocator contract:
- Costs buffer:
$B \times 2 \times S \times 2$ bytes (float16). - Edges buffer:
$B \times T \times S \times 2$ bytes (int16). - Batch capacity solver
calculate_max_batch_size(...)with configurable UMA/system reserves and Level Zero single-allocation bounds.
7. Sylvester Hadamard Transform (exl3_quant/hadamard.py)
Contract §8 reference path, transcribed from upstream util/hadamard.py:
- Natural Sylvester
H_128, orthonormalized by1/sqrt(128); symmetric and self-inverse. - Blockwise application (
H @ xper 128 rows,x @ Hper 128 columns), matching upstreamblockwise_preapply_had_{l,r}_— not a full Kronecker transform. - Decode ordering
H_l → ×su → H_r → ×sv(weight_from_quantized), verified againstexl3xpu.ref.weight_orig.
8. Weight Regularization & Global-Scale Search (exl3_quant/regularize.py, exl3_quant/gss.py)
Contract §9.3, transcribed from quantize.py:1079-1236:
block_rmswith upstream's 32-slice accumulation order.- Output-scale skew heuristic (top 2% of
sqrt(H_diag)vs 15% cutoff), out-channel RMS normalization,sv/susign+scale folding, and the zero-channel floor (0.1) /sv = 0rule. - Global-scale (
g_scale_gss) search (exl3_quant/gss.py, P2-04 complete): wrapped-diagonal tile sampling with highest/lowest-RMS outlier tiles, coarse grid (0.1–1.9, strided subsample) → fine grid (0.075 around coarse minimum, full sample) → parabolic refinement with a0.01floor.
9. Transformer Layer Calibration & Hessian Harvesting (exl3_quant/calibration.py)
Complete layer forward execution and activation covariance capture (P2-01..P2-03, P2-05):
- Complete
TransformerDecoderLayer(RMSNorms, Rotary Embedding, Attention$Q/K/V/O$ , SwiGLU$Gate/Up/Down$ ) executing natively on Intel XPU with zero silent CPU fallback. -
HessianCollectorgroups inputs into 4 architectural locations (attention in, attention out, mlp in, mlp down), reducing Hessian memory by 43% (976 MiB total in fp32 for Llama-3.1-8B). - Second-moment accumulation
$H = \sum X^T X$ with token normalization, damping$\lambda \cdot \text{mean}(\text{diag}(H))$ ($\lambda = 0.01$ ), and floor clamping for inactive/ill-conditioned channels.
10. Single-Layer Quantization & Distortion Metrics (exl3_quant/layer_quant.py)
End-to-end layer quantization with bounded scratch reuse and proxy loss (P2-11, P2-12):
- Single-slot
ScratchArenaandXPUTrellisEncoderreused across all 7 linear projections (q, k, v, o, gate, up, down) with explicittorch.xpu.synchronize()between projections. - Evaluates relative Frobenius error, reconstruction MSE, tile distortion, and Hessian-weighted proxy loss
$\text{tr}\left((W - \hat{W}) H (W - \hat{W})^T\right)$ via$(H @ E \cdot E).\text{sum}()$ .
11. Trellis Packing & Safetensors Serialization (exl3_quant/serialization.py)
Export, reload, and verification of EXL3-compliant checkpoint artifacts (P2-13..P2-16):
pack_module_trellisapplies auditedpack_trellisandswap16_storageintoint16 [k/16, n/16, 16*K].- Exports compliant
.safetensorscheckpoints withquantization_config.jsonand index weight map. load_and_verify_layer_safetensorsdecodes weights viaexl3xpu.ref.weight_origand validates state-history round trips and malformed-file rejection.
12. Bounded Full-Model Conversion Orchestrator & Recovery (exl3_quant/converter.py)
Phase 3 driver preserving the audited upstream conversion semantics (P3-01..P3-08):
-
ConversionConfig+validate()reject unsupported modes (MoE / vision / MTP / pre-quantized input, non-dense architectures, fractional or out-of-range K, non-mul1codebooks, non-128-divisible geometry, partial/scaled rotary, sliding window) in pure Python before any expensive work (P3-01). -
convert_modelexecutes the pinned upstream per-module loop: per decoder layer in ascending order — grouped-Hessian capture on the running state produced by all previously quantized layers, quantization, reload of quantized numerics (w_hatintonn.Linearlayout), and advance of the calibration state through the quantized layer. Unchanged components (embed_tokens,lm_head, RMSNorm) are bit-exact fp16 pass-through with per-layerqtensors/artifacts and a mergedquantization_config.jsonmanifest (P3-02). -
ShardedSafetensorsIndexstreams HF-style sharded/single-file checkpoints through memory-mappedsafetensors.safe_openhandles, materializing only the layer under conversion; host RSS is measured (read_rss_kib) rather than assumed (seeartifacts/benchmarks/phase3_stream_bench.json) (P3-03). -
Checkpointing, Resumability & Recovery (P3-04..P3-08):
- Atomic publication (
atomic_save_safetensors) writing.tmpbefore POSIX rename, preventing incomplete artifacts on crash (P3-05). - Checkpoint integrity verification (
verify_layer_checkpoint) checking all 30 expected tensors per layer (P3-05). - Fault injection testing (
fault_injector) verifying safe restart across calibration, quantization, and publishing boundaries without dropped or duplicated work (P3-06). - Strict resume argument validation (
_validate_resume) againstquantization_config.jsonwith documentedforce_resumeoverride (P3-07). - Pre-checked disk space limits (
check_disk_space), missing shard handling, and corrupted checkpoint detection (CorruptedCheckpointError) (P3-08).
- Atomic publication (
-
Real-corpus calibration (P3-09):
ConversionConfig.calibration_token_idsaccepts a pre-tokenizedexl3_quant.calibration_token_ids.v1JSON corpus file (rows ofbatch_size * seq_lentoken ids + provenance metadata), prepared reproducibly byscripts/prepare_calibration_tokens.pyfrom a local corpus copy and the target tokenizer. The full contract (format stamp, row count/shapes, int token bounds,seq_lenmatch) is validated invalidate()before any weight byte; the manifest recordscalibration.corpus+calibration.token_ids {path, sha256, metadata}andcalibration_state.ptrecordscorpus_sha256, so resume can never mix corpora (cross-corpus resume raisesIncompatibleResumeError). The synthetic deterministic corpus remains the unchanged default when the field isNone. -
Streaming memory hygiene (P3-09):
exl3_quant/memory_hygiene.pyreleases what a finished streaming step no longer needs — the page cache of the consumed source shards (POSIX_FADV_DONTNEED, advisory: clean pages only, dirty pages are written back first, file content is never affected) and freed host arenas (malloc_trim(0)). The converter calls it after every pass-through group, every layer read, every published layer artifact and the calibration state, so a 32-layer run over a 19.3 GB checkpoint does not pin the checkpoint in DRAM (on this shared-memory device the P0-20 admission policy binds on host pressure, so an unpinned page cache aborts the run withMemoryPressureError). -
Output verification (P3-11):
scripts/verify_conversion_output.pychecks a finished bundle without any inference: manifest contract (status, layer list, recipe, corpus sha256), the exact per-layer tensor key set (quantized module tensors + layer norms + per-layer pass-through tensors), dtypes, trellis tile geometry against the source checkpoint shapes, bit-exact comparison of every pass-through tensor against the source checkpoint, and reconstruction of every quantized module with its relative Frobenius error (must lie strictly inside (0, 1)). -
Runtime export (P3-13):
scripts/export_for_runtime.pypublishes a converted bundle as an ordinary checkpoint directory for the pinned downstream runtime: the per-layer artifacts and pass-through groups become shards (hardlinked by default — they are immutable once published),model.safetensors.index.jsonis built from the actual tensor names (duplicate keys across shards are refused), the model's config/tokenizer files are copied, and the conversion manifest is published asquantization_config.json(it already carries thequant_method/bits/codebook/tensor_storageschema theexl3xpuvLLM plugin reads). It also embeds that manifest into the exportedconfig.json, because the plugin reports no config filenames of its own. Verified end to end (P3-13): the exported 6.72 GiB bundle (35 shards, 1375 tensors) loads in vLLM0.31.0+xpuwith theexl3xpuplugin (exl3: 200 EXL3 modules (0 in MTP head), 52 s load, text-only mode) and decodes coherent greedy text. The runtime harness needs the same three exports asvllm.xpu/scripts/launch_vllm.sh:PATH=/opt/intel/oneapi/compiler/latest/bin:$PATH,LD_LIBRARY_PATH=<venv>/lib:$LD_LIBRARY_PATH(oneCCL's legacy pluginlibccl.so.1, which the RUNPATH-lesslibccl.so.2loads by bare name) andCPATH=<vllm.xpu>/tools/sysroot/usr/include:$CPATH(level_zero/ze_api.hfor the Triton JIT). -
Quality evaluation (P3-12):
scripts/evaluate_quality.pymeasures teacher-forced NLL/perplexity, KL divergence and argmax agreement between the floating-point source and the decoded artifacts inside the repo's own reference forward (the published per-layer trellis is decoded and forwarded exactly like the calibration batches, so only the weights differ);scripts/evaluate_perplexity.pymeasures the same teacher-forced NLL inside the pinned runtime throughprompt_logprobs. Measured on 4 held-outwikitext-2validation sequences (2044 scored positions, disjoint from the test-split calibration corpus): floating-point PPL 6.368, quantized PPL 7.554 (+18.6 %; NLL +9.2 %), mean KL 0.254 over 128 positions, argmax agreement 0.750, and the runtime reproduces the repo-side quantized NLL to 1.4e-5 relative. The exact quantization loss is attributed against the floating-point baseline; the matched CUDA-quantized reference stays deferred (skip_cuda.md).
13. Hybrid Qwen3.5 Text-Tower Extension (exl3_quant/hybrid.py)
Opt-in conversion of the declared Active Target's hybrid architecture (architecture_mode="qwen3_5_text_tower", P4-12/P4-13; requires transformers >= 5.17 for the pinned qwen3_5 reference model):
- Quantization contract (P4-12): every bias-free linear projection of both layer kinds (
linear_attention:linear_attn.in_proj_qkv/in_proj_z/out_proj+mlp.*;full_attention:self_attn.q/k/v/o_proj+mlp.*) is quantized unchanged because all k/n widths are multiples of the 128-wide Hadamard block.linear_attn.in_proj_a/in_proj_b(n = num_value_heads) violate that encoder contract and — together withconv1d.weight/A_log/dt_bias/linear_attn.normand the full-attentionq_norm/k_norm— are emitted bit-exact pass-through in source dtype. - Reference forward: calibration runs the pinned
transformers.models.qwen3_5decoder layers (eager attention, causal mask on full-attention blocks, partial rotary 0.25 + interleaved mrope) with recorded reference-PyTorch fallbacks forcausal_conv1d/flash-linear-attention; shared-input Hessian groups cover all fourin_proj_*members. - Text-tower-only semantics (P4-13): vision (
model.visual.*) and MTP (mtp.*) tensors are preserved, never quantized, and written to separateqtensors/untouched*.safetensorsgroup files so no single serialization holds all pass-through bytes; the manifest records the groups plus ahybridprovenance block (multimodal token ids, rope parameters, norm semantics, reference-forward environment). - Text-only container (P4-14): the same layer contract is also accepted in its text-only packaging —
Qwen3_5ForCausalLM/model_type: qwen3_5_textwith a flat config (notext_configblock) and the decoder stack at the top-levelmodel.layers.prefix, as shipped byautotrust/JEV-9B. The container layout derives the checkpoint prefixes (nested → model.language_model.layers,flat → model.layers), is recorded in the manifest ashybrid.text_tower_container, and is accepted only on the unambiguous text-only markers — a multimodal config that is merely missing its text block stays a hard rejection. Pass-through groups remain key-derived, so a config that declares an MTP head the checkpoint does not carry (JEV-9B does) produces no MTP group file. Converting a JEV-9B-class checkpoint is a separate, owner-approved task (its System-1 LoRA + decision head live outside the backbone safetensors — seetasks.mdP4-14). - Gating: the default
"dense"mode keeps every historical acceptance and rejection byte-identical; hybrid support availability and geometry are validated in pure Python before any weight byte is read, and resume refuses cross-mode manifests.
The test harness enforces exact discrete checks, perturbation detection, and live oracle cross-validation:
# Set PYTHONPATH to project root and run all unit tests
PYTHONPATH=. /home/yanchun/.venvs/exl3/bin/python -m unittest discover -s tests -p "test_*.py"-
tests/test_calibration.py(7 tests): RMSNorm, Rotary embeddings complex unit norm, Attention forward, SwiGLU forward, complete layer forward on XPU, exact second-moment Hessian accumulation matching explicit formula, dead channel floor and damping safeguard. -
tests/test_layer_quant.py(4 tests): Proxy loss trace formula equivalence, factorization residual check, single module XPU quantization, and complete decoder layer quantization on XPU with ScratchArena reuse. -
tests/test_serialization.py(6 tests): Trellis packing round trip with state-history low K-bit preservation, safetensors schema validation, export/reload verification withexl3xpu.ref.weight_orig, malformed/truncated safetensors rejection, and tile encoder bit-width mismatch guards (TestEncoderBitWidthGuard). -
tests/test_upstream_encode_oracle.py(4 tests): CPU-runnable tier-4 oracle derived from upstream's CUDA test recipe (E3 evidence): reproduces upstream's ownmax_mse_per_Kceilings for K = 2..8, the tail-biting ring invariant, upstream's "ideal encoding" state layout, and encode→dequant round trips — proving search-quality parity without any NVIDIA hardware. -
tests/test_forward_semantics.py(5 tests): independent audit of the reference encoder's forward ACS pass (branch metric, fp16 accumulation, predecessor table and terminal costs, tie-breaking and masking rules) — supports the E1 source-transcription claim. -
tests/test_converter.py(36 tests): Phase 3 bounded conversion (P3-01/02/03) against deterministic synthetic mini-Llama checkpoints (tests/fixtures/): config rejection of MoE/vision/MTP/pre-quantized/fractional-K/bounded-K/bad-geometry/partial-rotary/rope-scaling/sliding-window/bad-output cases, plus hardening against the declared targets' architecture shape; mmap shard index scoping, bit-exact streaming reads, single-file indexing, poisoned-shard isolation, RSS measurement; full two-layer XPU conversion with a recorder proving ascending layer order, upstream module order, layer-0 capture equality vs. independent calibration, layer-1 propagation through layer 0's quantized numerics, reload replay equivalence, transposingw_hatreload, bit-exact unchanged pass-through, per-layerqtensorsartifact layout (30 tensors), merged manifest consistency, and per-layer RSS recording; plus P3-09 real-corpus wiring and streaming memory-hygiene integration checks. -
tests/test_hybrid_converter.py(36 tests): P4-12/P4-13 hybrid extension — validator acceptance of the synthetic hybrid fixture and both declared-target config replicas in the opt-inqwen3_5_text_towermode (with default-mode rejection preserved), rejection of unknown modes/MoE/unknown layer types/non-128 widths,full_attention_intervalderivation; P4-14 text-only container (flatqwen3_5_text, e.g.autotrust/JEV-9B) — config-replica acceptance with derivedmodel.layersprefixes, dense-mode rejection preserved, the missing-text_config-block guard; shared-input Hessian grouping with forward pre-hook input-identity; XPU end-to-end conversion of a 3-layer bfloat16 hybrid fixture asserting 32-tensor layer artifacts, bit-exact per-layer and per-group pass-through, manifest provenance, and tampered-manifest mode mismatch refusal. -
tests/test_xpu_quantizer.py(13 tests): End-to-end XPU quantizer verification: all 65,536 codebook states, bit-exact parity vsReferenceTrellisEncoderacross$K \in {1, 2, 3, 4}$ and all 3 codebooks,$L=160$ n-gram rows, live oracle decode viaexl3xpu.ref, edge cases & ties (zeros, constant, outliers), partial batches & waves, input validation, stream-queue ordering, all 4 traceback placements & kernel variants (SG16/SG32, SLM/global),ScratchArenabounded eviction across$K$ , automatic batch halving retry, no double scratch residency during retry (B1), and zero resident scratch leakage on failed acquisition (B2). -
tests/test_xpu_extension.py(7 tests): Custom SYCL XPU extension sanity, stream execution, memory lifetime, device cap queries, and on-device measurement of Open ItemO-6(exact fp16 single-rounding FMA verified against 65,536 random and 11 adversarial inputs). -
tests/test_hadamard.py(11 tests): Sylvester values/symmetry/orthogonality, non-power-of-two rejection, blockwise-vs-block-diagonal equivalence, involution, in-place validation, bit-exactexl3xpu.ref.hadamard128, and decode-order parity withweight_orig. -
tests/test_gss.py(19 tests): wrapped-diagonal coverage/value verification against manual extraction, extreme-RMS tile inclusion, stage-by-stage recomputation of the coarse→fine→parabolic pipeline, batching/chunking invariance, MSE-below-g_scale=1with the real encoder, determinism, huge-weight scale walk-down,select_refined_scalefloor/basin tests, andregularizewiring. -
tests/test_ldlq_loop.py(13 tests): identity-Lequivalence with independent tile quantization, exact additive target correction, independent dense transcription forbuf_size_k ∈ {16,32,64}, feedback objective improvement on a correlated Hessian, span invariance, upstream diagonal-zeroing equivalence, encoded layout/dtype, input immutability, validation, and XPU↔reference parity. -
tests/test_regularize.py(13 tests):block_rmsaccuracy and slice-boundary accumulation, full regularize→decode round-trip, skew heuristic both directions, zero-channel flooring, all-zerozerosflag, non-mutation, and input validation. -
tests/test_converter_recovery.py(18 tests): Phase 3 checkpointing/resumability/fault recovery (P3-04..P3-08) against 3-layer synthetic checkpoints: working-directory layout, configurable checkpoint interval with manifest progress tracking; atomic.tmp+ POSIX-replace publication and 30-tensor-per-layer integrity verification withCorruptedCheckpointErroron truncation; interruption-safe recovery at calibration/quantization/reload/publication boundaries with clean resume; rigorous_validate_resumeinvariance validation; and resilient failure handling. -
tests/test_memory_policy.py(28 tests): OS/proc/meminfoparsing, reserve budget arithmetic, admission boundary enforcement, outstanding allocation tracking,MemoryPressureErrorcontext, post-commit reserve-breach detection, allocator-growth verification (M1), platform-native memory counters across OS variants, live GPU allocation under reserve constraints, and the P3-09 reserve override. -
tests/test_memory_hygiene.py(5 tests): P3-09 advisory memory-release helpers — page-cache eviction preserves file content byte-for-byte, missing files and directories are not errors, host-heap trimming is best-effort and never raises. -
tests/test_ldlq.py(10 tests): Algebraic verification ofblock_ldl($L L^T = H$ , block-diagonal inversion fold, identity block diagonals), adaptive retry-damping schedule on ill-conditioned Hessians, input validation, and XPU vs CPU parity. -
tests/test_oracle_parity.py(4 tests): Live verification againstexl3xpu.refproving bit-exact identity fortensor_core_perm, all 3 codebooks across 65,536 states,decode_statesacross$K \in {1, 2, 3, 4, 5, 6, 8}$ , and end-to-end encoded tile reconstruction. -
tests/test_encoder.py(8 tests): Validates shift-register inverse identity$((pred \ll K) \mid e) \equiv state$ , continuous circular ring topology, bit-exact codebook reconstruction, end-to-end container round-trips for$K \in {2, 3, 4}$ , path cost tracking, and bounded distortion. -
tests/test_trellis_format.py(17 tests): Format-conformance tests covering MSB-first bitstreams,SWAP16, state-history properties, and codebook range invariants. -
tests/test_negative.py(5 tests): Perturbation harness detecting 1-bit container flips, scale distortions, illegal trellis transitions, non-integer inputs, and insufficient memory budgets. -
tests/test_scratch.py(4 tests): Arithmetic regression fixtures for$K \in {1, 2, 3, 4}$ and batch sizing edge cases. -
tests/test_bitpack.py(4 tests): Legacy sub-byte container round-trip shims.
The project maintains an evidence-backed governance model:
-
reports/gate_0.md— Gate 0 audit closure report (operator coverage,block_ldlbenchmark, conditional GO to Phase 1). -
reports/gate_1.md— Gate 1 encoder readiness report (reconstruction parity, bounded scratch, throughput sweeps, GO to Phase 2). -
reports/gate_2.md— Gate 2 single-layer readiness report (Acceptance Tiers 1–4, sustained memory stability with 0 B swap growth, GO to Phase 3). -
reports/gate_3.md— Gate 3 full-model release report forempero-ai/Qwen3.8-9B-Distillon Intel Arc 140V. -
reports/discrete_inventory.md— Discrete GPU inventory (Arc B580 12 GB & Arc Pro B60 24 GB: PCI IDs, VRAM, clocks, allocation bounds). -
reports/discrete_probe.md— Discrete encoder probe benchmarks (B580: 1,711.5 tiles/s, Pro B60: 1,464.2 tiles/s; memory-policy admission tests). -
reports/discrete_phase_c.md— Discrete Phase C test suite logs (272/272 tests) and single-layer conversion benchmarks (2.43× – 2.83× speedups). -
reports/discrete_vs_140v.md— Headline comparative report comparing Arc 140V, Arc B580, and Arc Pro B60 across throughput, conversion times, and$K=2$ vs$K=4$ fidelity. -
reports/verify_jev9b_b580.json— P3-11 verification report for JEV-9B ($K=2$ on B580): 1,045 checks, 0 failures. -
reports/verify_jev9b_k4_b60.json— P3-11 verification report for JEV-9B ($K=4$ on Pro B60): 1,045 checks, 0 failures. -
reports/traceback_decision.md— Comparative analysis ofgpu_resident,d2h_cpu, andusm_hosttraceback placements on Lunar Lake UMA. -
B60_B580.md— Discrete Arc qualification execution plan and gate checklist. -
docs/140v.md— Arc 140V / Core Ultra 7 258V adaptation guide. -
docs/compatibility_manifest.md— Pinned hardware/software environment, model target, calibration corpus, and acceptance criteria. -
docs/algorithm_contract.md— Authoritative 13-section mathematical contract audited from upstream ExLlamaV3. -
docs/native_dependency_audit.md— Classification of all upstreamext.*conversion sites and XPU porting strategy. -
docs/extension_build.md— Build and linkage requirements for oneAPI 2026.0 / PyTorch XPU C++ extensions. -
docs/deviation_log.md— Formal deviation log and review waivers (DEV-2026-10-20-01). -
tasks.md— Implementation task list and phase gates (Gates 0 through 3 + Discrete Track). -
progress.md— Detailed implementation progress log with per-entry commit timestamps. -
review.md— Independent code review conclusions and formal remediation responses.
With Gate 0, Gate 1, Gate 2, Gate 3, and the Discrete Arc Deployment Track (P3-15..P3-18) fully completed and verified:
P3-01..P3-08 — Bounded Model Orchestrator & CheckpointingDONE (Steps 21–23).P3-09..P3-14 & Gate 3 — First Complete Model Conversion & Evaluation:DONE (alpha2beta/Qwen3.8-9B-Distill-EXL3-K2on Arc 140V).P3-15..P3-18 — Discrete Arc Qualification Track:DONE (alpha2beta/JEV-9B-EXL3-K2on Arc B580,alpha2beta/JEV-9B-EXL3-K4on Arc Pro B60;reports/discrete_vs_140v.md).- Phase 4 Separately Scoped Extensions:
- P4-01: Alternate codebooks (
mcg,3INST). - P4-02: Fractional average-bitrate recipes (e.g. 2.5 bpw, 3.5 bpw).
- P4-05: Mixture-of-Experts (MoE) architecture support.
- P4-08: Conversion qualification for larger models (32B–70B+ parameters).
- P4-01: Alternate codebooks (
CUDA ground truth (
skip_cuda.md/SKIP-CUDA-2026-10-21-01): deliberately deferred — no eGPU installed; gate evidence is capped at class E3 (E4 path parity is not claimed). Reopen triggers and the resume checklist live inskip_cuda.md§6–§7.