Qwen3.8-27B QUASAR-NVFP4:最强 4-bit QAT 量化详解 + Mac M1 Max 64GB 完整安装指南
Qwen3.8-27B QUASAR-NVFP4: Best 4-bit QAT Quantization Deep Dive + Complete Mac M1 Max 64GB Install Guide
QUASAR-NVFP4 是什么,为什么值得关注
2026 年 8 月底,社区发布了 QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4——一个基于 量化感知训练(QAT) 的 Qwen3.8-27B 4bit 量化版本。
它为什么特别
普通 4bit 量化(PTQ,训练后量化)的做法是把训好的 BF16 权重直接四舍五入到 4bit,难免有信息损失。QUASAR 的方法不同:
BF16 原始模型(教师)
↓ 蒸馏训练,直接在 4bit 精度下学习
NVFP4 量化模型(学生)
↓ 完成后冻结
量化感知训练(QAT) 让模型在低精度环境下”练过”,权重不是被截断到 4bit,而是在 4bit 约束下被训练出来的。结果是:用更激进的量化,损失更少质量。
NVFP4 W4A4:全层量化,不留后路
这个版本最激进的地方:全部 496 个线性层都是 NVFP4(权重 4bit + 激活值 4bit),包括通常会因质量坍塌而保留在更高精度的 self-attention 层和 gated delta-net 层。
质量对比(来自官方基准):
| 模型 | 大小 | GPQA-Diamond | AIME26 |
|---|---|---|---|
| Qwen3.8-27B(BF16 原版) | 55.6 GB | 0.9141 | 1.0000 |
| QUASAR-NVFP4(本模型) | 19.7 GB | 0.9091 | 1.0000 |
| unsloth/Qwen3.8-27B-NVFP4 | 23.4 GB | 0.8939 | 0.9778 |
| Inferact/Qwen3.8-27B-NVFP4 | 26.4 GB | 0.8763 | 0.9667 |
结论:19.7GB,GPQA 只掉 0.5%,AIME 满分不变。比其他 NVFP4 版本小 20%,质量反而更高。这是量化技术的一个显著进步。
重要提醒:这个模型 Mac 跑不了
NVFP4(FP4 精度)需要 NVIDIA Blackwell 架构 GPU(compute capability 10.0+)。具体就是 RTX 5090 及以上,或 GB200 等数据中心卡。
Mac Apple Silicon(包括 M1、M2、M3、M4 全系列)的 Metal GPU 不支持 FP4 运算,无法运行这个格式。
用 vLLM 加载会直接报错,没有绕过办法。
但这不意味着 Mac 无法跑 Qwen3.8-27B——只是不能用 NVFP4 格式。下面给出 Mac M1 Max 64GB 的最佳替代方案。
Mac M1 Max 64GB 的选择
快速选型
| 方式 | 精度 | 大小 | 速度 | 推荐场景 |
|---|---|---|---|---|
| MLX 8bit | 8bit | ~28 GB | 最快(Apple 原生) | 首选 |
| MLX 4bit | 4bit | ~14 GB | 很快 | 显存紧张时 |
| GGUF Q8_0 (Ollama) | 8bit | ~29 GB | 快 | 需要 OpenAI API 兼容 |
| GGUF Q4_K_M (Ollama) | 4bit | ~16 GB | 快 | 需要 OpenAI API,显存省 |
| LM Studio GUI | 各精度 | 按选择 | 快 | 图形界面,不想用命令行 |
M1 Max 64GB 推荐:MLX 8bit,占用约 28GB,剩余 36GB 给系统和其他应用,速度最快。
方案一:MLX(推荐,Apple 原生最快)
MLX 是 Apple 专门为 Apple Silicon 设计的机器学习框架,能充分利用 M1 Max 的统一内存架构和 Neural Engine。
安装 mlx-lm
# 推荐在 venv 里安装
python3 -m venv ~/venvs/mlx
source ~/venvs/mlx/bin/activate
pip install mlx-lm
下载并运行(8bit,推荐)
# 下载模型(约 28GB,需要等一会儿)
# 模型保存在 ~/.cache/huggingface/hub/
mlx_lm.generate \
--model mlx-community/Qwen3.8-27B-8bit \
--prompt "你好,请介绍一下自己" \
--max-tokens 500 \
--temp 0.7
启动本地服务器(OpenAI API 兼容)
mlx_lm.server \
--model mlx-community/Qwen3.8-27B-8bit \
--host 0.0.0.0 \
--port 8080
然后就可以用任何支持 OpenAI API 的客户端连接 http://localhost:8080/v1。
可用的 MLX 模型
| 模型 | 精度 | 大小(估算) | 推荐指数 |
|---|---|---|---|
mlx-community/Qwen3.8-27B-8bit | 8bit | ~28 GB | ⭐⭐⭐⭐⭐(首选) |
mlx-community/Qwen3.8-27B-6bit | 6bit | ~20 GB | ⭐⭐⭐⭐ |
lmstudio-community/Qwen3.8-27B-MLX-4bit | 4bit | ~14 GB | ⭐⭐⭐ |
mlx-community/Qwen3.8-27B-OptiQ-4bit | 4bit(优化) | ~14 GB | ⭐⭐⭐⭐(4bit 最佳) |
脚本形式调用
from mlx_lm import load, generate
model, tokenizer = load("mlx-community/Qwen3.8-27B-8bit")
messages = [{"role": "user", "content": "解释一下量化感知训练和训练后量化的区别"}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
response = generate(model, tokenizer, prompt=prompt, max_tokens=1000, verbose=True)
print(response)
方案二:Ollama(OpenAI API 兼容,最容易)
Ollama 是最省事的本地模型运行方案,自动处理量化和内存管理,并提供完全兼容 OpenAI API 的接口。
安装 Ollama
# 官方安装脚本
curl -fsSL https://ollama.ai/install.sh | sh
# 或者 Homebrew
brew install ollama
运行 Qwen3.8-27B
# 官方 Ollama 库版本(自动选择合适量化)
ollama run qwen3.8:27b
# 或者指定 GGUF 文件:先创建 Modelfile
cat > Modelfile << 'EOF'
FROM unsloth/Qwen3.8-27B-GGUF:Q8_0
PARAMETER num_ctx 32768
PARAMETER temperature 0.7
SYSTEM "你是一个有帮助的AI助手。"
EOF
ollama create qwen38-27b-q8 -f Modelfile
ollama run qwen38-27b-q8
Ollama 服务 + OpenAI API
# 启动服务(默认 11434 端口)
ollama serve
# 测试
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8:27b",
"messages": [{"role": "user", "content": "你好"}]
}'
推荐 GGUF 规格(M1 Max 64GB)
| 规格 | 大小 | 质量 | 适合场景 |
|---|---|---|---|
| Q8_0 | ~29 GB | 接近 BF16 | 最高质量,64GB 完全够 |
| Q6_K | ~22 GB | 很好 | 留更多内存给上下文 |
| Q4_K_M | ~16 GB | 好 | 长上下文时推荐 |
GGUF 推荐来源:unsloth/Qwen3.8-27B-GGUF(下载量 935 万,最可靠)
方案三:LM Studio(图形界面,最友好)
如果不想用命令行,LM Studio 是最简单的选择。
安装
从 lmstudio.ai 下载 Mac 版(Apple Silicon 优化版)。
下载模型
- 打开 LM Studio → 搜索框输入
Qwen3.8-27B - 选择
lmstudio-community/Qwen3.8-27B-MLX-8bit(MLX 格式,最快) - 或选择
lmstudio-community/Qwen3.8-27B-GGUF下载 Q8_0 规格 - 点击下载,等待完成
- 在 Chat 或 Server 模式下使用
LM Studio 的 Server 模式同样提供 OpenAI API 兼容接口(http://localhost:1234/v1)。
M1 Max 64GB 性能预期
以下是 Apple Silicon 上 Qwen3.8-27B 的大致推理速度参考:
| 精度 | M1 Max 64GB | M4 Max 64GB |
|---|---|---|
| MLX 8bit | ~15-20 tok/s | ~30-35 tok/s |
| MLX 4bit | ~25-35 tok/s | ~45-55 tok/s |
| GGUF Q8_0 | ~12-18 tok/s | ~25-30 tok/s |
M1 Max 有 400 GB/s 内存带宽。27B 8bit 模型跑 15-20 tok/s,日常对话够用。
回到 QUASAR:QAT 方法的意义
QUASAR(arXiv:2608.13966)的核心技术是 Loss-Aware Reconstruction(损失感知重建):量化时不只最小化权重误差,同时优化下游任务损失,让量化后的模型行为更接近原始模型。
对我们来说,这篇论文给出了一个重要参考:Qwen3.8-27B 在 4bit 量化下损失极小。这也意味着 Mac 上的 MLX 4bit 版本,质量并不差——本质上享受同样的模型能力,只是换了量化格式和推理引擎。
QUASAR NVFP4 是 NVIDIA 生态的最优解,MLX 4/8bit 是 Apple Silicon 的对应最优解。
快速汇总
QUASAR NVFP4 本身:不支持 Mac,需要 NVIDIA Blackwell(RTX 5090+)。
Mac M1 Max 64GB 最推荐方案:
# 一行安装最推荐版本
pip install mlx-lm
mlx_lm.generate --model mlx-community/Qwen3.8-27B-8bit --prompt "你好"
- 最快 + 最高质量 → MLX 8bit:
mlx-community/Qwen3.8-27B-8bit - 需要 API 兼容 → Ollama Q8_0:
unsloth/Qwen3.8-27B-GGUF(Q8_0 spec) - 图形界面 → LM Studio + MLX 8bit
QUASAR 论文:arXiv:2608.13966
原始模型:QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
MLX(推荐):mlx-community/Qwen3.8-27B-8bit
GGUF:unsloth/Qwen3.8-27B-GGUF
What Is QUASAR-NVFP4 and Why It Matters
In late August 2026, the community released QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4 — a Quantization-Aware Training (QAT) based 4-bit quantized version of Qwen3.8-27B.
Why It’s Special
Ordinary 4-bit quantization (PTQ — post-training quantization) rounds trained BF16 weights down to 4-bit after training, inevitably losing information. QUASAR works differently:
BF16 original model (teacher)
↓ distillation training, learns directly under 4-bit constraints
NVFP4 quantized model (student)
↓ frozen when done
Quantization-Aware Training (QAT) means weights are not truncated to 4-bit but trained under 4-bit constraints. The model adapts to the low-precision environment during training, recovering more quality than rounding after the fact.
NVFP4 W4A4: Full-Layer Quantization
The most aggressive aspect: all 496 linear layers are NVFP4 (W4A4) — weights AND activations at 4-bit, including self-attention and gated delta-net layers that normally cause quality collapse at NVFP4 and are kept in higher precision.
Quality comparison (official benchmarks):
| Model | Size | GPQA-Diamond | AIME26 |
|---|---|---|---|
| Qwen3.8-27B (BF16 original) | 55.6 GB | 0.9141 | 1.0000 |
| QUASAR-NVFP4 (this model) | 19.7 GB | 0.9091 | 1.0000 |
| unsloth/Qwen3.8-27B-NVFP4 | 23.4 GB | 0.8939 | 0.9778 |
| Inferact/Qwen3.8-27B-NVFP4 | 26.4 GB | 0.8763 | 0.9667 |
Result: 19.7 GB. GPQA drops only 0.5%, AIME remains perfect. 20% smaller than competing NVFP4 builds, higher quality. A meaningful step forward in quantization engineering.
Important: This Model Cannot Run on Mac
NVFP4 (FP4 precision) requires an NVIDIA Blackwell architecture GPU (compute capability 10.0+) — specifically RTX 5090+ or data center cards like GB200.
Mac Apple Silicon (M1/M2/M3/M4 all variants) Metal GPU does not support FP4 operations. Loading with vLLM will error immediately; there’s no workaround.
But Qwen3.8-27B itself runs beautifully on Mac — just in a different format. Here’s the complete guide for M1 Max 64GB.
Mac M1 Max 64GB: Your Options
Quick Selection Guide
| Method | Precision | Size | Speed | Recommended For |
|---|---|---|---|---|
| MLX 8bit | 8bit | ~28 GB | Fastest (native Apple) | First choice |
| MLX 4bit | 4bit | ~14 GB | Very fast | Tighter memory budget |
| GGUF Q8_0 (Ollama) | 8bit | ~29 GB | Fast | OpenAI API compatibility |
| GGUF Q4_K_M (Ollama) | 4bit | ~16 GB | Fast | API + long context |
| LM Studio GUI | Various | By choice | Fast | No CLI |
With M1 Max 64GB: MLX 8bit is the top recommendation — uses ~28GB, leaves 36GB free, fastest inference on Apple Silicon.
Option 1: MLX (Recommended — Apple Native)
MLX is Apple’s machine learning framework built for Apple Silicon, using unified memory and Neural Engine efficiently.
Install mlx-lm
python3 -m venv ~/venvs/mlx
source ~/venvs/mlx/bin/activate
pip install mlx-lm
Download and Run (8bit, recommended)
mlx_lm.generate \
--model mlx-community/Qwen3.8-27B-8bit \
--prompt "Hello, please introduce yourself" \
--max-tokens 500 \
--temp 0.7
Start Local Server (OpenAI API compatible)
mlx_lm.server \
--model mlx-community/Qwen3.8-27B-8bit \
--host 0.0.0.0 \
--port 8080
Connect any OpenAI-compatible client to http://localhost:8080/v1.
Available MLX Models
| Model | Precision | Est. Size | Rating |
|---|---|---|---|
mlx-community/Qwen3.8-27B-8bit | 8bit | ~28 GB | ⭐⭐⭐⭐⭐ (top pick) |
mlx-community/Qwen3.8-27B-6bit | 6bit | ~20 GB | ⭐⭐⭐⭐ |
mlx-community/Qwen3.8-27B-OptiQ-4bit | 4bit (optimized) | ~14 GB | ⭐⭐⭐⭐ (best 4bit) |
lmstudio-community/Qwen3.8-27B-MLX-4bit | 4bit | ~14 GB | ⭐⭐⭐ |
Python API
from mlx_lm import load, generate
model, tokenizer = load("mlx-community/Qwen3.8-27B-8bit")
messages = [{"role": "user", "content": "Explain QAT vs PTQ quantization"}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
response = generate(model, tokenizer, prompt=prompt, max_tokens=1000, verbose=True)
print(response)
Option 2: Ollama (Easiest — OpenAI API Compatible)
Ollama handles quantization and memory management automatically, with a fully OpenAI-compatible API.
Install
curl -fsSL https://ollama.ai/install.sh | sh
# or
brew install ollama
Run Qwen3.8-27B
# Official registry (auto-selects quantization)
ollama run qwen3.8:27b
# Custom GGUF (recommended for M1 Max 64GB — use Q8_0)
cat > Modelfile << 'EOF'
FROM unsloth/Qwen3.8-27B-GGUF:Q8_0
PARAMETER num_ctx 32768
PARAMETER temperature 0.7
SYSTEM "You are a helpful assistant."
EOF
ollama create qwen38-27b-q8 -f Modelfile
ollama run qwen38-27b-q8
API Usage
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8:27b",
"messages": [{"role": "user", "content": "Hello"}]
}'
GGUF Spec Recommendations (M1 Max 64GB)
| Spec | Size | Quality | Best For |
|---|---|---|---|
| Q8_0 | ~29 GB | Near BF16 | Maximum quality |
| Q6_K | ~22 GB | Excellent | Balance with context |
| Q4_K_M | ~16 GB | Good | Long context workloads |
Best GGUF source: unsloth/Qwen3.8-27B-GGUF (9.35M downloads, most reliable).
Option 3: LM Studio (Graphical — Most Beginner-Friendly)
Download from lmstudio.ai (Apple Silicon native build).
- Search
Qwen3.8-27Bin the model browser - Download
lmstudio-community/Qwen3.8-27B-MLX-8bit(MLX format, fastest) - Or download
lmstudio-community/Qwen3.8-27B-GGUF→ select Q8_0 spec - Use in Chat mode, or enable Server mode for OpenAI API at
http://localhost:1234/v1
Expected Performance on M1 Max 64GB
| Precision | M1 Max 64GB | M4 Max 64GB |
|---|---|---|
| MLX 8bit | ~15–20 tok/s | ~30–35 tok/s |
| MLX 4bit | ~25–35 tok/s | ~45–55 tok/s |
| GGUF Q8_0 | ~12–18 tok/s | ~25–30 tok/s |
M1 Max has 400 GB/s memory bandwidth. At 15-20 tok/s for 8bit, it’s comfortable for daily use.
The Bigger Picture: QAT’s Message for Mac Users
QUASAR (arXiv:2608.13966) uses Loss-Aware Reconstruction: during quantization, it optimizes not just weight error but downstream task loss, keeping the quantized model’s behavior closer to the original.
The key takeaway for Mac users: Qwen3.8-27B loses very little quality even at 4-bit quantization. The MLX 4/8bit versions on Mac access the same underlying model capability — just through a different quantization format and inference engine.
QUASAR NVFP4 is the optimal solution for the NVIDIA ecosystem. MLX 4/8bit is the parallel optimal solution for Apple Silicon.
QUASAR Paper: arXiv:2608.13966
NVFP4 Model (NVIDIA only): QUASAR-QAT/Qwen3.8-27B-QUASAR-NVFP4
MLX (Mac recommended): mlx-community/Qwen3.8-27B-8bit
GGUF (Ollama/LM Studio): unsloth/Qwen3.8-27B-GGUF
关于本站 · 免责声明
🍄 Mushroom Research Blog 是非营利、免费公开的个人科技观察博客与公众号 XStack18,不接受商业合作、不代表任何企业或机构立场,也不谋求商业利益。我们以个人视角客观中立地记录和分析 AI、Web3 等领域的最新模型发布与技术动态——不止转述新闻标题或二手信息,而是给出有独立思考的深入分析,希望帮更多人获得有价值的一手科技认知。
⚠️ 文中介绍的开源代码与模型,仅供学习交流与技术借鉴。它们大多仍处于早期阶段,有待进一步研究和验证,请勿直接用于工作或生产环境;如需采用,请先自行充分测试,并核实其许可证与安全性。
Open-source code and models featured here are shared for learning and reference only. Most are early-stage and still need further study and verification — please don't use them directly in your work or in production. Test them thoroughly and check their licenses and security first.
- 本站文章均为作者基于公开信息的个人研究与观点整理,不代表文中提及的任何公司、产品、模型的官方立场,未与其构成商业关联或合作关系。
- 科技行业信息更新极快,我们尽力保证内容准确、及时,但不对完整性、实时性做绝对保证,具体请以相关企业/项目官方公告为准。
- 文中引用的第三方商标、产品名称、图片、数据等版权归原权利人所有,我们会尽量注明来源;如你认为存在版权疑问或侵权,请通过下方邮箱联系我们,收到通知后会尽快核实处理(更正、加注来源或删除)。
- 文章内容仅为技术科普与个人观点,不构成投资、法律或其他专业建议,据此进行任何决策的后果需自行判断和承担。
📮 侵权 / 勘误 / 合作咨询:hello@mushroom.cv
💬 评论与讨论
使用 GitHub 账号登录后发表评论