← Back to Leaderboard
Mhuawei-csl

huawei-csl/MACaQ

HF Paper ↗

Calibrated quantization for local GGUF inference and model-specific runtimes

Engineering Health (Methodology)
A · 77/100
Maintenance Activity
● Updated today
Latest Release
Rolling commits (main)
Commercial License Check
Apache-2.0 · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption11/25
Release Cadence11/20
License Clarity20/20
Local AICLIGPU
Total Stars
★ 413
24h Growth
+7
7d Growth
+15
Forks
25

GitHub Star History

Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.

huawei-csl/MACaQ Star History (2026-11-09 - 2026-12-03) DAILY STAR HISTORY (25-DAY D1 TELEMETRY) +412 in 24d · avg +17/day 436 218 0 2026-11-09: ★ 12026-11-11: ★ 1402026-11-13: ★ 2352026-11-15: ★ 3172026-11-17: ★ 3602026-11-19: ★ 3792026-11-21: ★ 3872026-11-23: ★ 3932026-11-25: ★ 3962026-11-27: ★ 4002026-11-29: ★ 4012026-12-01: ★ 4032026-12-03: ★ 413 ★ 413 11-09 11-21 12-03

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

MACaQ separates calibration and quantization from inference: it produces artifacts for existing runtimes rather than introducing a single multimodal engine. The root tree includes quantize/ alongside llamacpp/, vllm/, diffusers/, and pytorch/. For text, the full llama.cpp workflow uses a bundled runtime for activation transforms; MACaQ-R instead refines weight codes inside an existing GGUF while preserving its native formats and block scales, so the result runs on standard llama.cpp.

The setuptools-built macaq-mxfp4 package declares Python ≥3.10 and registers macaq_plugin:register under vllm.general_plugins. Its module list includes Triton-named dense, MoE, and MoE decode modules, plus a cuDNN-named dense module. Those module names describe the packaged integration surface, not a guarantee that each kernel runs on every GPU. Diffusers saves quantized transformers as safetensors checkpoints; the PyTorch speech path saves reloadable W4A4 checkpoints.

Key Capabilities & Differentiators

The llama.cpp workflow targets 2-, 3-, and 4-bit GGUF for text, with dense, hybrid, and MoE recipes. For Qwen3.6-35B-A3B, MACaQ-R Q4_K_XL reduces KL divergence to FP16 from 0.015731 for Unsloth UD-Q4_K_XL to 0.013367, with both files at 22.36 GB. On Qwen3.8-27B in vLLM, W4A4 records 2.33× prefill and 2.58× decode throughput relative to BF16, with perplexity moving from 2.8463 to 2.8994.

Diffusers covers FLUX.2-klein-4B for images, Wan2.2-TI2V-5B for video and image-to-video, and Stable Audio 1.0 for audio. Image-to-video calibration incorporates conditioning images. Wan2.2 also has a Diff4Diff path with fused W4A4 kernels and optional SVD correction. The separate PyTorch path covers Qwen3-TTS and Chatterbox Turbo, generating WAV audio from saved quantized checkpoints without rerunning calibration.

Trade-offs & Limitations

Compared with downloading a ready-made GGUF, MACaQ-R adds a calibration stage and requires access to the matching original model and FP16 teacher. The payoff is a chance to reduce divergence from FP16 without increasing file size or replacing standard llama.cpp, as in the Unsloth comparison. KL divergence and perplexity measure different aspects of quality and do not establish downstream task gains. Benchmark representative prompts or media inputs before committing to a quantized artifact.

On vLLM, W4A4 trades a measured perplexity increase for higher throughput on the tested Qwen model. That result is not a latency or throughput guarantee on a different GPU or workload; weight-only inference is a separate path worth testing when the W4A4 path is unsuitable. The reported 122B quantization run—64 minutes and 32.5 GB of device memory—is a calibration and quantization datapoint, not a serving budget. Apache-2.0 covers the code; model and checkpoint terms must be checked separately.

Hardware & Deployment Guide

