Thanks for your interest in contributing.
Use GitHub Issues to report bugs or request features. Include a clear description, reproduction steps, and your environment: OS, ROCm version, GPU architecture (e.g. gfx942, gfx950, gfx1100).
- Get the source and create a branch from
develop. External contributors should fork the repository first; AMD contributors with write access can clone the upstream directly:# Replace <owner> with your fork's owner, or `ROCm` if you have write access. git clone https://github.com/<owner>/rocMLIR.git cd rocMLIR # AMD contributors: name the branch `users/<username>/<description>` or # `<jira-id>-<description>` (e.g. AIROCMLIR-123-fix-attention-mask). # Forks: any branch name works on your side; this convention only applies in # the upstream repo. git checkout -b users/<username>/<description>
- Make your change. Add tests under
mlir/test/and update docs if behavior changes. - Format your C/C++ changes with
clang-format(uses the repo's.clang-format):The CIgit clang-format origin/develop
clang-formatjob runsgit clang-format --diff origin/developand fails on any non-empty diff. - Build and run the test suite locally:
mkdir -p build && cd build cmake -G Ninja .. -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ ninja check-rocmlir
- Open a PR against
develop. Describe what changed and why; link any related issue. - Ensure CI passes and request review from the relevant CODEOWNERS.
By opening a PR, you agree your contribution is licensed under the terms in LICENSE.
The codebase follows the MLIR coding conventions, which inherit the LLVM coding standard with one notable difference: variables, parameters, and class members use camelBack (lowerCamelCase) instead of LLVM's traditional Capitalized form. Functions remain camelBack; classes, enums, and unions are PascalCase.
Style is enforced via .clang-format (LLVM base style) and .clang-tidy at the repo root. Step 3 of the workflow above (git clang-format origin/develop) is the minimum expectation before opening a PR.
Python helpers (under mlir/utils/performance/ and elsewhere) follow yapf and flake8. Format with yapf -i <files> and lint with flake8 <files> before committing changes there.
This project follows the LLVM AI Tool Use Policy. In short:
- You may use any tool (LLMs, copilots, code-gen agents, etc.) to produce contributions, but there must be a human in the loop: read and understand everything you submit, and be ready to answer questions about it during review.
- Submitting unreviewed tool output that shifts the review burden onto maintainers (an "extractive contribution") is not acceptable.
- Be transparent. If a contribution contains a substantial amount of tool-generated content, note it in the PR description or commit message (an
Assisted-by:trailer is the recommended form). - Automated agents that open PRs, post review comments, or otherwise act in this repository without human approval are not allowed.
See the linked policy for the full rationale and details.
This repo is part of the ROCm org. Non-AMD contributors need admin approval before being added as collaborators and must follow AMD's open-source contribution guidelines.
For security issues, do not open a public issue -- see SECURITY.md.