Views
No views yet
Linear layers or are highly sensitive to quantization error.
Additionally, the linear-attention gating projections in_proj_a/in_proj_b (shape [32, hidden_size]) are kept at full precision because their 32-row output dimension is not divisible by the FP8_BLOCK 128x128 block size.
This model was quantized with the model_free_ptq pathway of llm-compressor, which applies the recipe directly to the safetensors checkpoint without requiring a transformers model definition or a calibration dataset.1from vllm import LLM, SamplingParams
2from transformers import AutoTokenizer
3
4model_id = "RedHatAI/Ornith-1.0-35B-FP8-BLOCK"
5number_gpus = 1
6sampling_params = SamplingParams(temperature=0.6, top_p=0.95, top_k=20, min_p=0, max_tokens=256)
7
8tokenizer = AutoTokenizer.from_pretrained(model_id)
9messages = [{"role": "user", "content": "Give me a short introduction to large language model."}]
10prompts = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
11
12llm = LLM(model=model_id, tensor_parallel_size=number_gpus)
13outputs = llm.generate(prompts, sampling_params)
14generated_text = outputs[0].outputs[0].text
15print(generated_text)model_free_ptq recipe used for Qwen/Qwen3.5-35B-A3B, the base architecture that Ornith-1.0-35B was post-trained from, with two extra ignore patterns for the non-128-divisible linear-attention gating projections.1from llmcompressor import model_free_ptq
2
3MODEL_ID = "deepreinforce-ai/Ornith-1.0-35B"
4SAVE_DIR = MODEL_ID.rstrip("/").split("/")[-1] + "-FP8-BLOCK"
5
6# Apply FP8-Block to the model
7# Once quantized, the model is saved
8# using compressed-tensors to the SAVE_DIR.
9model_free_ptq(
10 model_stub=MODEL_ID,
11 save_directory=SAVE_DIR,
12 scheme="FP8_BLOCK",
13 ignore=[
14 "lm_head",
15 "re:.*mlp.gate$",
16 "re:.*mlp.shared_expert_gate.*",
17 "re:.*norm.*",
18 "re:.*embed_tokens.*",
19 "re:.*visual.*",
20 "re:.*conv1d.*",
21 # in_proj_a/in_proj_b are [32, 2048] gating projections used by the
22 # linear-attention (gated deltanet) layers; the 32-row output dim is
23 # not divisible by the FP8_BLOCK 128x128 block size, so they must be
24 # skipped (in_proj_qkv/in_proj_z/out_proj are all 128-divisible and
25 # remain quantized).
26 "re:.*linear_attn.in_proj_a.*",
27 "re:.*linear_attn.in_proj_b.*",
28 ],
29 max_workers=15,
30 device="cuda:0",
31)