Views
No views yet
llmcompressor with the FP8_DYNAMIC scheme.1pip install vllm
2
3# Serve the model
4vllm serve REPO_ID \
5 --max-model-len 32768 \
6 --gpu-memory-utilization 0.95
7
8# Python API
9from vllm import LLM
10llm = LLM(model="REPO_ID")
11outputs = llm.generate("Hello, how are you?")
12print(outputs[0].outputs[0].text)1from transformers import AutoTokenizer, AutoModelForCausalLM
2
3model = AutoModelForCausalLM.from_pretrained(
4 "REPO_ID",
5 device_map="auto",
6 torch_dtype="auto"
7)
8tokenizer = AutoTokenizer.from_pretrained("REPO_ID")
9
10messages = [{'role': 'user', 'content': 'Hello!'}]
11inputs = tokenizer.apply_chat_template(messages, return_tensors='pt').to(model.device)
12outputs = model.generate(inputs, max_new_tokens=512)
13print(tokenizer.decode(outputs[0]))lm_head--kv-cache-dtype fp8 for longer contexts--gpu-memory-utilization 0.90-0.95--enforce-eager if you encounter compilation issues1@misc{model_name-fp8,
2 author = {author},
3 title = {model_name FP8 Dynamic Quantization},
4 year = {2025},
5 publisher = {HuggingFace},
6 url = {https://huggingface.co/repo_id}
7}