Views
No views yet
intermediate_size=10944, which is not divisible by the block size of 128. This model uses weight padding to handle this:intermediate_size: 10944intermediate_size: 11008 (86 × 128)1from vllm import LLM, SamplingParams
2
3llm = LLM(
4 model="Etelis/DeepSeek-V2-Lite-FP8-BLOCK-padded",
5 trust_remote_code=True,
6 tensor_parallel_size=1,
7)
8
9sampling_params = SamplingParams(max_tokens=100, temperature=0.7)
10output = llm.generate(["Hello, world!"], sampling_params)
11print(output[0].outputs[0].text)1from transformers import AutoModelForCausalLM, AutoTokenizer
2from llmcompressor import oneshot
3from llmcompressor.modifiers.quantization import QuantizationModifier
4
5MODEL_ID = "deepseek-ai/DeepSeek-V2-Lite"
6
7model = AutoModelForCausalLM.from_pretrained(
8 MODEL_ID,
9 torch_dtype="auto",
10 trust_remote_code=True,
11 device_map="auto"
12)
13tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
14
15# FP8 block quantization - ignore layers with composite dimensions
16recipe = QuantizationModifier(
17 targets="Linear",
18 scheme="FP8_BLOCK",
19 ignore=["lm_head", "re:.*kv_a_proj_with_mqa.*"]
20)
21
22oneshot(model=model, recipe=recipe)
23
24model.save_pretrained("DeepSeek-V2-Lite-FP8-BLOCK-padded")
25tokenizer.save_pretrained("DeepSeek-V2-Lite-FP8-BLOCK-padded")lm_head: Not quantized (standard practice)kv_a_proj_with_mqa: Has composite dimensions (512 + 64 = 576) that cannot be safely padded