Contributing to TensorRT-LLM
Thank you for your interest in contributing to TensorRT-LLM! This guide outlines the process for contributing code, documentation, and other improvements to the project.Issue Tracking
All enhancement, bugfix, or change requests must begin with the creation of a TensorRT-LLM Issue Request.- The issue request must be reviewed by TensorRT-LLM engineers and approved prior to code review.
- This helps ensure your contribution aligns with the project’s goals and roadmap.
Developer Workflow
Follow these steps to contribute code:1. Fork the Repository
Developers must first fork the upstream TensorRT-LLM OSS repository.2. Clone and Push Changes
Clone the forked repository and push changes to your personal fork:3. Create a Pull Request
Once your code changes are staged on the fork and ready for review, create a Pull Request to merge the changes from a branch of your fork into a selected branch of upstream.- PRs should typically target the
mainbranch. - Creation of a PR kicks off the code review process.
- At least one TensorRT-LLM engineer will be assigned for the review.
- When the PR is under review, the label
Pending Reviewwill be added. - If changes are requested, the reviewer will add the label
Changes Requested. - Once changes are approved, CI will be launched to validate the change.
- When CI passes, the reviewer will merge the PR.
- If CI reports any failures, it’s up to the requester to fix any CI failures before requesting another review.
Pull Request Guidelines
PR Title Format
The naming of pull requests follows the Conventional Commits specification: Good PR Title Examples:feat: Add support for starcoder-v2 FP8 base + FP16/BF16 LoRABREAKING CHANGE: Set default max batch size to 2048chore: Remove version from plugins .soNone: Stringized enums for better error msgsfix https://github.com/NVIDIA/TensorRT-LLM/issues/700: a Memory leak issue in C++ runtime[TRTLLM-5516] perf: replicate dummy request for cuda graph padding(NVIDIAN only)[nvbug/5334370] fix: Fix one model EAGLE3(NVIDIAN only)
For NVIDIA developers: please include the JIRA number or NVBUG ID in the PR title whenever possible. Also, ensure your GitHub account displays your full name or NVIDIA account name in the
Name field of your profile.PR Description
In the PR description, please address these points:- Background or motivation: Why is the change necessary?
- Summary: Summarize the changes in one paragraph, if possible.
- Large PRs: If the PR is large, explain why it cannot be broken down into multiple PRs.
- Impacts: Potential performance or functional impacts of the changes. If there are risks, please inform the reviewers.
- Related PRs: Link to related PRs.
For NVIDIA developers: please submit feature or bug fixes to the dedicated branch specified in the nvbug Keywords field. For example, if a bug is reported on the release/v0.20 branch, please submit the fix to
release/v0.20 instead of the main branch.Please add the “release blocker” label to any PRs that could potentially cause a release delay.Keep PRs Concise
Please try to keep pull requests as concise as possible:- Avoid committing commented-out code.
- Wherever possible, each PR should address a single concern.
- If there are several otherwise-unrelated things that should be fixed to reach a desired endpoint, our recommendation is to open several PRs and indicate the dependencies in the description.
- The more complex the changes are in a single PR, the more time it will take to review those changes.
Coding Guidelines
Before submitting code, make sure you follow the TensorRT-LLM Coding Guidelines.Pre-commit Hooks
We usepre-commit for automatic code formatting and validation. Install the pre-commit package in your local Python environment:
pre-commit will be triggered on every commit:
Tests and Code Review for Protected APIs
Some APIs are committed to be stable; any breaking changes to these APIs require careful design and review. This repo contains an API stability testsuite to protect committed APIs (currently including the core components of LLM API). If your PR brings breaking changes to the protected APIs, the API stability tests will fail, reporting errors like:Signing Your Work (DCO)
We require that all contributors “sign-off” on their commits. This certifies that the contribution is your original work, or you have rights to submit it under the same license, or a compatible license. Signing off your commit means you accept the terms of the Developer Certificate of Origin (DCO).How to Sign-Off
To sign off on a commit, simply use the--signoff (or -s) option when committing your changes:
Developer Certificate of Origin (DCO)
Full text of the DCO:Next Steps
Once you’re familiar with the contribution process:- Review the Coding Guidelines to ensure your code follows project standards
- If you need to build from source, see Building from Source
- Set up your development environment and start contributing!