Thank you for contributing to m40-llm!
We use Conventional Commits. Format your commit header as:
<type>(<scope>): <subject>
Rules:
- type ∈ feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
- scope: optional; use components like cuda, kvcache, gguf, server, infer, allocator, attn, mlp, rmsnorm, build, ci, docs, tests
- subject: imperative mood, ≤ 50 chars, no period. Keep the subject crisp and specific.
- separate subject from body with a blank line
- wrap body at ~72 columns; explain what changed and why (not the steps you ran)
- Avoid vague subjects like "fmt" or "fixes" — say what changed and why
- Prefer
refactor(...)overchore(...)for structural/API changes that do not alter behavior
cargo build --no-default-featurescargo build --features cuda# Run all non-CUDA tests
cargo test --no-default-features --locked
# Run all CUDA tests (requires NVCC)
cargo test --features cuda --locked
# Run specific test with logging
RUST_LOG=debug cargo test test_name -- --nocapturecuda: Enables NVIDIA CUDA support (requires CUDA toolkit)server: Enables HTTP server functionality- Use
stylefor formatting-only changes (no code semantics). Prefer squashing style changes into the related code commit rather than separate noisy commits - Mark breaking changes with
!after the type (e.g.,refactor(api)!: ...) and include migration notes; or add aBREAKING CHANGE:footer
Examples:
refactor(cuda): tighten unsafe surface across FFItest(attn): add last-token parity tests for odd head_dimstyle: format Rust code with rustfmt (no functional changes)refactor(api)!: remove deprecated d_data_base; use CudaContext handles
We provide a commit template in .gitmessage. Enable it locally with:
git config commit.template .gitmessage
- Prefer topic branches; avoid pushing directly to main
- Keep PRs focused and reviewable
- Update existing PRs instead of opening duplicates
- Keep non-CUDA path green: builds and tests should pass without CUDA
- Gate server behind the
serverfeature - CUDA code behind the
cudafeature - FP16 storage / FP32 compute; target
sm_52for Tesla M40
- Rust: idiomatic, minimal comments, imports at top
- C/CUDA:
m40llm_*naming for exported symbols; stable FFI - Avoid redundant files; modify in place
- Add CUDA-gated smoke tests for FFI when possible
- Do not add tests for docs or configuration-only changes
- Do not commit large binaries or secrets
- Respect
.gitignore - Use
Co-authored-bytrailers when appropriate
We keep Git hooks in .githooks. To enable them locally, run:
git config core.hooksPath .githooks
Hooks provided:
- pre-commit: runs
cargo fmt --all -- --checkand rejects unformatted code. - commit-msg: enforces Conventional Commits via cocogitto, rejects literal
\nsequences, and keeps commit subjects at 100 characters or fewer. - Install cocogitto once:
cargo install cocogitto. - Optionally enable strict history checks with:
export COG_STRICT=1.
We also provide a commit message template. Enable it with:
git config commit.template .gitmessage