Thank you for your interest in contributing to TorchSpec! This guide will help you get started.
- Clone the repository and create the conda environment:
git clone https://github.com/torchspec-project/TorchSpec.git
cd torchspec
./tools/build_conda.sh
micromamba activate torchspecOr install into your current environment:
./tools/build_conda.sh current- Install the dev dependencies:
pip install -e ".[dev]"- (Optional) Install Flash Attention for full feature support:
pip install -e ".[fa]"We use Ruff for linting and formatting. Pre-commit hooks enforce this automatically:
pre-commit installKey style rules:
- Line length: 100 characters
- Python 3.12+
- Absolute imports only (no relative imports)
- Imports sorted with
isort(via Ruff)
Run the linter manually:
ruff check .
ruff format --check .Run the full test suite:
./tools/run_all_tests.shOr run individual tests with pytest:
pytest tests/test_eagle3_loss.py -v- Fork the repository and create a feature branch from
main. - Make your changes and ensure all tests pass.
- Run
ruff check .andruff format .before committing. - Write a clear PR description explaining what changed and why.
- Link any related issues.
When filing a bug report, please include:
- Python version and OS
- GPU type and driver version
- Steps to reproduce the issue
- Full error traceback