How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="haanjack/K-EXAONE-236B-A23B-MXFP4")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("haanjack/K-EXAONE-236B-A23B-MXFP4")
model = AutoModelForCausalLM.from_pretrained("haanjack/K-EXAONE-236B-A23B-MXFP4")
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]:]))
Quick Links

K-EXAONE-236B-A23B-MXFP4

MXFP4 quantized version of LGAI-EXAONE/K-EXAONE-236B-A23B, with MoE routed expert weights and activations quantized to OCP MXFP4 format.

K-EXAONE-236B-A23B is a Mixture-of-Experts language model developed by LG AI Research, featuring 236B total parameters with 23B active parameters per token, 128 routed experts, and 1 shared expert per layer.

Quantization Details

Property Value
Base Model LGAI-EXAONE/K-EXAONE-236B-A23B (236B params, MoE)
Precision MXFP4 (E2M1 weights + E8M0 scales, group_size=32)
Activation Quantization MXFP4 (E2M1), Dynamic, group_size=32
Quantization Tool quanto + AMD Quark 0.11.1 (file-to-file)
Algorithm RTN (Round-To-Nearest)
Original Size 443 GB
Quantized Size 130 GB
Compression Ratio 3.4x

Excluded Layers

This model uses the attn-excl strategy: all attention projections and all shared expert projections are excluded from quantization, leaving only MoE routed expert weights quantized to MXFP4.

  • Self-Attention (all 48 layers): q_proj, k_proj, v_proj, o_proj
  • Shared Expert MLP (all 48 layers): gate_proj, up_proj, down_proj
  • MoE Router Gates: All mlp.gate layers
  • Standard exclusions: lm_head, embed_tokens, all norm layers

Total: 382 excluded layers.

Hardware

  • Quantized on: AMD MI355 (gfx950), 288 GB VRAM
  • Tested with: vLLM v0.18.2 (ROCm), TP=1
  • Compatible with: vLLM with Quark quantization support (quant_method: "quark")

Usage

vLLM

vllm serve haanjack/K-EXAONE-236B-A23B-MXFP4 \
  --trust-remote-code \
  --tensor-parallel-size 1 \
  --max-model-len 4096

Quantization Reproduction

from quanto import UnifiedQuantizer, UnifiedConfig

NUM_LAYERS = 48
exclude = ["lm_head", "*embed*", "*norm*", "*.gate"]
for i in range(NUM_LAYERS):
    for proj in ["q_proj", "k_proj", "v_proj", "o_proj"]:
        exclude.append(f"model.layers.{i}.self_attn.{proj}")
    for proj in ["gate_proj", "up_proj", "down_proj"]:
        exclude.append(f"model.layers.{i}.mlp.shared_experts.{proj}")

config = UnifiedConfig(
    model_path="LGAI-EXAONE/K-EXAONE-236B-A23B",
    output_dir="./K-EXAONE-236B-A23B-MXFP4",
    precision="mxfp4",
    sensitivity_analysis=False,
    exclude_layers=exclude,
    trust_remote_code=True,
)
UnifiedQuantizer(config).run()

Credits

  • Base Model: LG AI Research — K-EXAONE
  • Quantization: quanto with AMD Quark
  • Hardware: AMD MI355 (gfx950), 288 GB VRAM

License

This model inherits the EXAONE License from the base model.

Downloads last month
52
Safetensors
Model size
130B params
Tensor type
U8
·
F32
·
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for haanjack/K-EXAONE-236B-A23B-MXFP4

Quantized
(10)
this model