davila7/claude-code-templates/optimization-awq
Claude Code and agent skill by davila7/claude-code-templates
- community
Checking that the SKILL.md file is still in the repository.
Activation-aware weight quantization for 4-bit LLM compression with 3x speedup and minimal accuracy loss. Use when deploying large models (7B-70B) on limited GPU memory, when you need faster inference than GPTQ with better accuracy preservation, or for instruction-tuned and multimodal models. MLSys 2024 Best Paper Award winner.
Install
npx vskill@latest install davila7/claude-code-templates/optimization-awqSKILL.md
AWQ (Activation-aware Weight Quantization)
4-bit quantization that preserves salient weights based on activation patterns, achieving 3x speedup with minimal accuracy loss.
When to use AWQ
Use AWQ when:
- Need 4-bit quantization with <5% accuracy loss
- Deploying instruction-tuned or chat models (AWQ generalizes better)
- Want ~2.5-3x inference speedup over FP16
- Using vLLM for production serving
- Have Ampere+ GPUs (A100, H100, RTX 40xx) for Marlin kernel support
Use GPTQ instead when:
- Need maximum ecosystem compatibility (more tools support GPTQ)
- Working with ExLlamaV2 backend specifically
- Have older GPUs without Marlin support
Use bitsandbytes instead when:
- Need zero calibration overhead (quantize on-the-fly)
- Want to fine-tune with QLoRA
- Prefer simpler integration
Quick start
Installation
Requirements: Python 3.8+, CUDA 11.8+, Compute Capability 7.5+
Load pre-quantized model
Quantize your own model
Timing: ~10-15 min for 7B, ~1 hour for 70B models.
AWQ vs GPTQ vs bitsandbytes
| Feature | AWQ | GPTQ | bitsandbytes | |
|---|---|---|---|---|
| Speedup (4-bit) | ~2.5-3x | ~2x | ~1.5x | |
| Accuracy loss | <5% | ~5-10% | ~5-15% | |
| Calibration | Minimal (128-1K tokens) | More extensive | None | |
| Overfitting risk | Low | Higher | N/A | |
| Best for | Production inference | GPU inference | Easy integration | |
| vLLM support | Native | Yes | Limited |
Key insight: AWQ assumes not all weights are equally important. It protects ~1% of salient weights identified by activation patterns, reducing quantization error without mixed-precision overhead.
Kernel backends
GEMM (default, batch inference)
GEMV (single-token generation)
Limitation: Only batch size 1, not good for large context.
Marlin (Ampere+ GPUs)
Requirements: Compute Capability 8.0+ (A100, H100, RTX 40xx)
ExLlamaV2 (AMD compatible)
HuggingFace Transformers integration
Direct loading
Fused modules (recommended)
Note: Fused modules cannot combine with FlashAttention2.
vLLM integration
Performance benchmarks
Memory reduction
| Model | FP16 | AWQ 4-bit | Reduction | |
|---|---|---|---|---|
| Mistral 7B | 14 GB | 5.5 GB | 2.5x | |
| Llama 2-13B | 26 GB | 10 GB | 2.6x | |
| Llama 2-70B | 140 GB | 35 GB | 4x |
Inference speed (RTX 4090)
| Model | Prefill (tok/s) | Decode (tok/s) | Memory | |
|---|---|---|---|---|
| Mistral 7B GEMM | 3,897 | 114 | 5.55 GB | |
| TinyLlama 1B GEMV | 5,179 | 431 | 2.10 GB | |
| Llama 2-13B GEMM | 2,279 | 74 | 10.28 GB |
Accuracy (perplexity)
| Model | FP16 | AWQ 4-bit | Degradation | |
|---|---|---|---|---|
| Llama 3 8B | 8.20 | 8.48 | +3.4% | |
| Mistral 7B | 5.25 | 5.42 | +3.2% | |
| Qwen2 72B | 4.85 | 4.95 | +2.1% |
Custom calibration data
Multi-GPU deployment
Supported models
35+ architectures including:
- Llama family: Llama 2/3, Code Llama, Mistral, Mixtral
- Qwen: Qwen, Qwen2, Qwen2.5-VL
- Others: Falcon, MPT, Phi, Yi, DeepSeek, Gemma
- Multimodal: LLaVA, LLaVA-Next, Qwen2-VL
Common issues
CUDA OOM during quantization:
Slow inference:
AMD GPU support:
Deprecation notice
AutoAWQ is officially deprecated. For new projects, consider:
- vLLM llm-compressor: https://github.com/vllm-project/llm-compressor
- MLX-LM: For Mac devices with Apple Silicon
Existing quantized models remain usable.
References
- Paper: AWQ: Activation-aware Weight Quantization (arXiv:2306.00978) - MLSys 2024 Best Paper
- GitHub: https://github.com/casper-hansen/AutoAWQ
- MIT Han Lab: https://github.com/mit-han-lab/llm-awq
- Models: https://huggingface.co/models?library=awq
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingcli-tool/components/skills/ai-research/optimization-awq/SKILL.md
Popularity
- Repository stars
- 23,428
- Repository forks
- 2,246
- Repository npm downloads, 7 days
- 3,146
- 7-day trend score
- 70
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 23 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/davila7/claude-code-templates/optimization-awq)