xinfer-ai 0.13.3 → 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 +20 -1
- package/docs/get_started.md +46 -0
- package/package.json +2 -2
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
|
|
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` |
|
|
@@ -488,6 +506,7 @@ XINFER_NVFP4_FORCE_LUT=1 xinfer --m nvidia/Qwen3-30B-A3B-FP4 --ui-server
|
|
|
488
506
|
* [x] OpenAI-compatible API (streaming support)
|
|
489
507
|
* [x] Continuous batching
|
|
490
508
|
* [x] Multi-gpu inference (Safetensors, GPTQ, AWQ, GGUF)
|
|
509
|
+
* [x] Multi-node tensor parallelism (TCP-based NCCL bootstrap, no MPI required)
|
|
491
510
|
* [x] Speedup prompt processing on Metal/macOS
|
|
492
511
|
* [x] Chunked Prefill
|
|
493
512
|
* [x] Prefix cache (available on `CUDA` when `prefix-cache` enabled)
|
package/docs/get_started.md
CHANGED
|
@@ -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
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xinfer-ai",
|
|
3
|
-
"version": "0.13.
|
|
4
|
-
"assetVersion": "0.13.
|
|
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",
|