Use separate Python 3.12 environments for the chosen backends; the vLLM package's Python ≥3.10 metadata is a packaging floor, not the recommended setup for every backend. For local GGUF refinement, llamacpp/macaq.py refine takes the input GGUF (--model), matching source (--hf), FP16 teacher GGUF (--teacher), and calibration text (--calibration), plus --output and --work-dir. The refined artifact can run locally with llama cli, including on CPU, or be served with llama serve. vLLM is the separate HTTP serving path.

Ascend dense and grouped matmul kernels are available through CANN pull requests, with build compatibility tied to CANN, PyTorch, and torch_npu; full-model execution still requires integration with an Ascend inference runtime. No GitHub release is listed, so there is no release milestone to use as a deployment baseline. Pin the repository revision and validate the chosen runtime and checkpoint together before rollout.

GGUF compatibility: MACaQ-R changes weight codes without changing native block formats or scales.
Representation: The bundled llama.cpp flow targets 2-, 3-, and 4-bit GGUF; explicit stock compatibility applies to MACaQ-R.
Serving integration: The vLLM general plugin defaults to W4A4 and also supports weight-only execution.
Video kernels: Diff4Diff for Wan2.2 uses fused W4A4 kernels with optional SVD correction.
Checkpoint reuse: PyTorch speech checkpoints can be loaded for WAV generation without repeating calibration.
Accelerator boundary: Ascend dense and grouped matmul kernels are available through CANN pull requests; full-model execution requires runtime integration.
Best For

Teams refining existing GGUFs without changing standard llama.cpp, or benchmarking backend-specific low-precision inference for text, image, video, and audio models.

Skip If

An off-the-shelf checkpoint already meets your targets, you lack the matching source and teacher needed for GGUF refinement, or you need a turnkey Ascend full-model runtime.

Reviewed on 2026-12-02 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

Local AICLIGPU
.venv-llamacpp/bin/python llamacpp/macaq.py refine \
  --model models/model-q4.gguf --hf models/original \
  --teacher models/original-f16.gguf --calibration data/calibration.txt \
  --output models/model-macaq-r.gguf --work-dir work/refinement

Comparison vs. Top LLMs & Inference Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
MACaQ ★413+15C++Apache-2.0Calibrated quantization for local GGUF inference and model-specific runtimes
minimind75.4k+3.1kPythonApache-2.0Native PyTorch dense and MoE models for end-to-end LLM training on local GPUs
autoresearch101k+342Python—Single-GPU nanochat harness for agent-led, five-minute training experiments
LlamaFactory76.4k+86PythonApache-2.0A unified Python framework for LLM and VLM fine-tuning with pluggable inference

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/huawei-csl/MACaQ.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

huawei-csl/MACaQ Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about MACaQ

Can I adopt MACaQ without replacing my llama.cpp runtime?

For an existing GGUF, use llamacpp/macaq.py refine with the quantized file, its matching source model, an FP16 teacher GGUF, and calibration text. The output preserves the original block formats and scales and runs in standard llama.cpp. Full MACaQ with activation transforms instead uses the bundled runtime. vLLM is a separate integration registered through vllm.general_plugins.

How much device memory do I need to quantize and serve a model?

Size calibration and inference separately. The 122B example reports 32.5 GB of device memory and 64 minutes for quantization; it is neither a minimum requirement nor a serving estimate. For inference, budget for model weights, runtime buffers, and the workload: context length and concurrency for text, or resolution and frame count for video. Validate the intended low-precision path on the target GPU; llama.cpp also supports CPU execution.

Can I use MACaQ commercially and self-host the resulting models?

Yes. Apache-2.0 permits commercial use of the repository code; comply with its license and notice obligations when redistributing it. Independently check the terms of the base model, teacher, and any published or derived checkpoint. The code license does not grant rights to third-party weights.

When is MACaQ-R preferable to downloading a ready-made Unsloth GGUF?

Start with an existing GGUF if it already meets your size and quality targets. MACaQ-R is worth testing when you need a same-size refinement that still runs in stock llama.cpp: on Qwen3.6-35B-A3B, the 22.36 GB MACaQ-R Q4_K_XL measured 0.013367 KL to FP16 versus 0.015731 for Unsloth UD-Q4_K_XL at the same size. Treat that as a reason to evaluate on your workload, not as a universal ranking.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining huawei-csl/MACaQ? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature huawei-csl/MACaQ on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare