amd / gemma-4-31B-it-MXFP4

huggingface.co
Total runs: 688
24-hour runs: 304
7-day runs: 227
30-day runs: 239
Model's Last Updated: July 31 2026
image-text-to-text

Introduction of gemma-4-31B-it-MXFP4

Model Details of gemma-4-31B-it-MXFP4

Model Overview
  • Base model: google/gemma-4-31B-it
  • Model architecture: Gemma4ForConditionalGeneration (text-only eval uses Gemma4ForCausalLM override)
  • Quantizer: AMD Quark
  • Quantization scheme: mxfp4
  • Weight quantization: FP4, per-group (MX format)
  • Activation quantization: FP4, dynamic, per-group (MX format)
  • Export format: Hugging Face safetensors ( quant_method=quark )
  • Excluded from quantization: vision tower, multimodal projector, lm_head
Runtime Environment

This workflow is intended to run on AMD Instinct MI355 .

Start Docker Container
docker run -it -d \
  --name vllm-gemma4-openai \
  --ipc=host \
  --shm-size=64g \
  --network=host \
  --privileged \
  --cap-add=CAP_SYS_ADMIN \
  --device=/dev/kfd \
  --device=/dev/dri \
  --device=/dev/mem \
  --cap-add=SYS_PTRACE \
  --security-opt seccomp=unconfined \
  --entrypoint /bin/bash \
  -v /shareddata:/shareddata -v /mnt:/mnt -v /data:/data -v /home/:/home -v /raid:/raid -v /docker:/docker -v /datasets:/datasets -v /scratch:/scratch -v /group:/group \
vllm/vllm-openai-rocm:gemma4
Quantization

Run quantization inside Docker image vllm/vllm-openai-rocm:gemma4 .

Minimal quantization code
from quark.common.profiler import GlobalProfiler
from quark.torch import LLMTemplate, ModelQuantizer

ckpt_path = "google/gemma-4-31B-it"
output_dir = "/path/to/amd/gemma-4-31B-it-mxfp4"

exclude_layers = ["*vision_tower*", "*multi_modal_projector*", "*lm_head"]

if "gemma4" not in LLMTemplate.list_available():
    gemma4_template = LLMTemplate(
        model_type="gemma4",
        kv_layers_name=["*language_model.*k_proj", "*language_model.*v_proj"],
        q_layer_name="*language_model.*q_proj",
        exclude_layers_name=exclude_layers,
    )
    LLMTemplate.register_template(gemma4_template)

template = LLMTemplate.get("gemma4")
quant_config = template.get_config(
    scheme="mxfp4",
    exclude_layers=exclude_layers,
)

profiler = GlobalProfiler(output_path=f"{output_dir}/quark_profile.yaml")
quantizer = ModelQuantizer(quant_config)
quantizer.direct_quantize_checkpoint(
    pretrained_model_path=ckpt_path,
    save_path=output_dir,
)
Evaluation
Reproduction command
CUDA_VISIBLE_DEVICES=6,7 lm_eval run \
  --model vllm \
  --tasks gsm8k \
  --model_args '{"pretrained":"amd/gemma-4-31B-it-mxfp4","tensor_parallel_size":2,"max_model_len":16384,"gpu_memory_utilization":0.90,"max_gen_toks":2048,"trust_remote_code":true,"chat_template":"/scratch/kewang/workspace/vllm/examples/tool_chat_template_gemma4.jinja","reasoning_parser":"gemma4","hf_overrides":{"architectures":["Gemma4ForCausalLM"]}}' \
  --num_fewshot 5 \
  --batch_size auto \
  --apply_chat_template
Accuracy

The following GSM8K results are from local runs in this workspace.

Benchmark Metric google/gemma-4-31B-it amd/gemma-4-31B-it-mxfp4
gsm8k exact_match (flexible-extract) 92.65 91.74
gsm8k exact_match (strict-match) 92.27 91.36
License

This checkpoint is derived from google/gemma-4-31B-it . Please follow the upstream model license and usage terms.

Runs of amd gemma-4-31B-it-MXFP4 on huggingface.co

688
Total runs
304
24-hour runs
323
3-day runs
227
7-day runs
239
30-day runs

More Information About gemma-4-31B-it-MXFP4 huggingface.co Model

