xinfer-ai 0.13.2 → 0.13.4

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 CHANGED
@@ -338,6 +338,24 @@ See [more Python examples →](python/ReadMe.md)
338
338
 
339
339
  ---
340
340
 
341
+ ## 🌐 Multi-Node Tensor Parallelism
342
+
343
+ Distribute inference across multiple machines using TCP-based NCCL bootstrap. No MPI required.
344
+
345
+ ```bash
346
+ # Node 0 (master, 192.168.1.100): scheduler + API
347
+ xinfer --d 0,1,2,3 --m /data/DeepSeek-R1/ \
348
+ --num-nodes 2 --node-rank 0 --master-addr 192.168.1.100 --ui-server
349
+
350
+ # Node 1 (worker, 192.168.1.101): forward-only daemon
351
+ xinfer --d 0,1,2,3 --m /data/DeepSeek-R1/ \
352
+ --num-nodes 2 --node-rank 1 --master-addr 192.168.1.100
353
+ ```
354
+
355
+ All nodes must have model weights locally and be TCP-reachable on `--master-port` (default 29500). See [Get Started](docs/get_started.md) for details.
356
+
357
+ ---
358
+
341
359
  ## 🔀 Prefill-Decode Disaggregation
342
360
 
343
361
  Split prefill (prompt processing) and decode (token generation) across GPUs or machines. Eliminates decode stalls during long-context prefilling. PD Server and PD Client must use **same** KvCache type (`--kvcache-dtype`). API request(s) must send to PD Client and the PD Server only process internal prefill requests sent from PD Client.
@@ -437,7 +455,7 @@ Constraint-based generation via llguidance — Lark grammars, regex, JSON Schema
437
455
  | `--f` | Local GGUF file when used alone; remote GGUF filename when paired with `--m <model_id>` |
438
456
  | `--d` | Device IDs (e.g. `--d 0,1`) |
439
457
  | `--ui-server` | API server + built-in ChatGPT-style web UI |
440
- | `--server` | API server only (no web UI) |
458
+ | `--server` | API server. Bare: `0.0.0.0:8000`; or `host[:port]`, `file:///path`, `socket:///path`, `unix:///path` |
441
459
  | `--i` | Interactive CLI chat |
442
460
  | `--isq` | On-the-fly quantization: `q2k`, `q3k`, `q4k`, `q5k`, `q6k`, `q8_0` |
443
461
  | `--kvcache-dtype` | KV cache quantization: `fp8`, `turbo8`, `turbo4`, `turbo3` |
@@ -460,6 +478,17 @@ Constraint-based generation via llguidance — Lark grammars, regex, JSON Schema
460
478
  | `--mcp-config` | MCP servers JSON config |
461
479
  | `--mcp-command` / `--mcp-args` | Single MCP server command + args |
462
480
 
