Text Generation
Transformers
Safetensors
qwen3_5_text
fp8
per-channel
w8a8
quantized
not-finetuned
conversational
compressed-tensors
Instructions to use hangxian/Qwen3.5-27B-FP8-PerChannel with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hangxian/Qwen3.5-27B-FP8-PerChannel with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hangxian/Qwen3.5-27B-FP8-PerChannel") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hangxian/Qwen3.5-27B-FP8-PerChannel") model = AutoModelForCausalLM.from_pretrained("hangxian/Qwen3.5-27B-FP8-PerChannel", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hangxian/Qwen3.5-27B-FP8-PerChannel with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hangxian/Qwen3.5-27B-FP8-PerChannel" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hangxian/Qwen3.5-27B-FP8-PerChannel", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hangxian/Qwen3.5-27B-FP8-PerChannel
- SGLang
How to use hangxian/Qwen3.5-27B-FP8-PerChannel with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "hangxian/Qwen3.5-27B-FP8-PerChannel" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hangxian/Qwen3.5-27B-FP8-PerChannel", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "hangxian/Qwen3.5-27B-FP8-PerChannel" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hangxian/Qwen3.5-27B-FP8-PerChannel", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use hangxian/Qwen3.5-27B-FP8-PerChannel with Docker Model Runner:
docker model run hf.co/hangxian/Qwen3.5-27B-FP8-PerChannel
Qwen3.5-27B-FP8-PerChannel
⚠️ 重要说明
- 来源模型:
Qwen/Qwen3.5-27B(官方 BF16 原版) - 权重未做任何修改: 本模型是纯量化版本,未经过任何微调、蒸馏或去审查处理,权重数值与官方原版完全一致
- 量化方式: per-channel FP8(每列一个 scale)+ dynamic activation(每次推理在线量化激活)
- 量化工具: llmcompressor,scheme=FP8_DYNAMIC
量化配置
{
"quant_method": "compressed-tensors",
"config_groups": {
"group_0": {
"weights": {
"strategy": "channel",
"num_bits": 8,
"type": "float",
"dynamic": false
},
"input_activations": {
"strategy": "token",
"num_bits": 8,
"type": "float",
"dynamic": true
}
}
}
}
与官方 FP8 版本的区别
| 本模型 | Qwen/Qwen3.5-27B-FP8(官方) | |
|---|---|---|
| 权重来源 | 官方原版,未修改 | 官方原版,未修改 |
| 权重量化粒度 | per-channel | block 128×128 |
| 激活量化 | dynamic | dynamic |
| SGLang GEMM 后端 | sgl_kernel.fp8_scaled_mm (CUTLASS) |
DeepGEMM / Triton |
| 实测性能 (H20, 4k/4k, c=1) | ~160 tok/s | ~108 tok/s (DeepGEMM) |
per-channel 版本在 decode 阶段(batch=1)比 block-wise 版本快约 50%,因为 per-channel 的 scale 处理更简单,GEMM kernel 开销更小。
模型文件
- 模型大小: 28GB
- 权重格式: safetensors (单文件)
- 量化前模型大小: 52GB (BF16)
- 压缩比: ~1.86x
推理使用方法
方式一: 直接使用本预量化模型
python3 -m sglang.launch_server \
--model-path hangxian/Qwen3.5-27B-FP8-PerChannel \
--tp 1 \
--host 0.0.0.0 \
--port 30000
方式二: 使用原始 BF16 模型 + 动态量化(效果相同)
python3 -m sglang.launch_server \
--model-path Qwen/Qwen3.5-27B \
--quantization fp8 \
--tp 1 \
--host 0.0.0.0 \
--port 30000
两种方式在推理时效果完全一致,区别仅在于本模型预先将 FP8 权重存储在磁盘上,方式二在加载时在线量化。
适用场景
- 需要减少显存占用(从 52GB 降至 28GB)
- 需要提升 decode 吞吐(比 BF16 快约 50%)
- 对精度要求可接受 per-channel FP8 的轻微损失
License
Apache 2.0(与原模型一致)
- Downloads last month
- 28
Model tree for hangxian/Qwen3.5-27B-FP8-PerChannel
Base model
Qwen/Qwen3.5-27B