Contributing
The canonical references are CONTRIBUTING.md and AGENTS.md. This chapter gives a working overview for anyone reading the book first.
The AI-first policy
Atlas is explicitly an AI-first codebase. From CONTRIBUTING.md:
- All PRs are expected to be AI-generated. Use the best AI tools available to write your kernels, Rust code, and benchmarks.
- Human-written code must be justified. Indicate which parts are human-authored and explain why.
- Human-only contributions will be reviewed by AI.
This is not branding — it's the operational consequence of the specialization thesis. If AI can hyperoptimize CUDA kernels for specific hardware targets, it can write the infrastructure too. Ports to new (H, M_q) targets are the clearest example: each is a bounded, well-scoped piece of work, and that's the unit AI-assisted engineering handles best.
What kinds of PRs are welcome
The README's Contributing section lists four categories:
- New
(H, M_q)targets. Porting Atlas kernels to new hardware (H100, B200, MI300X, Apple M4, Intel) or new models. Each target is a self-contained body of work. See the Adding a new hardware target and Adding a new model guides. - Kernel optimization. Profile existing kernels, experiment with tiling strategies, register pressure, shared-memory layouts. If you can beat the numbers in the Benchmarks chapter, send the PR.
- Benchmark coverage. Add shapes and configurations not yet tested. More data points sharpen the hypercompiler.
- Bug reports. Include hardware details, repro steps, and kernel timings.
Local checks before a PR
These are what CI runs (.github/workflows/ci.yml). Run them locally first:
# 1. Formatting
cargo fmt --all -- --check
# 2. Lints. BOTH env vars are needed: ATLAS_SKIP_BUILD stubs the PTX build,
# CUDARC_CUDA_VERSION stops cudarc shelling out to `nvcc --version`.
# Deny-warnings comes from [workspace.lints], so CI passes no -D flag
# and no --all-features. This is verbatim what ci.yml runs.
ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests
# 3. License headers
bash scripts/check-license-headers.sh
# 4. Typos
typos # install once: cargo install typos-cli
All four are required to pass. Real CUDA build + test cycles require a GB10 host — not the laptop, the DGX Spark itself.
Ground rules (from AGENTS.md)
- SPDX header on every source file.
// SPDX-License-Identifier: AGPL-3.0-onlyon line 1 of every.rs,.cu,.cuh,.h,.hpp,.cpp. Enforced by thelicense-headersCI job. - License is AGPL-3.0-only. Don't mix in permissive-only code without confirming compatibility.
deny.tomlcontrols allowed dependency licenses. - Don't regress supported models. The matrix in Supported Models is the contract;
docs/GB10_DEPLOYMENT_GUIDE.md§2 is its SSOT, andkernels/gb10/carries 22(model, quant)leaves. If your PR might touch a hot path, validate againsttests/run_all_models.pyon a GB10 before opening. - One logical change per commit. Don't bundle cleanup with a bug fix.
- Commit message format.
<area>: <imperative summary>— e.g.spark-server: preserve template-forced thinking through EP=2.
Failure modes that cost the project time
These are the classes of bug that have burned days. Know them; avoid introducing them.
- Protocol drift between OpenAI (
api/) and Anthropic (anthropic/) surfaces. A fix on one side often needs a matching change on the other. - Template mismatches subtly breaking tool-calling — different
<tool_call>vs<minimax:tool_call>tokens,<think>seeded by the template vs emitted by the model, thinking budget enforcement. - FP8 / KV / quantization edge cases — BF16 paged cache routed into an FP8 kernel → silent NaN. If your change touches numeric paths, verify with a real model before claiming success.
- Docs drift — CLI flags, release commands, quick-start snippets. Verify against the current binary, not memory.
The cardinal rule
Never assume the model is at fault. Always look for the Atlas bug first.
The test matrix has caught many issues that would have looked like "model hallucination" in a lesser codebase. The heuristic is: if the model used to produce coherent output on this input and now doesn't, there's an Atlas bug, not a model bug.
The CLA
By contributing, you agree to the Contributor License Agreement. Your work goes out under AGPL-3.0 in the Community Edition, and you grant Avarok the right to relicense for the Enterprise Edition.
The CLA Assistant bot automatically comments on every PR. You must explicitly acknowledge and sign before merge.
Adding a new hardware target
High-level (full walkthrough in the repo README):
kernels/<hw>/HARDWARE.tomlwithvendor = "...".impl ComputeTargetinatlas-core/src/compute.rs(or inline in your crate).- Arm in
atlas-kernels/build.rs—resolve_targets()readsATLAS_TARGET_HW(defaultgb10) and the leafHARDWARE.toml'svendorpicks theComputeTarget. impl GpuBackendinspark-runtime/src/<vendor>_backend.rs— 27 methods, some optional.- Kernel sources under
kernels/<hw>/common/(the GB10 baseline is 160.cufiles / 318__global__entry points), plus per-model shadows only where a target diverges. MODEL.toml+KERNEL.tomlfor at least one model.- Backend selection branch in
spark-server/src/main.rs. - Dockerfile for the new hardware.
Adding a new model
The model-specific surface is tiny:
crates/spark-model/src/weight_loader/<your_model>.rsimplementingModelWeightLoader(~200–500 lines depending on architecture complexity).- Module declaration +
pub useincrates/spark-model/src/weight_loader/mod.rs. - One match arm in
crates/spark-model/src/factory.rs::loader_for_config. - Optional:
kernels/<hw>/<your-model>/MODEL.tomlfor sampling / behavior defaults. - Optional: tool-call parser under
crates/spark-server/src/tool_parser/. - Entry in
tests/run_all_models.pyfor regression coverage. - Entry in Supported Models.
Existing loaders for patterns: qwen35.rs, minimax.rs, nemotron.rs cover dense, SSM+MoE hybrid, and attention+MoE shapes respectively.
PR process
- Fork and create a feature branch.
- Atomic commits. Enforced by reviewers; squash only at the reviewer's request.
- CI must pass:
ci.ymlrunsfmt,clippy,license-headers,typos,kernel-structure,cargo test --workspace,test-macos-metalandrelease-matrix;security.ymlrunscargo-deny;file-size-cap.ymlthe 500-LoC cap;docs.ymlmdBook +cargo doc. Thepr-benchmark-gatejob is advisory (continue-on-error). - PR template asks for:
- What — summary of the change.
- Why — motivation and context.
- Benchmarks — before/after numbers for perf-related changes.
- Authorship — AI / human / mixed; justify human-written sections.
- Sign the CLA when the bot asks.
- A maintainer (and/or AI reviewer) merges.
Scope escalation
If a task is ambiguous, ask in the issue/PR before implementing. If scope grows past "one PR", split it. If you're modifying a shared trait, a build script, or CI config, flag it in the PR description so reviewers catch it.
References
CONTRIBUTING.md— canonical.AGENTS.md— practical contributor guide.CLA.md— the CLA text.SECURITY.md— disclosure (also this book's Security chapter).docs/adr/— authoritative architecture decision records.