481
+ ### Environment Variables
482
+
483
+ | Variable | Description |
484
+ |---|---|
485
+ | `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. |
486
+
487
+ **Example (Blackwell with high-precision NVFP4 decode):**
488
+ ```bash
489
+ XINFER_NVFP4_FORCE_LUT=1 xinfer --m nvidia/Qwen3-30B-A3B-FP4 --ui-server
490
+ ```
491
+
463
492
  ---
464
493
 
465
494
  ## 📽️ Demo
@@ -477,6 +506,7 @@ Constraint-based generation via llguidance — Lark grammars, regex, JSON Schema
477
506
  * [x] OpenAI-compatible API (streaming support)
478
507
  * [x] Continuous batching
479
508
  * [x] Multi-gpu inference (Safetensors, GPTQ, AWQ, GGUF)
509
+ * [x] Multi-node tensor parallelism (TCP-based NCCL bootstrap, no MPI required)
480
510
  * [x] Speedup prompt processing on Metal/macOS
481
511
  * [x] Chunked Prefill
482
512
  * [x] Prefix cache (available on `CUDA` when `prefix-cache` enabled)
@@ -65,6 +65,52 @@ Reasoning defaults to enabled when a request omits `thinking` / `enable_thinking
65
65
  ```
66
66
  - **Graph capture**: CUDA graph is auto-enabled with `cuda` feature. Use `--disable-cuda-graph` at runtime to skip graph capture.
67
67
 
68
+ ## 4.1) Multi-node tensor parallelism
69
+
70
+ Distribute tensor-parallel inference across multiple machines via TCP-based NCCL bootstrap. Node 0 is the coordinator (runs scheduler + API); worker nodes run forward-only daemon loops.
71
+
72
+ **Requirements:**
73
+ - All nodes must have the same model weights available locally (same path or HuggingFace cache).
74
+ - All nodes must be reachable via TCP on the `--master-port` (default 29500) and `--master-port + 1` (forward coordination).
75
+ - Build with `--features cuda,nccl,flashinfer,cutlass` on all nodes.
76
+
77
+ **Example: 2 nodes × 4 GPUs = 8-way tensor parallelism**
78
+
79
+ ```bash
80
+ # Node 0 (master, at 192.168.1.100): runs scheduler + API server
81
+ xinfer --m /data/DeepSeek-R1/ --d 0,1,2,3 \
82
+ --num-nodes 2 --node-rank 0 \
83
+ --master-addr 192.168.1.100 --master-port 29500 \
84
+ --ui-server
85
+
86
+ # Node 1 (worker, at 192.168.1.101): runs forward-only daemon
87
+ xinfer --m /data/DeepSeek-R1/ --d 0,1,2,3 \
88
+ --num-nodes 2 --node-rank 1 \
89
+ --master-addr 192.168.1.100 --master-port 29500
90
+ ```
91
+
92
+ **How it works:**
93
+ 1. Node 0 generates a NCCL unique ID and distributes it to worker nodes via TCP.
94
+ 2. Each node spawns local runner subprocesses with global NCCL ranks (`node_rank × local_gpus + local_rank`).
95
+ 3. All ranks join a single global NCCL communicator for all-reduce / all-gather operations.
96
+ 4. Node 0 broadcasts forward-pass commands to worker nodes via TCP; NCCL synchronizes the actual tensor computations.
97
+ 5. Only node 0 runs the scheduler and API server; worker nodes are stateless forward engines.
98
+
99
+ **CLI flags:**
100
+ | Flag | Default | Description |
101
+ |------|---------|-------------|
102
+ | `--num-nodes` | 1 | Total number of nodes |
103
+ | `--node-rank` | 0 | This node's rank (0 = master) |
104
+ | `--master-addr` | _(required)_ | Master node's IP address |
105
+ | `--master-port` | 29500 | TCP port for NCCL bootstrap |
106
+
107
+ **NCCL environment variables** (optional tuning):
108
+ ```bash
109
+ export NCCL_IB_DISABLE=1 # Disable InfiniBand if unavailable
110
+ export NCCL_SOCKET_IFNAME=eth0 # Specify network interface
111
+ export NCCL_DEBUG=INFO # Enable NCCL debug logging
112
+ ```
113
+
68
114
  ## 5) PD Disaggregation (prefill/decoding split)
69
115
  - **PD server (prefill host, usually memory-rich)**
70
116
  ```bash
@@ -50,7 +50,7 @@ xinfer --m AxionML/Qwen3.5-4B-NVFP4 --kvcache-dtype turbo4 --ui-server
50
50
 
51
51
  ## 📊 Performance Notes
52
52
 
53
- - **HW NVFP4**: Hardware-accelerated FP4 on Blackwell (SM120, RTX 5090/B200)
53
+ - **HW NVFP4**: Hardware-accelerated FP4 on Blackwell: SM100 (B100/B200), SM120 (RTX 5090/RTX PRO 6000), and SM121 (DGX Spark)
54
54
  - **HW FP8**: Hardware-accelerated FP8 on Hopper (SM90, H800/H200)
55
55
  - **SW FP4/NVFP4**: Software-emulated FP4 on Hopper (SM90) and V100 (SM70)
56
56
  - V100 + NVFP4 + TurboQuant is a first-ever combination — no other engine has achieved this
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "xinfer-ai",
3
- "version": "0.13.2",
4
- "assetVersion": "0.13.2",
3
+ "version": "0.13.4",
4
+ "assetVersion": "0.13.4",
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",
@@ -75,11 +75,14 @@ function detectCudaComputeCap() {
75
75
 
76
76
  /**
77
77
  * Map detected SM version to the build variant name.
78
- * Build variants match CI matrix: sm70, sm75, sm80, sm89, sm90, sm120
78
+ * Build variants match CI matrix: sm70, sm75, sm80, sm89, sm90, sm100,
79
+ * sm120, and sm121 (GB10/DGX Spark).
79
80
  */
80
81
  function smToVariant(sm) {
81
82
  const n = parseInt(sm, 10);
83
+ if (n >= 121) return "sm121";
82
84
  if (n >= 120) return "sm120";
85
+ if (n >= 100) return "sm100";
83
86
  if (n >= 90) return "sm90";
84
87
  if (n >= 89) return "sm89";
85
88
  if (n >= 80) return "sm80";