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
- Initialize vLLM server:
vllm serve RedHatAI/granite-4.0-h-small-FP8-block --tensor_parallel_size 4
- 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=4,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=4,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 4 \
--greedy
evalplus.evaluate --model "RedHatAI/granite-4.0-h-small-FP8-block" \
--dataset "mbpp" \
--backend vllm \
--tp 4 \
--greedy
Accuracy
| Category | Metric | ibm-granite/granite-4.0-h-small | RedHatAI/granite-4.0-h-small-FP8-block | Recovery (%) |
|---|---|---|---|---|
| OpenLLM V1 | ARC-Challenge (Acc-Norm, 25-shot) | abc | ijk | xyz |
| GSM8K (Strict-Match, 5-shot) | abc | ijk | xyz | |
| HellaSwag (Acc-Norm, 10-shot) | abc | ijk | xyz | |
| MMLU (Acc, 5-shot) | abc | ijk | xyz | |
| TruthfulQA (MC2, 0-shot) | abc | ijk | xyz | |
| Winogrande (Acc, 5-shot) | abc | ijk | xyz | |
| Average Score | abc | ijk | xyz | |
| OpenLLM V2 | IFEval (Inst Level Strict Acc, 0-shot) | abc | ijk | xyz |
| BBH (Acc-Norm, 3-shot) | abc | ijk | xyz | |
| Math-Hard (Exact-Match, 4-shot) | abc | ijk | xyz | |
| GPQA (Acc-Norm, 0-shot) | abc | ijk | xyz | |
| MUSR (Acc-Norm, 0-shot) | abc | ijk | xyz | |
| MMLU-Pro (Acc, 5-shot) | abc | ijk | xyz | |
| Average Score | abc | ijk | xyz | |
| Coding | HumanEval pass@1 | 86.60 | ijk | xyz |
| HumanEval+ pass@1 | 81.10 | ijk | xyz | |
| MBPP pass@1 | 82.00 | ijk | xyz | |
| MBPP+ pass@1 | 69.80 | ijk | xyz |
- Downloads last month
- 230
Model tree for nm-testing/granite-4.0-h-small-FP8-block
Base model
ibm-granite/granite-4.0-h-small