CoolFace
Modelpublic

sotanengel/Qwen2.5-Coder-32B-Instruct-GPTQ-Int4

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
0likes11downloads
Model Card

Qwen2.5-Coder-32B-Instruct-GPTQ-Int4

Overview

This is a quantized version of Qwen/Qwen2.5-Coder-32B-Instruct using GPTQ with Quantization Error Propagation (QEP).

Quantization Details

ItemValue
MethodGPTQ
Bits4-bit (wbits=4)
Group size128
QEP✅ Enabled
Calibration samples512
Calibration max length2048
Original size~64 GB (BF16)
Quantized size~18 GB

QEP (Quantization Error Propagation) compensates quantization errors by propagating correction terms to subsequent layers, resulting in higher accuracy than standard GPTQ.

Hardware Requirements

GPUVRAMStatus
NVIDIA L424 GB✅ OK (gptqmodel + Marlin kernel required)
NVIDIA L40S48 GB✅ Recommended
NVIDIA A100 40G40 GB✅ OK
NVIDIA A100 80G80 GB✅ OK
Note: L4 (24 GB) has been verified to run this model when using gptqmodel with the Marlin kernel. The transformers + standard GPTQ backend may be insufficient due to peak VRAM usage.

Benchmark Results (Coding Tasks)

Evaluated on 6 coding prompts (2 basic / 2 intermediate / 2 advanced) using gptqmodel + Marlin kernel on NVIDIA L4 (24 GB).

Performance Summary

MetricValue
Success rate6 / 6
DeviceAll GPU
Total inference time~249 s
Per-prompt latency~32–55 s
Generation settingsmax_new_tokens=1024, temperature=0.1

Task-level Quality

#TaskDifficultyResultNote
1QuicksortBasic✅ GoodType hints, docstring, correct output
2LRU CacheIntermediate⚠️ AcceptableO(1) via OrderedDict; custom doubly-linked list not implemented
32SumBasic✅ GoodO(n), duplicate-pair normalization handled correctly
4Retry DecoratorIntermediate✅ Goodfunctools.wraps, spec-compliant
5Binary Search Bug FixAdvanced❌ Needs review// and left=mid+1 are correct, but misidentified `right=mid-1` as not needing a fix for the half-open interval [left, right)
6task_queue packageAdvanced (multi-file)✅ Good4-file structure, re-exports per spec

Overall Assessment

AxisScore
Correctness7 / 10 — boundary-condition errors (esp. task 5)
Readability / Explanation8 / 10
Spec faithfulness6 / 10 — stdlib shortcut tendency
Speed on L47 / 10

Summary: Sufficient for draft and boilerplate generation. Algorithm fixes and strict correctness require human review or automated tests.

Runtime Notes

  • Marlin JIT compilation requires CUDA_HOME and the CUDA toolkit to be present on the first run.
  • CPU fallback is disabled (fail-fast) — a GPU is required.

Usage

Transformers

python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "sotanengel/Qwen2.5-Coder-32B-Instruct-GPTQ-Int4",
    device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(
    "sotanengel/Qwen2.5-Coder-32B-Instruct-GPTQ-Int4"
)

messages = [{"role": "user", "content": "Write a quicksort in Python."}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

gptqmodel + Marlin (recommended for L4)

python
from gptqmodel import GPTQModel

model = GPTQModel.load(
    "sotanengel/Qwen2.5-Coder-32B-Instruct-GPTQ-Int4",
    device="cuda:0",
)

Deployment Options

  • vLLM: OpenAI-compatible API server
  • SGLang: High-performance LLM serving
  • Docker Model Runner: Containerized deployment

License

Apache 2.0 (same as original model)

Credits