FastInference 是面向单 GPU 的 lite-only 大模型推理运行时:纯 Python + Triton, 以 AMD ROCm 为首要优化目标,并在同一路径可用时保持 CUDA 兼容。
项目源自 vLLM,但已经替换了主要执行引擎、调度、KV cache、模型适配和
kernel 路径。保留 vllm Python import 名是兼容选择,不代表 FastInference
支持上游 vLLM 的完整模型、分布式 runtime、CLI 或部署能力。
- 单进程、单 GPU 的
LiteEngine是唯一正式执行路径; vllm/engine/负责控制面,vllm/adapters/负责模型能力与策略;vllm/model_executor/和vllm/kernels/triton/负责模型与 GPU 数据面;- 不维护 C++/CUDA extension、多 GPU distributed worker、pooling、gRPC 或 speculative decoding;
- 模型与功能的准确状态以 Capability Matrix 为准。
完整分层、请求生命周期、Paged KV cache 和模型专用数据面见 Lite Architecture。
| 模型 | 状态 | 范围 |
|---|---|---|
| TinyLlama-1.1B | Supported | 基础文本与严格语义回归 |
| Gemma4 E4B symmetric QAT | Supported | text-only;对称 INT4 checkpoint |
| Gemma4 26B-A4B AWQ | Supported | text + image quality gates |
| Gemma4 31B AWQ | Supported | text + image quality gates |
| Gemma4 12B AWQ | Experimental | 已维护正确性 envelope,未承诺广泛 batching |
| DeepSeek V4 Flash target GGUF | Experimental | 目标 DS4 Q2/IQ2 文件的专用数据面 |
这里的状态不是“目录里存在代码”的推断,而是由默认或明确记录的模型回归 门禁确定。完整 checkpoint、格式和限制见 Supported Models。
要求 Linux、Python 3.12、uv 和一张 ROCm/CUDA GPU。
uv sync
bash tests/run_regression_suite.sh离线推理:
from vllm import LLM, SamplingParams
llm = LLM(model="models/TinyLlama-1.1B-Chat-v1.0")
outputs = llm.generate(
["The capital of France is"],
SamplingParams(temperature=0, max_tokens=16),
)
print(outputs[0].outputs[0].text)OpenAI-compatible 服务:
uv run python -m vllm.entrypoints.openai.api_server \
--model models/gemma-4-E4B-it-qat-w4a16-ct \
--host 0.0.0.0 \
--port 8000公共配置入口是 FASTINFERENCE_CONFIG,它指向 TOML 文件:
profile = "balanced"
kv_type = "fp8"
[tuning_keyvals]
FASTINFERENCE_KV_MAX_ACTIVE_REQUESTS = "1"
FASTINFERENCE_KV_MAX_MODEL_LEN = "512"模型层通过 attn_metadata["config"] 获取已解析配置。旧的
FASTINFERENCE_* tuning 环境变量仅用于兼容或工具,不是新增生产接口。
生产 profile 为 balanced、latency 和 throughput;auto 解析为稳定的
默认策略。benchmark 与 accuracy 用于基准和正确性诊断,不是生产服务
profile。
# 不加载完整模型的结构/单元回归
bash tests/run_regression_suite.sh
# 本地 checkpoint 正确性门禁
bash tests/run_inference_correctness_regression.sh
# 隔离端到端基准
uv run python tests/e2e_full_benchmark.py --model-process-isolation性能数字与硬件、checkpoint、runtime profile、并发和 warmup 强相关;历史报告 不自动代表当前版本。新的性能结论必须保留 fingerprint、production dispatch 命中和受控 A/B 证据。
- Documentation Index
- Lite Architecture
- Capability Matrix
- API Reference
- Inference Accuracy
- Dependency Boundary
- Contributing
FastInference 保留了 vLLM 的 Git 历史,以满足来源追踪、许可证和代码演进审计。 因此 Git 托管平台可能把上游 vLLM 的历史贡献者计入仓库统计;该数字不是 FastInference 独立开发者数量,本项目不声明贡献者人数。
衍生文件中的 vLLM SPDX/copyright 行继续用于正确归属。FastInference 当前 代码和文档由本仓库贡献者维护,许可证见 LICENSE。