Contributing to Humigence
Thank you for your interest in contributing to Humigence! This document provides guidelines and information for contributors.
π€ How to Contribute
Reporting Issues
Before creating an issue, please:
- Search existing issues to avoid duplicates
- Check the troubleshooting section in the README
- Provide detailed information about your environment and the issue
When creating an issue, include:
- Environment: OS, Python version, GPU model, CUDA version
- Steps to reproduce: Clear, numbered steps
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Error messages: Full error logs
- Screenshots: If applicable
Suggesting Features
We welcome feature suggestions! Please:
- Check the roadmap in the README first
- Describe the use case and why it would be valuable
- Provide examples of how it would work
- Consider implementation complexity
Code Contributions
Getting Started
Fork the repository
Clone your fork:
git clone https://github.com/your-username/humigence.git cd humigenceCreate a feature branch:
git checkout -b feature/amazing-featureSet up development environment:
pip install -r requirements.txt pip install -e .
Development Guidelines
Code Style
- Python: Follow PEP 8 style guidelines
- Line length: 88 characters (Black formatter)
- Imports: Use absolute imports, group by standard library, third-party, local
- Docstrings: Use Google-style docstrings
- Type hints: Use type hints for function parameters and return values
Testing
- Write tests for new features
- Run existing tests before submitting:
python3 -m pytest tests/ - Test on different hardware if possible (single GPU, multi-GPU)
Documentation
- Update README.md if adding new features
- Add docstrings to new functions and classes
- Update type hints for better IDE support
- Include examples in docstrings
Pull Request Process
Ensure tests pass:
python3 -m pytest tests/ python3 -m flake8 cli/ pipelines/ utils/Update documentation if needed
Commit your changes:
git add . git commit -m "feat: add amazing feature"Push to your fork:
git push origin feature/amazing-featureCreate a Pull Request with:
- Clear title and description
- Reference any related issues
- Include screenshots if applicable
- List any breaking changes
Commit Message Convention
We use conventional commits:
feat:New featuresfix:Bug fixesdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
Examples:
git commit -m "feat: add multi-GPU training support"
git commit -m "fix: resolve GPU detection issue"
git commit -m "docs: update installation instructions"
ποΈ Development Setup
Prerequisites
- Python 3.8+
- CUDA-compatible GPU
- Git
Local Development
Clone and install:
git clone https://github.com/your-username/humigence.git cd humigence pip install -r requirements.txt pip install -e .Set up Unsloth:
python3 training/unsloth/setup_humigence_unsloth.pyRun tests:
python3 -m pytest tests/Test CLI:
python3 cli/main.py
Project Structure
humigence/
βββ cli/ # Command-line interface
β βββ main.py # Main entry point
β βββ config_wizard.py # Configuration wizard
β βββ lora_wizard.py # LoRA-specific wizard
βββ training/ # Training modules
β βββ unsloth/ # Unsloth integration
βββ pipelines/ # Training pipelines
βββ utils/ # Utility functions
βββ config/ # Configuration files
βββ tests/ # Test files
βββ docs/ # Documentation
π§ͺ Testing
Running Tests
# Run all tests
python3 -m pytest tests/
# Run specific test file
python3 -m pytest tests/test_gpu_selection.py
# Run with verbose output
python3 -m pytest tests/ -v
# Run with coverage
python3 -m pytest tests/ --cov=cli --cov=pipelines --cov=utils
Writing Tests
- Test files should be named
test_*.py - Test functions should be named
test_* - Use descriptive names for test functions
- Test both success and failure cases
- Mock external dependencies when possible
Example:
def test_gpu_detection_single_gpu():
"""Test GPU detection with single GPU."""
gpu_count, gpus = detect_gpus()
assert gpu_count == 1
assert len(gpus) == 1
assert gpus[0]['index'] == 0
π Documentation
Code Documentation
- Functions: Include docstring with description, parameters, returns, and examples
- Classes: Include docstring with description and usage examples
- Modules: Include module-level docstring
Example:
def detect_gpus():
"""
Detect available GPUs on the system.
Returns:
tuple: (gpu_count, gpus) where gpus is a list of dicts
with 'index', 'name', and 'memory' keys
Example:
>>> gpu_count, gpus = detect_gpus()
>>> print(f"Found {gpu_count} GPUs")
"""
README Updates
When adding features, update:
- Features section with new capabilities
- Usage examples with new commands
- Configuration section with new options
- Troubleshooting section with common issues
π Bug Reports
Before Reporting
- Check existing issues for similar problems
- Try the latest version from main branch
- Check troubleshooting section in README
- Search closed issues for solutions
Bug Report Template
**Bug Description**
A clear description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Run command '...'
2. Select option '...'
3. See error
**Expected Behavior**
What you expected to happen.
**Environment**
- OS: [e.g., Ubuntu 20.04]
- Python: [e.g., 3.9.7]
- GPU: [e.g., RTX 5090]
- CUDA: [e.g., 11.8]
**Error Logs**
Paste error logs here
**Additional Context**
Any other context about the problem.
π‘ Feature Requests
Before Requesting
- Check the roadmap in README
- Search existing issues for similar requests
- Consider implementation complexity
Feature Request Template
**Feature Description**
A clear description of the feature you'd like to see.
**Use Case**
Describe the problem this would solve or the workflow it would improve.
**Proposed Solution**
Describe how you think this should work.
**Alternatives**
Describe any alternative solutions you've considered.
**Additional Context**
Any other context, mockups, or examples.
π·οΈ Release Process
Version Numbering
We use Semantic Versioning:
- MAJOR: Incompatible API changes
- MINOR: New functionality in a backwards compatible manner
- PATCH: Backwards compatible bug fixes
Release Checklist
- All tests pass
- Documentation updated
- CHANGELOG.md updated
- Version bumped in pyproject.toml
- Release notes prepared
- Tag created
π Getting Help
- GitHub Issues: For bugs and feature requests
- GitHub Discussions: For questions and general discussion
- Email: [Contact information if available]
π Recognition
Contributors will be recognized in:
- CONTRIBUTORS.md file
- Release notes for significant contributions
- GitHub contributors page
π License
By contributing to Humigence, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Humigence! π