Granite-4.0-h-small

Model Overview

  • Model Architecture: GraniteMoeHybridForCausalLM
    • Input: Text
    • Output: Text
  • Model Optimizations:
    • Weight quantization: FP8
    • Activation quantization: FP8
  • Release Date:
  • Version: 1.0
  • Model Developers:: Red Hat

Quantized version of ibm-granite/granite-4.0-h-small.

Model Optimizations

This model was obtained by quantizing the weights and activations of ibm-granite/granite-4.0-h-small to FP8 data type. This optimization reduces the number of bits per parameter from 16 to 8, reducing the disk size and GPU memory requirements by approximately 50%. Only the weights and activations of the linear operators within transformers blocks of the language model are quantized.

Deployment

Use with vLLM

  1. Initialize vLLM server:
vllm serve RedHatAI/granite-4.0-h-small-FP8-block --tensor_parallel_size 1
  1. Send requests to the server:
from openai import OpenAI

# Modify OpenAI's API key and API base to use vLLM's API server.
openai_api_key = "EMPTY"
openai_api_base = "http://<your-server-host>:8000/v1"

client = OpenAI(
    api_key=openai_api_key,
    base_url=openai_api_base,
)

model = "RedHatAI/granite-4.0-h-small-FP8-block"

messages = [
    {"role": "user", "content": "Explain quantum mechanics clearly and concisely."},
]


outputs = client.chat.completions.create(
    model=model,
    messages=messages,
)

generated_text = outputs.choices[0].message.content
print(generated_text)

Evaluation

The model was evaluated on the OpenLLM leaderboard task, using lm-evaluation-harness. vLLM was used for all evaluations.

Evaluation details

Openllm V1

lm_eval \
  --model vllm \
  --model_args pretrained="RedHatAI/granite-4.0-h-small-FP8-block",dtype=auto,add_bos_token=True,max_model_len=16384,tensor_parallel_size=1,gpu_memory_utilization=0.9,enable_chunked_prefill=True,trust_remote_code=True \
  --tasks openllm \
  --write_out \
  --batch_size auto \
  --show_config

Openllm V2

lm_eval \
  --model vllm \
  --model_args pretrained="RedHatAI/granite-4.0-h-small-FP8-block",dtype=auto,add_bos_token=False,max_model_len=16384,tensor_parallel_size=1,gpu_memory_utilization=0.7,disable_log_stats=True,enable_chunked_prefill=True,trust_remote_code=True \
  --tasks leaderboard \
  --apply_chat_template \
  --fewshot_as_multiturn \
  --write_out \
  --batch_size auto \
  --show_config

Coding Benchmarks

evalplus.evaluate --model "RedHatAI/granite-4.0-h-small-FP8-block" \
                  --dataset "humaneval" \
                  --backend vllm \
                  --tp 1 \
                  --greedy

evalplus.evaluate --model "RedHatAI/granite-4.0-h-small-FP8-block" \
                --dataset "mbpp" \
                --backend vllm \
                --tp 1 \
                --greedy

* I/p Length = 2048, O/p Length = 2048, #Requests = 1024

Accuracy

Category Metric ibm-granite/granite-4.0-h-small ibm-granite/granite-4.0-h-small-FP8 RedHatAI/granite-4.0-h-small-FP8-block
Model Size (GB) 64.41 33.48 36.43
Throughput (Requests/sec)* 2.031 2.144 2.066
OpenLLM V1 ARC-Challenge (Acc-Norm, 25-shot) 72.27 71.67 (99.17) 72.27 (100.00)
GSM8K (Strict-Match, 5-shot) 85.06 85.60 (100.62) 85.60 (100.62)
HellaSwag (Acc-Norm, 10-shot) 86.07 86.02 (99.94) 85.96 (99.87)
MMLU (Acc, 5-shot) 77.15 76.94 (99.73) 77.23 (100.10)
TruthfulQA (MC2, 0-shot) 57.97 57.62 (99.40) 57.85 (99.80)
Winogrande (Acc, 5-shot) 81.45 81.14 (99.61) 80.82 (99.22)
Average Score 76.66 76.50 (99.79) 76.62 (99.95)
OpenLLM V2 IFEval (Inst Level Strict Acc, 0-shot) 87.41 87.65 (100.27) 87.89 (100.55)
BBH (Acc-Norm, 3-shot) 61.52 61.31 (99.66) 61.40 (99.80)
Math-Hard (Exact-Match, 4-shot) 46.60 44.34 (95.14) 44.94 (96.43)
GPQA (Acc-Norm, 0-shot) 32.55 32.05 (98.45) 34.23 (105.15)
MUSR (Acc-Norm, 0-shot) 46.43 46.30 (99.72) 45.77 (98.58)
MMLU-Pro (Acc, 5-shot) 47.96 47.91 (99.88) 47.93 (99.93)
Average Score 53.75 53.26 (99.09) 53.69 (99.89)
Downloads last month
316
Safetensors
Model size
33B params
Tensor type
BF16
·
F8_E4M3
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for nm-testing/granite-4.0-h-small-FP8-block

Quantized
(29)
this model

Collection including nm-testing/granite-4.0-h-small-FP8-block