More gemma-4-31B-it-MXFP4 license Visit here:

https://choosealicense.com/licenses/apache-2.0

gemma-4-31B-it-MXFP4 huggingface.co

gemma-4-31B-it-MXFP4 huggingface.co is an AI model on huggingface.co that provides gemma-4-31B-it-MXFP4's model effect (), which can be used instantly with this amd gemma-4-31B-it-MXFP4 model. huggingface.co supports a free trial of the gemma-4-31B-it-MXFP4 model, and also provides paid use of the gemma-4-31B-it-MXFP4. Support call gemma-4-31B-it-MXFP4 model through api, including Node.js, Python, http.

gemma-4-31B-it-MXFP4 huggingface.co Url

https://huggingface.co/amd/gemma-4-31B-it-MXFP4

amd gemma-4-31B-it-MXFP4 online free

gemma-4-31B-it-MXFP4 huggingface.co is an online trial and call api platform, which integrates gemma-4-31B-it-MXFP4's modeling effects, including api services, and provides a free online trial of gemma-4-31B-it-MXFP4, you can try gemma-4-31B-it-MXFP4 online for free by clicking the link below.

amd gemma-4-31B-it-MXFP4 online free url in huggingface.co:

https://huggingface.co/amd/gemma-4-31B-it-MXFP4

gemma-4-31B-it-MXFP4 install

gemma-4-31B-it-MXFP4 is an open source model from GitHub that offers a free installation service, and any user can find gemma-4-31B-it-MXFP4 on GitHub to install. At the same time, huggingface.co provides the effect of gemma-4-31B-it-MXFP4 install, users can directly use gemma-4-31B-it-MXFP4 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

gemma-4-31B-it-MXFP4 install url in huggingface.co:

https://huggingface.co/amd/gemma-4-31B-it-MXFP4

Url of gemma-4-31B-it-MXFP4

gemma-4-31B-it-MXFP4 huggingface.co Url

Provider of gemma-4-31B-it-MXFP4 huggingface.co

amd
ORGANIZATIONS

Other API from amd

huggingface.co

Total runs: 206.9K
Run Growth: 18.5K
Growth Rate: 8.45%
Updated:April 14 2026
huggingface.co

Total runs: 65.9K
Run Growth: -45.4K
Growth Rate: -64.95%
Updated:July 17 2026
huggingface.co

Total runs: 55.9K
Run Growth: 10.9K
Growth Rate: 18.36%
Updated:July 01 2026
huggingface.co

Total runs: 43.1K
Run Growth: -50.7K
Growth Rate: -108.64%
Updated:June 19 2026
huggingface.co

Total runs: 9.2K
Run Growth: -2.9K
Growth Rate: -31.83%
Updated:October 09 2024
huggingface.co

Total runs: 6.8K
Run Growth: -3.9K
Growth Rate: -53.01%
Updated:August 12 2025
huggingface.co

Total runs: 5.6K
Run Growth: -17.7K
Growth Rate: -320.79%
Updated:July 27 2026
huggingface.co

Total runs: 1.5K
Run Growth: 831
Growth Rate: 85.67%
Updated:June 15 2026
huggingface.co

Total runs: 1.5K
Run Growth: 1.5K
Growth Rate: 92.96%
Updated:June 26 2025
huggingface.co

Total runs: 1.1K
Run Growth: 629
Growth Rate: 56.41%
Updated:January 22 2026
huggingface.co

Total runs: 1.0K
Run Growth: -1.6K
Growth Rate: -141.72%
Updated:June 19 2026
huggingface.co

Total runs: 988
Run Growth: -119
Growth Rate: -11.24%
Updated:May 27 2026
huggingface.co

Total runs: 986
Run Growth: 327
Growth Rate: 37.85%
Updated:June 19 2026
huggingface.co

Total runs: 872
Run Growth: 501
Growth Rate: 54.28%
Updated:November 03 2025
huggingface.co

Total runs: 598
Run Growth: 454
Growth Rate: 76.05%
Updated:July 22 2026
huggingface.co

Total runs: 561
Run Growth: 477
Growth Rate: 85.48%
Updated:June 06 2025
huggingface.co

Total runs: 533
Run Growth: 5
Growth Rate: 0.95%
Updated:November 15 2025