Thank you for your interest in contributing to Relax! This document provides guidelines and information for contributors.
For a more detailed guide covering development environment setup, testing, and documentation, see our full Contributing Guide.
- Code of Conduct
- How Can I Contribute?
- Developing
- Code Style
- Commit Conventions
- Pull Request Process
- Reporting Bugs
- Requesting Features
- Community
- License
This project follows a standard code of conduct. Please be respectful, inclusive, and constructive in all interactions. We are committed to providing a welcoming and harassment-free experience for everyone.
- Bug Fixes — Find and fix issues in the codebase
- New Features — Implement new algorithms, models, or utilities
- Performance — Optimize training throughput, memory usage, or startup time
- Refactoring — Improve code quality without changing behavior
- Documentation — Improve guides, add examples, fix typos (bilingual: English + Chinese)
- Bug Reports — Report issues with clear reproduction steps
- Feature Requests — Propose enhancements via GitHub Issues
- Examples — Add new training examples or tutorials
- Testing — Improve test coverage and add integration tests
Follow the development workflow for step-by-step commands:
- Fork and clone the repository, add
upstream, and sync your localmain. - Set up the development environment, install Git hooks with pre-commit, and install Relax in editable mode.
- If you need to validate the training environment, follow the quick start or the DeepEyes example.
- Create a working branch.
- Make your changes, add or update tests, and run the relevant unit tests. Update both language versions of the documentation when needed.
- Review, stage, and commit your changes using Conventional Commits. Git hooks run automatically on commit; review any fixes and stage them again before retrying.
- Push your working branch to your fork and open a PR targeting
redai-studio/Relax'smainbranch. Fill out the PR template.
- Formatter: Ruff, line width 119 (configured in
pyproject.toml) - Imports: Managed by
isortvia Ruff - Type Hints: Required for all public APIs
- Docstrings: Required for public functions and classes
- Logging: Use
relax.utils.logging_utils.get_logger(__name__)— neverprint()orlogging.getLogger() - Copyright Header: All
.pyfiles underrelax/must include:# Copyright (c) 2026 Relax Authors. All Rights Reserved. - No Wildcard Imports:
from x import *is not allowed
We follow Conventional Commits:
| Prefix | Usage |
|---|---|
feat: |
New feature |
fix: |
Bug fix |
docs: |
Documentation only |
style: |
Code style (formatting, no logic change) |
refactor: |
Code refactoring |
test: |
Adding or updating tests |
chore: |
Maintenance, CI, build changes |
perf: |
Performance improvements |
Example:
feat(rollout): add streaming data consumption for async mode
- Implement StreamingDataLoader for TransferQueue
- Add configurable staleness via --max-staleness
- Update documentation with async training guide
- Code compiles and runs without errors
-
pre-commit run --all-filespasses - Tests pass (
pytest tests/) - Documentation updated (if applicable)
- Commit messages follow Conventional Commits
- Automated CI — Linting, formatting, and test checks run automatically
- Code Review — At least one maintainer reviews the PR
- Feedback — Address review comments promptly
- Approval & Merge — Maintainer merges after approval
- Keep PRs focused and reasonably sized
- Provide a clear description of what, why, how, and testing
- Link related issues (e.g.,
Fixes #123) - Add screenshots or logs for UI or behavior changes
Use the Bug Report template and include:
- Environment — OS, Python version, CUDA version, GPU type
- Steps to Reproduce — Minimal commands to trigger the bug
- Expected vs Actual Behavior — What you expected and what happened
- Logs / Error Messages — Full stack trace or relevant log output
- Configuration — Training script, args, or config files used
Use the Feature Request template and include:
- Problem Statement — What problem does this solve?
- Proposed Solution — How should it work?
- Alternatives Considered — Other approaches you thought about
- Use Case — Concrete examples of how you'd use it
- GitHub Issues — Bug reports and feature requests
- GitHub Discussions — Questions and general discussion
- WeChat Group — Join our community (see README for QR code)
By contributing to Relax, you agree that your contributions will be licensed under the Apache License 2.0.