Contributing to Optimum TPU
We’re excited that you’re interested in contributing to Optimum TPU! Whether you’re fixing bugs, adding new features, improving documentation, or sharing your experiences, your contributions are highly valued 😄
Getting Started
- Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/optimum-tpu.git
cd optimum-tpu
- Install the package locally:
python -m venv .venv
source .venv/bin/activate
python -m pip install . -f https://storage.googleapis.com/libtpu-releases/index.html
Development Tools
The project includes a comprehensive Makefile with commands for various development tasks:
Testing
make tests # Run all the non-TGI-related tests
make tgi_test # Run TGI tests with PyTorch/XLA
make tgi_test_jetstream # Run TGI tests with Jetstream backend
make tgi_docker_test # Run TGI integration tests in Docker
Code Quality
make style # Auto-fix code style issues
make style_check # Check code style without fixing
Documentation
make preview_doc # Preview documentation locally
Docker Images
make tpu-tgi # Build TGI Docker image
make tpu-tgi-ie # Build TGI inference endpoint image
make tpu-tgi-gcp # Build TGI Google Cloud image
TGI Development
When working on Text Generation Inference (/text-generation-inference
folder), you might also want to build a TGI image from scratch. To do this, refer to the manual image building section of the serving how to guide
- Build the standalone server:
make tgi_server
Pull Request Process
- Create a new branch:
git checkout -b your-feature-name
Make your changes
Run tests:
make tests
# Run more specialized test if needed such as make tgi_test, make tgi_test_jetstream, make tgi_docker_test
make style_check
- Submit your PR with:
- Clear description of changes
- Test results
- Documentation updates if needed
Need Help?
- Check the documentation
- Open an issue for bugs or feature requests
License
By contributing to Optimum TPU, you agree that your contributions will be licensed under the Apache License, Version 2.0.