IST-DASLab/RCO
Riemannian search for LLM quantization and MoE pruning under exact budgets
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
RCO separates compression into candidate preparation, constrained search, and checkpoint export. For quantization, run_quantize.py builds a per-layer GPTQ database; src/search/quant.py uses its dequantized candidates to evaluate model loss. The pruning path in src/search/prune.py applies straight-through survival masks to MoE routing weights and does not require that database. Both paths feed into run_build_checkpoint.py.
The optimizer in src/manifold.py represents each group's choices as softmax logits. It projects the loss gradient onto the tangent space of the weighted expected-cost constraint, retracts the Adam update back to the budget surface by binary search, and reprojects momentum. Separately, the forward pass uses annealed Gumbel perturbations and exact multiple-choice knapsack DP to select a feasible assignment; the backward pass uses a straight-through softmax surrogate. Python CLIs drive the PyTorch and Transformers stack. The optional vLLM patch is a serving integration, not a search dependency.
Key Capabilities & Differentiators
Mixed-precision search assigns 2–8 bits to linear layers and weights each choice by that layer's parameter count. For a target such as the Qwen3-8B example's 2.5-bit average, the budget applies to the searched weights, not every byte in the final artifact. run_split_checkpoint.py can populate one bit-width slot from an existing compressed-tensors checkpoint. Export supports dense bf16 fake quantization or packed weights rebuilt from integer codes, scales, zero points, and other metadata in _qparams.pt sidecars.
MoE pruning searches an exact expert-count budget and writes a keep/prune mask; the OLMoE example uses a 25% prune target. Export can zero experts and router rows without changing tensor shapes, or remove the experts and shrink the router. Calibration accepts plain-text sources such as FineWeb-Edu and chat data such as Evol-CodeAlpaca and Tulu Math, with assistant-token masks for chat. Pruning also supports equal-sample mixtures of calibration sources.
Trade-offs & Limitations
Unlike a dynamic program that optimizes a fixed per-layer proxy, RCO uses end-to-end model loss to update the search logits and uses DP for the budget-feasible discrete choices. Unlike a penalty method, feasibility does not depend on tuning a penalty coefficient. That does not make the assignment globally optimal: gradients come from a straight-through surrogate, and the stated discrete solver complexity is O(N*K*B) in the number of groups, options, and solver budget. Compared with evolutionary baselines EvoPress and EvoESAP, this is a gradient-driven research workflow; validate its quality and search cost under your own calibration setup.
The main operational cost is preparing and storing candidates, then exporting a checkpoint that the target runtime can actually serve. Fixed-bit quantization is simpler when precision is already decided. The default fake-quant and zero-pruning exports support compatibility testing but do not save weight storage. Packed or physically pruned exports warrant a loader and kernel check before inferring throughput gains. The code is Apache-2.0; base-model and dataset terms are separate.
Hardware & Deployment Guide
Run the top-level Python entry points from the repository root without an editable install, or use the wrappers in scripts/. The pinned stack includes torch==2.11.0+cu126, transformers==5.7.0, accelerate==1.13.0, and datasets==4.8.5. Ensure the PyTorch build and CUDA driver are compatible for the GPU workflow. compressed-tensors==0.15.0.1 is needed for packed checkpoint import or export, not for the core search. The workflow runs locally against model and calibration artifacts; no hosted compression API is required.
The documented GPTQ command uses eight torchrun workers. Establish GPU memory and scratch-space requirements for your own model and calibration settings before a full run. For deployment, test the exported checkpoint on the target loader: heterogeneous physical pruning needs per-layer expert-count support, and the supplied vLLM patch targets Qwen3-Next specifically. There is no published GitHub release listed; record the exact repository revision and dependency set used to produce each artifact.
LLM compression research and offline checkpoint preparation when you need to compare layer bit widths or expert allocations under a fixed budget and can validate the exported artifact on the intended runtime.
A fixed-bit checkpoint already meets your quality target, you need a turnkey inference server, or your target runtime cannot load the packed format or heterogeneous expert layout you need.
Quick Start & Installation
pip install -r requirements.txt
Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| RCO ★ | 91 | +3 | Python | Apache-2.0 | Riemannian search for LLM quantization and MoE pruning under exact budgets |
| minimind | 75.4k | +3.1k | Python | Apache-2.0 | Native PyTorch dense and MoE models for end-to-end LLM training on local GPUs |
| autoresearch | 101k | +342 | Python | — | Single-GPU nanochat harness for agent-led, five-minute training experiments |
| LlamaFactory | 76.4k | +86 | Python | Apache-2.0 | A 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.
curl -sL https://repoforai.com/repo/IST-DASLab/RCO.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about RCO
What connects the search stage to the exported checkpoint?
How should I size GPU memory and storage for a first run?
Can I self-host RCO for commercial work and redistribute the output?
When should I choose RCO over evolutionary search or uniform quantization?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
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