We'd love to accept your patches and contributions to this project.
This file covers the policies that apply to every contributor. The Contributing guide on the website contains the same text and adds details for maintainers and frequent contributors, such as commit access and CI configuration.
Please file issues or reach out on any of these channels before doing substantial work; this will ensure that others don‘t duplicate the work and that there’s a chance to discuss any design issues.
This project follows the LF Projects code of conduct.
IREE is a sandbox-stage project of the LF AI & Data Foundation. Technical oversight of the project is the responsibility of its Technical Steering Committee (TSC), as set out in the IREE Technical Charter.
As provided for in section 2.b of the charter, the voting members of the TSC are:
See MAINTAINERS.md for how the TSC operates. TSC meetings are open to everyone.
Contributors must certify that they wrote or otherwise have the right to submit the code they are contributing to the project, by agreeing to the Developer Certificate of Origin (DCO).
Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
Signing is enforced by the DCO GitHub App (see also the dcoapp/app repository).
The DCO check requires that all commits included in pull requests either are cryptographically signed by a member of the repository's organization or include a Signed-off-by message as a git trailer. Frequent contributors can sign their commits cryptographically.
Signed-off-by to commitsThis requires less setup and is suitable for first time contributors.
Contributors sign-off their agreement by adding a Signed-off-by line to commit messages:
This is my commit message Signed-off-by: Random J Developer <random@developer.example.org>
Git will automatically append this message if you use the -s option:
git commit -s -m 'This is my commit message'
Users of Visual Studio Code can add "git.alwaysSignOff": true, in their settings
See .git/hooks/prepare-commit-msg.sample for how to automatically add this using a git hook
Our formatting rules are enforced by language-specific formatters like clang-format for C++ and black for Python. In addition to formatting, we follow these coding standards:
The C++ compiler portion of the project follows the MLIR style guide based on the LLVM coding standards. We also follow the recommendations of the LLVM Programmer's Manual.
IREE deviates from the MLIR style guide in the following ways:
if statements and loops.static functions in anonymous namespaces to avoid repeatedly reopening/closing namespaces..td) files should use a Pass suffix (e.g., def FooBarPass), while the corresponding implementation file should not include the Pass suffix (e.g., FooBar.cpp, not FooBarPass.cpp).Most of the code style is derived from the Google Style Guides for the appropriate language.
For code outside of the compiler/ and runtime/ subdirectories, follow the style used in existing files.
We use pre-commit to run assorted formatters and lint checks. The configuration file at .pre-commit-config.yaml defines which “hooks” run.
clang-format (C/C++) and Black (Python) can also be set to run automatically in your editor of choice.Improvements to code structure and clarity are welcome but please file issues to track such work first. Pure style changes are unlikely to be accepted unless they are applied consistently across the project.
With few exceptions, features should be accompanied by automated tests.
We use a mix of in-tree and out-of-tree unit and integration tests. For more information about the types of tests used across the project, refer to the testing guide.
All submissions, including submissions by maintainers, require review. We use GitHub pull requests (PRs) for this purpose. Consult GitHub Help for more information on using pull requests.
We use GitHub Actions to automatically build and test various parts of the project.
Some workflows only run on commits after they are merged. See CI behavior manipulation to learn how to customize this behavior.
PRs are squash-merged, so the PR title and description become the commit message, and the commit messages on the PR branch are discarded. Write them for someone reading git log or bisecting a regression later, and update them when the PR changes during review.
Title: a short, imperative summary of what changes and, if it fits, why, prefixed with the affected area, for example [CI] Bump iree-test-suites to fix sharktank test failure. Keep it under 72 characters. Avoid ambiguous titles like “Fix bug” or “Fix CI”.
Description: start with why, then what.
Fixes #1234 for issues that the PR resolves, Depends on #1234 for PRs that it builds on, CI trailers such as ci-extra:, and Assisted-by: for AI tools.Keep the description concise and self-contained: links add context but do not replace an explanation, and they must be public. Leave out restatements of the diff, implementation details that belong in code comments, review history, and @-mentions, which notify people again on every cherry-pick. A description that keeps growing is a sign that the PR should be split. Small changes need one or two sentences; longer descriptions can use headings such as ## Why, ## Change, and ## Results.
See also:
After review and presubmit checks, PRs should typically be merged using “squash and merge”.
It is assumed that the PR author will merge their change unless they ask someone else to merge it for them (e.g. because they don't have write access yet).
We adopt the LLVM AI Tool Use Policy and require all AI-assisted contributions (Pull Requests, issues, design proposals) to be reviewed and understood by the author(s).
The key points include:
Assisted-by: tool-name or the Co-authored-by: tool-name tool@email trailer in PR descriptions.We extend the LLVM policy with an exception for AI bot-authored contributions (e.g., updating dependencies, fixing build script, etc.); bot account may create Pull Requests as long as the bot maintainers ensure they are first in line and primarily responsible for reviewing those contributions.