Contributing Guideο
Thank you for your interest in the AISBench evaluation tool! We welcome all forms of contributions, including but not limited to code, documentation, issue reports, and suggestions.
Table of Contentsο
Task Boardο
We use GitHub Issues to track tasks and issues. Before starting to contribute, we recommend:
Check existing Issues to understand current work priorities
For new features or major changes, it is recommended to create an Issue for discussion first
For bug fixes, you can directly submit a Pull Request
Licenseο
AISBench uses the Apache License 2.0 license. By contributing code to this project, you agree that your contributions will be released under the same license.
All contributors must ensure:
You own or have the right to license the code you submit
Your contributions do not infringe any third-party intellectual property rights
You agree to license your contributions to the project maintainers
Developmentο
Environment Setupο
Python Version Requirements: Only supports Python 3.10, 3.11, or 3.12
Clone Repository:
git clone https://github.com/AISBench/benchmark.git
cd benchmark/
Create Development Environment (recommended to use Conda):
conda create --name ais_bench_dev python=3.10 -y
conda activate ais_bench_dev
Install Development Dependencies:
# Install core dependencies
pip3 install -e ./ --use-pep517
# Install development dependencies (if needed)
pip3 install -r requirements/api.txt
pip3 install -r requirements/extra.txt
Code Structureο
AISBench adopts a registry-based plugin architecture:
Core Plugin Modules: Located in the
ais_bench/benchmark/directorymodels/: Model runtime classesdatasets/: Dataset loadersopenicl/icl_evaluator: ICL evaluatorsopenicl/icl_inferencer: ICL inferencerscalculators/: Performance metric calculatorsregistry.py: Registry definitions
Configuration Files: Located in the
ais_bench/benchmark/configs/directorymodels/: Model configurationsdatasets/: Dataset configurationssummarizers/: Result summarizer configurations
Plugin System: Supports extending functionality through entry_point mechanism, see Plugin Development Guide for details
Development Workflowο
Create Branch:
git checkout -b feature/your-feature-name
# or
git checkout -b fix/your-bug-fix
Develop: Write code, add tests, update documentation
Commit Changes:
git add .
git commit -m "feat: Add new feature description"
Push and Create Pull Request
Code Checking (Linting)ο
Before submitting code, please ensure the code complies with the projectβs code standards:
Python Code Styleο
Follow PEP 8 code style guidelines
Use 4 spaces for indentation
Line length recommended not to exceed 120 characters
Use meaningful variable and function names
Code Formatting Toolsο
It is recommended to use the following tools for code formatting:
# Use black for code formatting (if project is configured)
black ais_bench/
# Use isort for import sorting (if project is configured)
isort ais_bench/
Static Checkingο
Run basic Python syntax checking before submitting:
python -m py_compile your_file.py
Documentationο
Documentation Structureο
Project documentation is located in the docs/ directory:
source_zh_cn/: Chinese documentationsource_en/: English documentation
Documentation Writing Standardsο
Markdown Format: Use Markdown to write documentation
Chinese Documentation: Use simplified Chinese, language should be concise and clear
Code Examples: Provide complete runnable code examples
Link Checking: Ensure all links are valid
Updating Documentationο
When adding new features, please synchronously update related documentation
When modifying APIs, please update corresponding documentation
When adding dataset or model configurations, please provide README.md instructions
Testingο
Test Structureο
Test files are located in the tests/ directory:
UT/: Unit tests (integrated into CI)
Running Testsο
Install test-related dependencies
# Run all tests
python tests/run_tests.py
# Run all tests with multiple processes
python tests/run_tests.py -p 4 # 4 processes
# Run specific test file
pytest tests/UT/test_example.py
Writing Testsο
Unit Tests: Test functionality of single functions or classes
Integration Tests: Test interactions between multiple components
Test Naming: Use
test_prefix to name test functionsTest Coverage: New features should include corresponding test cases, target coverage not less than 80%
Issuesο
Reporting Bugsο
When reporting bugs, please provide the following information:
Problem Description: Clearly describe the problem phenomenon
Reproduction Steps: Provide reproducible steps
Expected Behavior: Describe expected behavior
Actual Behavior: Describe actual behavior
Environment Information:
Python version
Operating system
AISBench version
Related dependency versions
Log Information: Provide relevant error logs or stack traces
Feature Requestsο
When proposing feature requests, please explain:
Feature Description: Describe in detail the feature you want to add
Use Cases: Explain the use cases and value of this feature
Possible Implementation: If you have ideas, you can propose implementation suggestions
Pull Requests (PRs) and Code Reviewsο
Creating Pull Requestsο
Preparation:
Ensure code has passed all tests
Ensure code complies with code standards
Update related documentation
PR Description:
Clearly describe the purpose and changes of the PR
If it resolves an Issue, please use the
Fixes #123format to associateProvide test results or screenshots (if applicable)
Code Review:
Keep PR size moderate for easy review
Respond to review comments promptly
Make modifications based on feedback
Review Processο
Automated Checks: CI checks will automatically run after PR creation
Code Review: Maintainers will review the code
Modification Feedback: Make modifications based on review comments
Merge: After review passes, maintainers will merge the PR
DCO and Signed-off-byο
AISBench uses the Developer Certificate of Origin (DCO) to ensure the legality of contributions.
How to Sign Commitsο
Add a Signed-off-by line to the commit message:
git commit -s -m "feat: Add new feature"
The -s parameter will automatically add the Signed-off-by line.
Signed-off-by Formatο
Signed-off-by: Your Name <your.email@example.com>
Meaningο
By adding Signed-off-by, you confirm:
The contribution is your original work, or you have the right to submit it under an open source license
You agree to release the contribution under Apache License 2.0
PR Title and Classificationο
Title Formatο
Use the following format:
[type][scope]<subject>
Where:
[type]: Commit type, see type descriptions below[scope]: Affected scope (optional), such as models, datasets, docs, etc.<subject>: Brief descriptive title
Typesο
[feat]: New feature[fix]: Bug fix[docs]: Documentation update[style]: Code format adjustment (does not affect functionality)[refactor]: Code refactoring[test]: Test related[chore]: Build process or auxiliary tool changes[perf]: Performance optimization
Examplesο
[feat][models]Add new model backend support
[fix][datasets]Fix dataset loading error
[docs][readme]Update installation instructions
[test][calculators]Add performance calculator tests
Code Qualityο
Code Review Standardsο
Code reviews will focus on the following aspects:
Functional Correctness: Whether the code implements expected functionality
Code Quality: Whether the code is clear and maintainable
Test Coverage: Whether there is sufficient test coverage
Documentation Completeness: Whether related documentation has been updated
Performance Impact: Whether there is a negative impact on performance
Backward Compatibility: Whether existing functionality has been broken
Best Practicesο
Single Responsibility: Each function/class should do only one thing
DRY Principle: Avoid duplicate code
Clear Comments: Add comments for complex logic
Error Handling: Properly handle exception cases
Type Hints: It is recommended to use type hints to improve code readability
Adding or Changing Componentsο
Adding New Model Backendsο
Refer to Supporting New Models
Adding New Datasets and Accuracy Evaluatorsο
Adding New Inferencersο
Refer to Supporting New Inferencers
Breaking Changesο
Please try to keep changes concise. For major architectural changes (>500 lines of code, excluding data/config/tests), we expect you to:
Discuss in Advance: Create a discussion in GitHub Issues, explaining the reason for changes and scope of impact
Backward Compatibility: Try to maintain backward compatibility, or provide migration guides
Documentation Updates: Update all related documentation
Test Coverage: Ensure sufficient test coverage
Version Notes: Detail changes in CHANGELOG
Breaking Change Examplesο
API interface changes
Configuration file format changes
Default behavior changes
Removal of deprecated features
Review Expectationsο
As a Contributorο
Be Patient: Reviews may take some time, please be patient
Respond Actively: Respond to review comments promptly and make necessary modifications
Stay Polite: Maintain a professional and polite attitude in discussions
Continuous Improvement: Treat reviews as learning opportunities and continuously improve code quality
As a Reviewerο
Respond Promptly: Review PRs as soon as possible and provide constructive feedback
Friendly Communication: Provide feedback in a friendly and professional manner
Explain Reasons: Explain why modifications are needed to help contributors understand
Recognize Contributions: Recognize good contributions and encourage continued participation
Acknowledgmentsο
Thank you to all developers who have contributed to AISBench! Your contributions make this project better.
Ways to Contributeο
You can contribute in the following ways:
π Report Bugs
π‘ Propose Feature Suggestions
π Improve Documentation
π» Submit Code
π§ͺ Write Tests
π Code Review
π’ Promote the Project
Contributor Listο
All contributors will be recognized in the project. Thank you for every contributorβs efforts!
If you have any questions, please feel free to raise them in GitHub Issues.