Thank you for your interest in contributing to IRis! This document provides guidelines and instructions for contributing to this ML-powered compiler optimization project for RISC-V.
- Code of Conduct
- Getting Started
- Development Setup
- Project Structure
- How to Contribute
- Coding Standards
- Testing Guidelines
- Pull Request Process
- Reporting Bugs
- Feature Requests
By participating in this project, you agree to maintain a respectful and inclusive environment. Please be considerate in your interactions with other contributors.
Before contributing, please:
- Read the README.md to understand the project's purpose and architecture
- Familiarize yourself with the ML pipeline: feature extraction, pass sequence generation, model training, and inference
- Ensure you have the required dependencies installed
System Requirements:
- LLVM/Clang 18+ with RISC-V support
- RISC-V cross-compiler (
riscv64-linux-gnu-gcc) - QEMU RISC-V emulator
- Python 3.8+
- Node.js 18+ (for frontend)
- Git LFS (for large model and data files)
Some model checkpoints and datasets are tracked using Git LFS.
After cloning the repository, run:
git lfs install
git lfs pull# Clone the repository
git clone https://github.com/your-username/IRIS.git
cd IRIS
# Install System Dependencies (Ubuntu/Debian)
sudo apt-get update
sudo apt-get install -y clang llvm qemu-user-static gcc-riscv64-linux-gnu
# Install Python dependencies
pip install -r tools/requirements.txt
pip install black bandit flake8 pytestWe use a comprehensive CI pipeline to ensure code quality. Please run these checks locally before submitting a PR.
We use black to ensure consistent code style.
# Check for formatting issues
black --check .
# Automatically format code
black .We use bandit to scan for common security vulnerabilities.
# Run security scan
bandit -r . -llWe use flake8 to catch syntax errors and undefined names.
# Run linting
flake8 . --count --select=E9,F63,F7,F82 --show-source --statisticsRun the core tools to ensure everything is working:
# Test Feature Extractor
python tools/test_feature_extractor.py
# Test Pass Sequence Generator
python tools/pass_sequence_generator.py -n 5 -s mixed
# Smoke Test Training Data Generation (Native)
python tools/generate_training_data_hybrid.py \
--programs-dir training_programs \
--output-dir test_output \
--num-sequences 2 \
--strategy random \
--no-qemu \
--target-arch nativecd iris-website/backend
pip install -r requirements.txt
python app.py # Starts on http://localhost:5001cd iris-website
npm install
npm run dev # Starts on http://localhost:3000IRIS/
├── .github/ # GitHub workflows and templates
├── data/ # Large datasets (Git LFS)
├── inference_folder/ # Inference scripts
├── iris-website/ # Full-stack web application
│ ├── backend/ # Flask REST API
│ ├── frontend/ # Next.js frontend
│ └── README.md
├── logs/ # Logs and experiment outputs
├── models/ # Model training scripts
├── models_seqgen/ # Sequence generation model checkpoints
├── preprocessing/ # Data preprocessing logic
├── preprocessing_output/ # Generated preprocessing artifacts
├── tools/ # ML pipeline utilities
├── training_programs/ # C programs for training
├── .gitattributes # Git LFS configuration
├── .gitignore # Git ignore rules
├── CODE_OF_CONDUCT.md # Community guidelines
├── CONTRIBUTING.md # Contribution guidelines
├── GSOC-2026.md # GSoC-related information
├── LICENSE # Project license
├── README.md # Project overview and setup
└── REMAINING_PROGRAMS_TO_ADD.md # Pending training programs
We welcome contributions in the following areas:
-
ML Pipeline Improvements
- New feature extraction methods
- Model architecture enhancements
- Training data generation improvements
-
Training Programs
- Additional C programs for training diversity
- Programs covering edge cases or specific optimization patterns
-
Frontend/Backend Development
- UI/UX improvements
- API endpoint enhancements
- Performance optimizations
-
Documentation
- Code documentation
- Tutorial improvements
- Usage examples
-
Bug Fixes
- Compilation issues
- Model inference bugs
- API errors
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature-name) - Make your changes
- Test your changes thoroughly
- Commit with clear, descriptive messages
- Push to your fork
- Open a Pull Request
- Follow PEP 8 style guidelines
- Use type hints where applicable
- Include docstrings for functions and classes
- Keep functions focused and modular
def extract_features(ir_file: str, verbose: bool = False) -> dict:
"""
Extract LLVM IR features from the given file.
Args:
ir_file: Path to the LLVM IR file
verbose: Enable detailed logging
Returns:
Dictionary containing extracted features
"""
# Implementation- Use TypeScript for type safety
- Follow React best practices and hooks patterns
- Use Tailwind CSS for styling
- Keep components small and reusable
Use clear, descriptive commit messages:
feat: Add new feature extraction method for loop analysis
fix: Resolve compilation error with nested functions
docs: Update API documentation for optimize endpoint
refactor: Simplify pass sequence generation logic
Feature Extraction:
python tools/feature_extractor.py path/to/program.c --verboseBackend API:
cd iris-website/backend
python test_api.py
python test_transformer_integration.pyToolchain Verification (Manual):
clang --version
riscv64-linux-gnu-gcc --version
qemu-riscv64 --version- Test new features thoroughly before submitting
- Include both positive and negative test cases
- Verify compilation success with RISC-V toolchain
- Test model predictions against baseline optimizations
When modifying the ML pipeline:
- Compare results against standard optimization levels (-O0, -O1, -O2, -O3)
- Document performance improvements or regressions
- Test on diverse program types
-
Before Submitting:
- Ensure all tests pass
- Update documentation if needed
- Verify no regressions in existing functionality
-
PR Description:
- Clearly describe the changes
- Reference any related issues
- Include test results if applicable
-
Review Process:
- Address reviewer feedback promptly
- Keep discussions constructive
- Be open to suggestions
-
Merging:
- PRs require review approval before merging
- Squash commits if requested
- Ensure CI passes (if configured)
When reporting bugs, please include:
-
Environment Information:
- Operating system and version
- Python version
- LLVM/Clang version
- QEMU version
-
Steps to Reproduce:
- Minimal code example if applicable
- Command sequence that triggers the bug
-
Expected vs Actual Behavior:
- What you expected to happen
- What actually happened
-
Error Messages:
- Full error output/stack traces
- Relevant log files
When proposing new features:
-
Describe the Problem:
- What limitation are you facing?
- How does this affect your workflow?
-
Propose a Solution:
- How should the feature work?
- Are there alternative approaches?
-
Consider Impact:
- How does this fit with existing architecture?
- What are potential side effects?
If you have questions about contributing:
- Open an issue with the
questionlabel - Review existing documentation
- Check closed issues for similar questions
Thank you for contributing to IRis! Your efforts help advance ML-powered compiler optimization for the RISC-V ecosystem.