kongtou20070406/proofline
CPU-only roofline SDK for GPU sizing and certifiable latency bounds
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Proofline is a static performance-analysis SDK, not an inference runtime. It requires Python 3.10+ and PyTorch 2.2+. For nn.Module inputs, it uses FakeTensorMode and zero-VRAM meta tensors to infer shapes and dependencies without running GPU kernels. Hugging Face configurations and safetensors headers, GGUF headers, and ONNX graphs provide metadata or graph inputs when PyTorch tracing is not the entry point.
The analyzer maps accounted FLOPs, memory traffic, and dependency depth onto a hardware profile. It reports an absolute floor set by the maximum of compute, compulsory I/O, and critical-path terms; a stage-wise bound that sums per-stage maxima; and an eager reference that adds per-kernel dispatch overhead. The Python API and CLI expose the analysis directly. proofline mcp adds JSON-RPC 2.0 over stdio for agent workflows, while optional Z3 and Lean 4 verification checks lower-bound results under the stated scheduling assumptions.
Key Capabilities & Differentiators
The 34 built-in hardware presets span NVIDIA, AMD, Huawei Ascend, Google TPU, and Apple Silicon, with multi-device selectors such as 8xb200 and support for calibrated JSON profiles. The serving model separates prefill and decode and accounts for GQA/MQA, compressed MLA KV caches, sliding windows, and hybrid dense/MoE layouts. fit checks weight and KV-cache fit, evaluates tensor/data parallel layouts and colocated versus disaggregated prefill/decode, and ranks configurations by modeled output-token goodput and cost under time-to-first-token (TTFT) and time-per-output-token (TPOT) constraints.
The graph tools address a different question: where is there room to improve the implementation? blueprint proposes heuristic fusion partitions with shared-memory and register-pressure constraints, as well as FlashAttention and GQA-aware Split-KV FlashDecoding tiles. It emits a Mermaid topology and a D2K-Bench agent prompt, not a compiled kernel. gap attributes profiler traces or compares TorchInductor fusion breaks; diff turns changes in the modeled latency floor into Markdown or a CI gate.
Trade-offs & Limitations
Proofline is useful before buying accelerator time: it can narrow hardware choices and catch modeled changes to work, I/O, or serial depth in CPU CI. It does not replace torch.profiler, which observes actual operator execution and dispatch, or a vLLM/SGLang load test, which measures latency and throughput under real traffic. A lower floor does not guarantee a faster deployment, and a compiler- or scheduler-only regression need not move the floor at all. Treat emitted batch and concurrency settings as candidates to benchmark, not production capacity targets.
The central risk is model fidelity. Data-dependent control flow or untraced side effects can change the runtime graph; compulsory work and traffic depend on the algorithm, precision, or permitted rewrites. Many presets use spec numbers rather than measurements, so modeled rankings can shift when calibrated compute, bandwidth, or communication costs are substituted. Z3 and Lean 4 check deductions within those assumptions, not compiler passes, drivers, or silicon. Use a calibrated profile and a representative workload before relying on a close ranking or an SLO estimate.
Hardware & Deployment Guide
The core analyzer can be installed from Git with pip into a CPU-only PyTorch environment. The formal extra adds Z3 and SymPy; local Lean verification separately requires Lean 4.34.1 or newer, found on PATH or through PROOFLINE_LEAN_BIN. Local PyTorch, configuration, GGUF, and ONNX inputs can be analyzed offline; the Hugging Face repository path also offers an explicit --online mode. Live CUDA or MPS calibration is a separate step and needs access to the device being measured.
For teams, .github/actions/proofline-gate/action.yml runs the modeled regression check on CPU runners and writes a Markdown delta to the job summary. The MCP entry point runs as a local stdio process. v1.6.0 organized the CLI into eight task-oriented commands, and v1.7.0 added the dedicated fusion blueprint command and MCP tool. Commands generated for vLLM, SGLang, or llama.cpp are deployment starting points; those runtimes and model artifacts are separate from the analyzer.
diff gates modeled regressions in CPU CI; offline HTML and seven stdio MCP tools expose the analysis to humans and coding agents.ML systems teams screening GPU fleets and serving layouts, triaging fusion opportunities, or gating modeled performance regressions in CPU CI before running hardware benchmarks.
You need measured tail latency, production capacity guarantees, or an inference runtime that executes the model or compiles the proposed kernels.
Quick Start & Installation
pip install git+https://github.com/kongtou20070406/proofline.git
Comparison vs. Top LLMs & Inference Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| proofline ★ | 27 | +27 | Python | MIT | CPU-only roofline SDK for GPU sizing and certifiable latency bounds |
| DeepSpeed | 43.4k | +33 | Python | Apache-2.0 | PyTorch runtime for distributed training and inference under GPU memory constrai |
| pytorch | 105.9k | +299 | Python | — | Python-first tensor SDK for GPU-accelerated training and inference |
| fastai | 28.3k | +9 | Jupyter Notebook | Apache-2.0 | Layered PyTorch library for shorter training pipelines and custom training loops |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/kongtou20070406/proofline.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about proofline
How do I integrate Proofline into an existing engineering workflow?
analyze API for programmatic integration, proofline check for one-off analysis, and proofline diff --fail-on-regression PCT or the GitHub Action for CPU CI. Coding agents can launch proofline mcp as a JSON-RPC 2.0 stdio subprocess. For reliable comparisons, hold input shapes, precision, and the hardware profile constant.Do I need a GPU, model weights, or a fixed amount of host RAM?
calibrate --measure requires access to that device.Can a company self-host or redistribute Proofline?
When should I choose Proofline over a runtime profiler or a serving benchmark?
torch.profiler on the target device to measure what actually ran, and benchmark vLLM or SGLang under representative traffic before committing to an SLO or fleet size. proofline gap can attribute an existing profiler trace or compare TorchInductor fusion breaks, linking modeled headroom to runtime evidence.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