---
title: gemma-4-31B-it-w4a4-mxfp4
canonical_url: "https://www.modelscope.cn/models/Eco-Tech/gemma-4-31B-it-w4a4-mxfp4"
md_url: "https://www.modelscope.cn/models/Eco-Tech/gemma-4-31B-it-w4a4-mxfp4.md"
repository: Eco-Tech/gemma-4-31B-it-w4a4-mxfp4
last_updated: 2026-10-13
license: apache-2.0
pipeline_tag: image-text-to-text
tasks:
  - image-text-to-text
model_type:
  - gemma4
architectures:
  - Gemma4ForConditionalGeneration
base_model:
  - google/gemma-4-31B-it
base_model_relation: quantized
parameters: 24.2B
tensor_type:
  - F32
  - U8
  - F8_E4M3
  - BF16
library_name:
  - safetensors
  - pytorch
frameworks:
  - PyTorch
downloads: 21
stars: 1
---

# gemma-4-31B-it-w4a4-mxfp4

> gemma-4-31B-it-w4a4-mxfp4 - Eco-Tech 在 ModelScope 开源的模型。gemma-4-31B-it-w4a4-mxfp4

Eco-Tech/gemma-4-31B-it-w4a4-mxfp4 是 ModelScope 魔搭社区上的 24.2B 参数image-text-to-text模型，采用 apache-2.0 许可，基于 google/gemma-4-31B-it 构建。

- **Repository**: Eco-Tech/gemma-4-31B-it-w4a4-mxfp4
- **License**: apache-2.0
- **Tasks**: image-text-to-text
- **Parameters**: 24.2B
- **Base model**: google/gemma-4-31B-it
- **Downloads**: 21
- **Stars**: 1
- **Last updated**: 2026-10-13

Source: https://www.modelscope.cn/models/Eco-Tech/gemma-4-31B-it-w4a4-mxfp4

---

# gemma-4-31B-it-w4a4-mxfp4

## 1. 基本信息

| 项目 | 信息 |
|:---:|:---:|
| 原始模型名 | gemma-4-31B-it |
| 原始模型链接 | [google/gemma-4-31B-it](https://www.modelscope.cn/models/google/gemma-4-31B-it) |
| 量化格式 | W4A4 MXFP4（配置中注意力及视觉塔使用 MXFP8，MLP 主体使用 MXFP4） |
| msModelSlim commit id | 002bbb6fb972e3d27897bea252ad8addf48877e5 |
| 精度测试机型 | A5 1台（8 × Ascend 950DT） |
| 精度测试平台 | Docker + vLLM Ascend |
| 版本 | v0.30.0rc1-a5 |
| 链接 | quay.io/ascend/vllm-ascend:v0.30.0rc1-a5 |

## 2. 量化脚本

该量化实践需要 `transformers==5.5.3`：

```bash
pip install transformers==5.5.3
```

本仓库提供的 `gemma-4-31B-it_best_practice.yaml` 与 msModelSlim 中的
`lab_practice/gemma4/gemma4_mxfp8_mxfp4.yaml` 配方对应。可使用以下一键量化命令：

```bash
# 用于 vLLM Ascend 部署
msmodelslim quant \
  --model_path ${MODEL_PATH} \
  --save_path ${SAVE_PATH} \
  --device npu \
  --model_type gemma-4-31B-it \
  --quant_type w4a4 \
  --trust_remote_code True
```

## 3. 精度测试结果

| 模型名 | 量化格式 | 数据集 | 测试精度 % | 官方精度 % |
|:---:|:---:|:---:|:---:|:---:|
| gemma-4-31B-it-w4a4-mxfp4 | W4A4 MXFP4 | GPQA-D | 84.34 | 84.3 |

* 官方精度取自原始模型 `google/gemma-4-31B-it` 的 GPQA Diamond 结果。
* 精度存在波动，建议多次测试。
