Skip to content

Latest commit

 

History

History
83 lines (58 loc) · 1.58 KB

File metadata and controls

83 lines (58 loc) · 1.58 KB

Contributing to TorchSpec

Thank you for your interest in contributing to TorchSpec! This guide will help you get started.

Development Setup

  1. 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 torchspec

Or install into your current environment:

./tools/build_conda.sh current
  1. Install the dev dependencies:
pip install -e ".[dev]"
  1. (Optional) Install Flash Attention for full feature support:
pip install -e ".[fa]"

Code Style

We use Ruff for linting and formatting. Pre-commit hooks enforce this automatically:

pre-commit install

Key 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 .

Running Tests

Run the full test suite:

./tools/run_all_tests.sh

Or run individual tests with pytest:

pytest tests/test_eagle3_loss.py -v

Pull Requests

  1. Fork the repository and create a feature branch from main.
  2. Make your changes and ensure all tests pass.
  3. Run ruff check . and ruff format . before committing.
  4. Write a clear PR description explaining what changed and why.
  5. Link any related issues.

Reporting 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