Skip to content

Latest commit

 

History

History
98 lines (68 loc) · 2.29 KB

File metadata and controls

98 lines (68 loc) · 2.29 KB

Contributing to Flash-SAE

Thank you for considering contributing to Flash-SAE. This document outlines the process and standards for contributions.

Development Setup

# Clone and install in development mode
git clone https://github.com/alepot55/flash-sae.git
cd flash-sae
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Code Standards

Style

  • Formatter: Black with line-length 100
  • Linter: Ruff
  • Type hints: Required for all public APIs
# Format code
black flash_sae/ tests/ benchmarks/

# Lint
ruff check flash_sae/ tests/

Testing

All contributions must pass the test suite:

pytest tests/ -v

New features require corresponding tests. Target coverage: 80%+.

Commit Messages

Follow Conventional Commits:

feat: add FP8 quantization support
fix: correct gradient computation in encoder backward
perf: optimize decoder gather pattern for H100
docs: update API reference
test: add ghost gradient unit tests

Pull Request Process

  1. Fork the repository
  2. Create a feature branch from main
  3. Implement changes with tests
  4. Run the full test suite locally
  5. Submit PR with clear description

PR Checklist

  • Tests pass (pytest tests/ -v)
  • Code formatted (black --check .)
  • Linting passes (ruff check .)
  • Documentation updated if needed
  • Commit messages follow convention

Kernel Development

Triton kernel contributions require:

  1. Correctness tests comparing against PyTorch reference
  2. Benchmark results on at least one GPU (report model)
  3. Memory analysis if claiming efficiency improvements
  4. Autograd wrapper for training support

Benchmark Requirements

python benchmarks/benchmark.py --batch 256 512 1024 2048

Include benchmark output in PR description.

Architecture Decisions

Major changes require discussion before implementation. Open an issue with:

  • Problem statement: What limitation are you addressing?
  • Proposed solution: High-level approach
  • Alternatives considered: Why not other approaches?
  • Performance implications: Expected speedup/memory impact

License

By contributing, you agree that your contributions will be licensed under the MIT License.