xinfer-ai 0.14.1 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/docs/precision_probes.md +66 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -141,12 +141,15 @@ Add `--kvcache-dtype` to compress KV cache and extend context length:
|
|
|
141
141
|
* ✅ GLM4.7 Flash
|
|
142
142
|
* ✅ GLM 5.2 (DeepSeek V3.2 DSA architecture)
|
|
143
143
|
* ✅ DeepSeek V3/R1/V3.2
|
|
144
|
+
* ✅ **DeepSeek V4** (support 2-bit ISQ via `--isq w2`)
|
|
144
145
|
* ✅ Phi3 / Phi4 (Phi-3, Phi-4, Phi-4-mini, etc.)
|
|
145
146
|
* ✅ Gemma3/**Gemma4** (Multimodal model)
|
|
146
147
|
* ✅ Qwen3-VL (Dense, Multimodal model)
|
|
147
148
|
* ✅ MiroThinker-v1.5 (30B, 235B)
|
|
148
149
|
|
|
149
|
-
**Formats:** Safetensors (BF16, `FP8-blockwise`, GPTQ, AWQ, MXFP4, `NVFP4`) | GGUF (all quant types) | `ISQ` (on-the-fly quantization)
|
|
150
|
+
**Formats:** Safetensors (BF16, `FP8-blockwise`, GPTQ, AWQ, MXFP4, `NVFP4`) | GGUF (all quant types) | `ISQ` (on-the-fly quantization, including **2-bit W2** for DeepSeek V4 MoE)
|
|
151
|
+
|
|
152
|
+
> **DeepSeek V4 Flash + 2-bit ISQ:** `--isq w2` re-packs MXFP4 routed experts to 2-bit on load. With 2× GPU tensor parallel (`--d 0,1`), model weights use about **46 GB per GPU** (**46 × 2 GB** total).
|
|
150
153
|
|
|
151
154
|
---
|
|
152
155
|
|
|
@@ -209,6 +212,9 @@ xinfer --d 0,1 --m Qwen/Qwen3-30B-A3B-Instruct-2507 --kvcache-dtype fp8
|
|
|
209
212
|
# ISQ on-the-fly quantization
|
|
210
213
|
xinfer --m Qwen/Qwen3.6-35B-A3B --isq q4k
|
|
211
214
|
|
|
215
|
+
# DeepSeek V4 Flash (2-bit ISQ MoE, ~46 GB weights/GPU on 2× TP)
|
|
216
|
+
xinfer --d 0,1 --m /path/DeepSeek-V4-Flash --isq w2 --kv-fraction 0.7 --ui-server
|
|
217
|
+
|
|
212
218
|
# NVFP4 model
|
|
213
219
|
xinfer --m unsloth/Qwen3.6-27B-NVFP4
|
|
214
220
|
|
|
@@ -258,6 +264,9 @@ xinfer --m Qwen/Qwen3.6-35B-A3B --isq q4k --kvcache-dtype turbo4
|
|
|
258
264
|
|
|
259
265
|
# Metal ISQ
|
|
260
266
|
xinfer --m /path/Qwen3-4B --isq q6k
|
|
267
|
+
|
|
268
|
+
# DeepSeek V4 Flash: 2-bit W2 ISQ for routed MoE experts (~46 GB weights/GPU, 2× TP)
|
|
269
|
+
xinfer --d 0,1 --m /path/DeepSeek-V4-Flash --isq w2 --kv-fraction 0.7
|
|
261
270
|
```
|
|
262
271
|
|
|
263
272
|
</details>
|
|
@@ -483,6 +492,7 @@ xinfer --m Qwen/Qwen3.6-27B-FP8 --ui-server --enable-tool-grammar
|
|
|
483
492
|
| [Rust Crate](docs/rust_crate.md) | Use as a library |
|
|
484
493
|
| [Add a Model](docs/add_model.md) | Port a new architecture (AI-assisted) |
|
|
485
494
|
| [Test a Model](docs/test_model.md) | Validate model quality (AI-assisted) |
|
|
495
|
+
| [CUDA Precision Probes](docs/precision_probes.md) | Isolate CUDA kernel precision problems |
|
|
486
496
|
|
|
487
497
|
**Using Agents under xInfer backend:** [xbot](docs/xbot.md) · [OpenCode](docs/opencode.md) · [Kilo Code](docs/kilocode.md) · [Claude Code](docs/claude_code.md) · [Goose](docs/goose.md)
|
|
488
498
|
|
|
@@ -499,7 +509,7 @@ xinfer --m Qwen/Qwen3.6-27B-FP8 --ui-server --enable-tool-grammar
|
|
|
499
509
|
| `--ui-server` | API server + built-in ChatGPT-style web UI |
|
|
500
510
|
| `--server` | API server. Bare: `0.0.0.0:8000`; or `host[:port]`, `file:///path`, `socket:///path`, `unix:///path` |
|
|
501
511
|
| `--i` | Interactive CLI chat |
|
|
502
|
-
| `--isq` | On-the-fly quantization: `q2k`, `q3k`, `q4k`, `q5k`, `q6k`, `q8_0` |
|
|
512
|
+
| `--isq` | On-the-fly quantization: `q2k`, `q3k`, `q4k`, `q5k`, `q6k`, `q8_0`, `w2` / `moe_w2` |
|
|
503
513
|
| `--kvcache-dtype` | KV cache quantization: `fp8`, `turbo8`, `turbo4`, `turbo3` |
|
|
504
514
|
| `--max-num-seqs` | Max concurrent requests (default: 32, macOS: 8) |
|
|
505
515
|
| `--max-tokens` | Max tokens per response (default: 16384) |
|
|
@@ -526,6 +536,7 @@ xinfer --m Qwen/Qwen3.6-27B-FP8 --ui-server --enable-tool-grammar
|
|
|
526
536
|
| Variable | Description |
|
|
527
537
|
|---|---|
|
|
528
538
|
| `XINFER_NVFP4_FORCE_LUT=1` | Force software NVFP4 decode to use the LUT-based dequantization path (higher precision) instead of hardware FP4 intrinsics on Blackwell (SM100+). Useful when decode precision matters more than peak throughput. |
|
|
539
|
+
| `XINFER_ENABLE_FLASHMLA` | Enables DeepSeek V4 sparse MLA acceleration when set to `1` or `true`. It is disabled by default (unset), so the precision-preserving custom BF16 sparse-attention kernel is used. |
|
|
529
540
|
| `XINFER_SSE_BUFFER_SIZE=256` | Size of the bounded SSE streaming buffer per client connection (default: 256). Increase for slow network proxies or high-throughput models. |
|
|
530
541
|
| `SM90_LOWER_PRECISION_GDN_PREFILL=1` | Enable the FlashInfer SM90 persistent kernel for GatedDeltaNet (GDN) prefill on Hopper GPUs (SM90). Delivers faster prefill speedup for Qwen3.5/3.6, with a slight precision trade-off. |
|
|
531
542
|
|
|
@@ -563,6 +574,7 @@ SM90_LOWER_PRECISION_GDN_PREFILL=1 xinfer --m Qwen/Qwen3.5-35B-A3B-FP8 --ui-serv
|
|
|
563
574
|
* [x] TurboQuant KV Cache (2-4 bit compression with WHT rotation)
|
|
564
575
|
* [x] FP8 Models (CUDA: MoE, Dense; Metal: Dense)
|
|
565
576
|
* [x] GLM 5.2 (DeepSeek V3.2 + DSA)
|
|
577
|
+
* [x] DeepSeek V4 (Flash) + 2-bit W2 ISQ MoE (~46 GB weights/GPU × 2)
|
|
566
578
|
* [ ] Additional model support (Kimi K2, etc.)
|
|
567
579
|
* [x] CPU KV Cache Offloading
|
|
568
580
|
* [x] Prefill-decode Disaggregation (CUDA)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# CUDA Precision Probe Suite
|
|
2
|
+
|
|
3
|
+
The precision suite is a kernel-level differential test harness. Use it to isolate a CUDA precision problem before attributing the symptom to a full model or sampler.
|
|
4
|
+
|
|
5
|
+
## Run the complete suite
|
|
6
|
+
|
|
7
|
+
From the xInfer repository root:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
./tests/run_precision_suite.sh
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The runner:
|
|
14
|
+
|
|
15
|
+
1. Detects every visible GPU's compute capability with `nvidia-smi` and uses the lowest capability for a safe multi-GPU build.
|
|
16
|
+
2. Builds all Rust probes once with the release CUDA configuration.
|
|
17
|
+
3. Runs each Rust probe followed by its paired Python comparator.
|
|
18
|
+
|
|
19
|
+
The probes cover Candle CUDA/PTX operations, ISQ/GGUF Q4_K and Q6_K, attention.rs kernels, FP8, GDN, paged FlashInfer attention, and the NVFP4 paths supported by the detected GPU. Python comparisons use independent PyTorch references and official Python FlashInfer when available. vLLM and sglang comparisons are attempted when those packages are installed.
|
|
20
|
+
|
|
21
|
+
The suite prints a retained result directory such as:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
/tmp/xinfer_precision_suite_sm120_<pid>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Read the first `FAIL` line and the corresponding stage's `[FAIL]` marker. The failing stage identifies the subsystem; the operation name identifies the kernel family or operation.
|
|
28
|
+
|
|
29
|
+
## Rerun one comparator
|
|
30
|
+
|
|
31
|
+
Probe binaries and their output files are retained, so a Python comparator can be rerun without rebuilding or executing the GPU probe again:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
python3 tests/probes/compare_candle_probe.py \
|
|
35
|
+
/tmp/xinfer_precision_suite_sm120_<pid>/candle.bin
|
|
36
|
+
|
|
37
|
+
python3 tests/probes/compare_flashinfer_probe.py \
|
|
38
|
+
/tmp/xinfer_precision_suite_sm120_<pid>/flashinfer
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Use the corresponding comparator in `tests/probes/` for the failed stage:
|
|
42
|
+
|
|
43
|
+
| Stage | Comparator |
|
|
44
|
+
|---|---|
|
|
45
|
+
| Candle and Q4_K/Q6_K | `compare_candle_probe.py` |
|
|
46
|
+
| attention.rs common kernels | `compare_attention_misc_probe.py` |
|
|
47
|
+
| FP8 | `compare_fp8_probe.py` |
|
|
48
|
+
| GDN | `compare_gdn_probe.py` |
|
|
49
|
+
| FlashInfer attention | `compare_flashinfer_probe.py` |
|
|
50
|
+
| NVFP4 | `compare_nvfp4_probe.py` |
|
|
51
|
+
|
|
52
|
+
## Optional GDN audit
|
|
53
|
+
|
|
54
|
+
The SM90 persistent FlashInfer GQA path is opt-in and excluded by default. Audit it explicitly with:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
./tests/run_precision_suite.sh --include-optin-gdn
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This flag is only for auditing that optional path; it does not enable or change the production routing.
|
|
61
|
+
|
|
62
|
+
## Interpreting SM capability results
|
|
63
|
+
|
|
64
|
+
For SM70 and SM75, the runner automatically builds the legacy CUDA path with only `cuda,nccl`. FlashInfer and CUTLASS-dependent attention and hardware-NVFP4 cases are skipped, but the software FP8 and software NVFP4 GEMM/MoE/helper cases still run and are compared with the independent PyTorch golden. Since attention.rs disables BF16 CUDA kernels below SM80, the legacy software probes use F16 there. The CUDA toolkit must also provide an `nvcc` that supports `compute_70`/`compute_75`; CUDA 12.6 is the recommended legacy-toolkit choice. CUDA 13 `nvcc` rejects these targets before Rust compilation begins.
|
|
65
|
+
|
|
66
|
+
On SM90, Blackwell-only NVFP4 hardware helpers are reported as `SKIP` because they cannot execute on that GPU. Run the suite on SM100/SM120 hardware to exercise hardware NVFP4 dense, GEMM, and MoE paths. Missing optional Python packages are reported explicitly; install versions matching the CUDA and PyTorch environment when those golden comparisons are required.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xinfer-ai",
|
|
3
|
-
"version": "0.14.
|
|
4
|
-
"assetVersion": "0.14.
|
|
3
|
+
"version": "0.14.3",
|
|
4
|
+
"assetVersion": "0.14.3",
|
|
5
5
|
"description": "xInfer — a high-performance LLM inference engine in Rust with CUDA/Metal acceleration",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/guoqingbao/xinfer#readme",
|