1*523fa7a6SAndroid Build Coastguard WorkerThank you for your interest in contributing to ExecuTorch! We want to make 2*523fa7a6SAndroid Build Coastguard Workerit easy to contribute to this project. 3*523fa7a6SAndroid Build Coastguard Worker 4*523fa7a6SAndroid Build Coastguard Worker 5*523fa7a6SAndroid Build Coastguard Worker 6*523fa7a6SAndroid Build Coastguard Worker## Dev Install 7*523fa7a6SAndroid Build Coastguard Worker 8*523fa7a6SAndroid Build Coastguard WorkerSet up your environment by following the instructions at 9*523fa7a6SAndroid Build Coastguard Workerhttps://pytorch.org/executorch/stable/getting-started-setup.html to clone 10*523fa7a6SAndroid Build Coastguard Workerthe repo and install the necessary requirements. 11*523fa7a6SAndroid Build Coastguard Worker 12*523fa7a6SAndroid Build Coastguard Worker 13*523fa7a6SAndroid Build Coastguard Worker 14*523fa7a6SAndroid Build Coastguard Worker## Contributing workflow 15*523fa7a6SAndroid Build Coastguard WorkerWe actively welcome your pull requests (PRs). 16*523fa7a6SAndroid Build Coastguard Worker 17*523fa7a6SAndroid Build Coastguard Worker1. [Claim an issue](#claiming-issues), if present, before starting work. If an 18*523fa7a6SAndroid Build Coastguard Worker issue doesn't cover the work you plan to do, consider creating one to provide 19*523fa7a6SAndroid Build Coastguard Worker context about it, and to build consensus about the scope and solution. 20*523fa7a6SAndroid Build Coastguard Worker1. Create your new branch from `main` in your forked repo, with a name 21*523fa7a6SAndroid Build Coastguard Worker describing the work you're completing; e.g., `add-feature-x`. 22*523fa7a6SAndroid Build Coastguard Worker1. If you've added code that should be tested, add tests. Ensure all tests pass. 23*523fa7a6SAndroid Build Coastguard Worker See the [testing section](#testing) for more information. 24*523fa7a6SAndroid Build Coastguard Worker1. If you've changed APIs or added a new tool or feature, [update the 25*523fa7a6SAndroid Build Coastguard Worker documentation](#updating-documentation). 26*523fa7a6SAndroid Build Coastguard Worker1. If you added an experimental API or deprecated an existing API, follow the 27*523fa7a6SAndroid Build Coastguard Worker [API Life Cycle and Deprecation Policy](/docs/source/api-life-cycle.md). 28*523fa7a6SAndroid Build Coastguard Worker1. Make sure your code follows the [style guides](#coding-style) and passes the 29*523fa7a6SAndroid Build Coastguard Worker [lint checks](#lintrunner). 30*523fa7a6SAndroid Build Coastguard Worker1. If you haven't already, complete the [Contributor License Agreement ("CLA")](#contributor-license-agreement-cla). 31*523fa7a6SAndroid Build Coastguard Worker1. Create a pull request in the `pytorch/executorch` Github repo using the 32*523fa7a6SAndroid Build Coastguard Worker [instructions below](#pull-requests). 33*523fa7a6SAndroid Build Coastguard Worker 34*523fa7a6SAndroid Build Coastguard Worker 35*523fa7a6SAndroid Build Coastguard Worker 36*523fa7a6SAndroid Build Coastguard Worker## Issues 37*523fa7a6SAndroid Build Coastguard Worker 38*523fa7a6SAndroid Build Coastguard Worker### Creating Issues 39*523fa7a6SAndroid Build Coastguard WorkerWe use GitHub issues to track public bugs and feature requests. Ensure that the 40*523fa7a6SAndroid Build Coastguard Workerissue title is clear and descriptive, and that the description has sufficient 41*523fa7a6SAndroid Build Coastguard Workerinstructions to be able to reproduce the issue. 42*523fa7a6SAndroid Build Coastguard Worker 43*523fa7a6SAndroid Build Coastguard WorkerMeta has a [bounty program](https://www.facebook.com/whitehat/) for the safe 44*523fa7a6SAndroid Build Coastguard Workerdisclosure of security bugs. In those cases, please go through the process 45*523fa7a6SAndroid Build Coastguard Workeroutlined on that page and do not file a public issue. 46*523fa7a6SAndroid Build Coastguard Worker 47*523fa7a6SAndroid Build Coastguard Worker### Claiming Issues 48*523fa7a6SAndroid Build Coastguard WorkerWe'd love your help closing out [open 49*523fa7a6SAndroid Build Coastguard Workerissues](https://github.com/pytorch/executorch/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen) 50*523fa7a6SAndroid Build Coastguard Workerin the Github repo. 51*523fa7a6SAndroid Build Coastguard Worker 52*523fa7a6SAndroid Build Coastguard Worker1. Find an issue with the 53*523fa7a6SAndroid Build Coastguard Worker [`actionable`](https://github.com/pytorch/executorch/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen+label%3Aactionable) 54*523fa7a6SAndroid Build Coastguard Worker or [`good first 55*523fa7a6SAndroid Build Coastguard Worker issue`](https://github.com/pytorch/executorch/issues?q=sort%3Aupdated-desc+is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) 56*523fa7a6SAndroid Build Coastguard Worker label that is not currently assigned to anyone. 57*523fa7a6SAndroid Build Coastguard Worker - If you'd like to work on an issue that is assigned but hasn't been updated 58*523fa7a6SAndroid Build Coastguard Worker in a while, discuss a hand-off with the current assignee in the issue 59*523fa7a6SAndroid Build Coastguard Worker comments. 60*523fa7a6SAndroid Build Coastguard Worker - If you'd like to work on an issue that isn't marked `actionable`, please 61*523fa7a6SAndroid Build Coastguard Worker comment on the issue to ask about its status and wait for a response. 62*523fa7a6SAndroid Build Coastguard Worker1. Set yourself as the assignee of the issue. 63*523fa7a6SAndroid Build Coastguard Worker1. If you decide not to finish the issue, update the issue with information to 64*523fa7a6SAndroid Build Coastguard Worker help the next person, then remove yourself from the assignee list. 65*523fa7a6SAndroid Build Coastguard Worker1. When creating pull requests (PRs), mention the issue number like `#1234` in 66*523fa7a6SAndroid Build Coastguard Worker the PR description details (the first comment in the PR conversation thread). 67*523fa7a6SAndroid Build Coastguard Worker1. When the final PR has merged and resolves the issue, close the issue with the 68*523fa7a6SAndroid Build Coastguard Worker button at the bottom of the issue's page. 69*523fa7a6SAndroid Build Coastguard Worker 70*523fa7a6SAndroid Build Coastguard Worker 71*523fa7a6SAndroid Build Coastguard Worker 72*523fa7a6SAndroid Build Coastguard Worker## Coding Style 73*523fa7a6SAndroid Build Coastguard Worker 74*523fa7a6SAndroid Build Coastguard WorkerGoal: Encourage standards that make it easier to read, edit, maintain, and debug 75*523fa7a6SAndroid Build Coastguard Workerthe ExecuTorch code. 76*523fa7a6SAndroid Build Coastguard Worker 77*523fa7a6SAndroid Build Coastguard Worker### lintrunner 78*523fa7a6SAndroid Build Coastguard Worker 79*523fa7a6SAndroid Build Coastguard WorkerWe use [`lintrunner`](https://pypi.org/project/lintrunner/) to help make sure the 80*523fa7a6SAndroid Build Coastguard Workercode follows our standards. Set it up with: 81*523fa7a6SAndroid Build Coastguard Worker 82*523fa7a6SAndroid Build Coastguard Worker``` 83*523fa7a6SAndroid Build Coastguard Workerpip install lintrunner==0.11.0 84*523fa7a6SAndroid Build Coastguard Workerpip install lintrunner-adapters==0.11.0 85*523fa7a6SAndroid Build Coastguard Workerlintrunner init 86*523fa7a6SAndroid Build Coastguard Worker``` 87*523fa7a6SAndroid Build Coastguard Worker 88*523fa7a6SAndroid Build Coastguard WorkerThen run `lintrunner` from the root of the repo to see its suggestions, or run 89*523fa7a6SAndroid Build Coastguard Worker`lintrunner -a` to automatically apply the suggestions. 90*523fa7a6SAndroid Build Coastguard Worker 91*523fa7a6SAndroid Build Coastguard Worker### Python Style 92*523fa7a6SAndroid Build Coastguard Worker 93*523fa7a6SAndroid Build Coastguard WorkerExecuTorch Python code follows the style used by the PyTorch core project. 94*523fa7a6SAndroid Build Coastguard Worker 95*523fa7a6SAndroid Build Coastguard Worker### C++ Style 96*523fa7a6SAndroid Build Coastguard Worker 97*523fa7a6SAndroid Build Coastguard WorkerExecuTorch code uses the [Google C++ 98*523fa7a6SAndroid Build Coastguard WorkerStyle](https://google.github.io/styleguide/cppguide.html), with modifications. 99*523fa7a6SAndroid Build Coastguard Worker 100*523fa7a6SAndroid Build Coastguard WorkerRationale: Google style is close to the C++ style used by PyTorch core, although 101*523fa7a6SAndroid Build Coastguard WorkerPyTorch core does not explicitly document its C++ style. Google style is well 102*523fa7a6SAndroid Build Coastguard Workerdocumented, and has exceptional tooling support. 103*523fa7a6SAndroid Build Coastguard Worker 104*523fa7a6SAndroid Build Coastguard Worker**Modifications** to the Google C++ style, to make it closer to the code in 105*523fa7a6SAndroid Build Coastguard WorkerPyTorch core: 106*523fa7a6SAndroid Build Coastguard Worker- Function and method names should use `lower_snake_case()`. This follows the 107*523fa7a6SAndroid Build Coastguard Worker convention that PyTorch core inherited from its namesake Python, and is the 108*523fa7a6SAndroid Build Coastguard Worker biggest modification to the Google C++ style. 109*523fa7a6SAndroid Build Coastguard Worker- File names should use `lower_snake_case.cpp` (not `.cc`, and not 110*523fa7a6SAndroid Build Coastguard Worker `PascalCase.cpp`). This follows the most common pattern in PyTorch core. 111*523fa7a6SAndroid Build Coastguard Worker- Headers should use `#pragma once` instead of manual include guards. This 112*523fa7a6SAndroid Build Coastguard Worker follows the most common pattern in PyTorch core. 113*523fa7a6SAndroid Build Coastguard Worker- All includes should use `<angle brackets>`, not `"double quotes"`. This 114*523fa7a6SAndroid Build Coastguard Worker ensures that headers are included using the compiler's include path, and not 115*523fa7a6SAndroid Build Coastguard Worker relative to the local file. 116*523fa7a6SAndroid Build Coastguard Worker- Documentation comments should follow Doxygen syntax, either `//** ... */` 117*523fa7a6SAndroid Build Coastguard Worker (multi-line) or `/// ...` (single line), with `@`-style parameters like 118*523fa7a6SAndroid Build Coastguard Worker `@param`, `@retval`. Public APIs must be documented in the `.h` files that 119*523fa7a6SAndroid Build Coastguard Worker declare them. 120*523fa7a6SAndroid Build Coastguard Worker- TODOs should prefer to reference a task or issue number like `TODO(#123): 121*523fa7a6SAndroid Build Coastguard Worker <description>`, rather than a username. A task can manage much-more-nuanced 122*523fa7a6SAndroid Build Coastguard Worker information, and can change ownership as people leave and join the project. 123*523fa7a6SAndroid Build Coastguard Worker 124*523fa7a6SAndroid Build Coastguard WorkerSee the rest of this file for other portability- and efficiency-related 125*523fa7a6SAndroid Build Coastguard Workermodifications to the Google C++ style guide. 126*523fa7a6SAndroid Build Coastguard Worker 127*523fa7a6SAndroid Build Coastguard Worker### C++ Portability Guidelines 128*523fa7a6SAndroid Build Coastguard Worker 129*523fa7a6SAndroid Build Coastguard WorkerSee also [Portable C++ Programming](/docs/source/portable-cpp-programming.md) 130*523fa7a6SAndroid Build Coastguard Workerfor detailed advice. 131*523fa7a6SAndroid Build Coastguard Worker 132*523fa7a6SAndroid Build Coastguard Worker#### C++ language version 133*523fa7a6SAndroid Build Coastguard Worker 134*523fa7a6SAndroid Build Coastguard Worker**C++17.** 135*523fa7a6SAndroid Build Coastguard Worker 136*523fa7a6SAndroid Build Coastguard WorkerRationale: This is a compromise between being compatible with older, proprietary 137*523fa7a6SAndroid Build Coastguard Workertoolchains, and having access to relatively modern C++ features. 138*523fa7a6SAndroid Build Coastguard Worker 139*523fa7a6SAndroid Build Coastguard Worker#### C/C++ standard library usage 140*523fa7a6SAndroid Build Coastguard Worker 141*523fa7a6SAndroid Build Coastguard Worker**Restricted usage of the C++ standard library.** 142*523fa7a6SAndroid Build Coastguard Worker 143*523fa7a6SAndroid Build Coastguard WorkerRationale: ExecuTorch is intended to be portable to bare-metal systems that lack 144*523fa7a6SAndroid Build Coastguard Workercertain features, like dynamic memory, threading, and locking, required by parts 145*523fa7a6SAndroid Build Coastguard Workerof the standard library. It is also intended to be as small as possible, and 146*523fa7a6SAndroid Build Coastguard Workersome convenient stdlib features may grow the binary size unacceptably. 147*523fa7a6SAndroid Build Coastguard Worker 148*523fa7a6SAndroid Build Coastguard WorkerGenerally, do not instantiate types that allocate memory under the hood, like 149*523fa7a6SAndroid Build Coastguard Worker`std::vector` or `std::string`. Do not call `new`, `malloc()` or `mmap()`; do 150*523fa7a6SAndroid Build Coastguard Workernot use iostreams; do not operate on files. 151*523fa7a6SAndroid Build Coastguard Worker 152*523fa7a6SAndroid Build Coastguard WorkerHowever, it is convenient and portable (and sometimes necessary) to use static 153*523fa7a6SAndroid Build Coastguard Workerstandard library concepts like `std::move`, or metaprogramming helpers like 154*523fa7a6SAndroid Build Coastguard Worker`std::is_floating_point<>`. Pure code like `<cmath>` and `<cstring>` is fine, 155*523fa7a6SAndroid Build Coastguard Workeras long as you stay away from functions that allocate memory (like `strdup()`). 156*523fa7a6SAndroid Build Coastguard Worker 157*523fa7a6SAndroid Build Coastguard WorkerIt is also allowed (and sometimes necessary) to use "placement `new`", but be 158*523fa7a6SAndroid Build Coastguard Workercareful to also manually destroy objects initialized in this way. 159*523fa7a6SAndroid Build Coastguard Worker 160*523fa7a6SAndroid Build Coastguard Worker#### C++ language features 161*523fa7a6SAndroid Build Coastguard Worker 162*523fa7a6SAndroid Build Coastguard Worker**Exceptions: Do not use.** 163*523fa7a6SAndroid Build Coastguard Worker- Rationale: Exceptions are not widely supported on some classes of 164*523fa7a6SAndroid Build Coastguard Worker microcontrollers and DSPs, and they can significantly increase binary size. 165*523fa7a6SAndroid Build Coastguard Worker 166*523fa7a6SAndroid Build Coastguard Worker**Threads, thread_local, locking: Do not use, except in optional libraries that 167*523fa7a6SAndroid Build Coastguard Workermust work with threading** 168*523fa7a6SAndroid Build Coastguard Worker- Rationale: The core runtime must work on systems that do not have threading 169*523fa7a6SAndroid Build Coastguard Worker support. 170*523fa7a6SAndroid Build Coastguard Worker 171*523fa7a6SAndroid Build Coastguard Worker**RTTI, dynamic_cast, and `<typeid>`: Do not use.** 172*523fa7a6SAndroid Build Coastguard Worker- Rationale: RTTI adds extra data to every virtual class. ExecuTorch doesn't 173*523fa7a6SAndroid Build Coastguard Worker have a strong need for `dynamic_cast` and friends, so it's better to reduce 174*523fa7a6SAndroid Build Coastguard Worker the binary size. 175*523fa7a6SAndroid Build Coastguard Worker 176*523fa7a6SAndroid Build Coastguard Worker**Templates and template metaprogramming: Be careful and avoid if possible.** 177*523fa7a6SAndroid Build Coastguard Worker- Rationale: Most templating results in code generation, and is one of the most 178*523fa7a6SAndroid Build Coastguard Worker common sources of binary bloat. Some use of templates is fine (e.g. an 179*523fa7a6SAndroid Build Coastguard Worker `ArrayRef<T>`, or code that handles multiple `ScalarType` types), but for the 180*523fa7a6SAndroid Build Coastguard Worker most part avoid them if possible. 181*523fa7a6SAndroid Build Coastguard Worker 182*523fa7a6SAndroid Build Coastguard Worker 183*523fa7a6SAndroid Build Coastguard Worker 184*523fa7a6SAndroid Build Coastguard Worker## Testing 185*523fa7a6SAndroid Build Coastguard Worker 186*523fa7a6SAndroid Build Coastguard Worker### Writing Tests 187*523fa7a6SAndroid Build Coastguard WorkerTo help keep code quality high, ExecuTorch uses a combination of unit tests and 188*523fa7a6SAndroid Build Coastguard Workerend-to-end (e2e) tests. If you add a new feature or fix a bug, please add tests 189*523fa7a6SAndroid Build Coastguard Workerto ensure that the feature/fix works properly and continues to work properly. 190*523fa7a6SAndroid Build Coastguard Worker 191*523fa7a6SAndroid Build Coastguard WorkerMost directories in the repo already contain test files. In many cases, you can 192*523fa7a6SAndroid Build Coastguard Workeradd a test to an existing file, and the existing CI jobs will run it will run 193*523fa7a6SAndroid Build Coastguard Workerautomatically. If you do this, please take a look at the CI job logs to ensure 194*523fa7a6SAndroid Build Coastguard Workerthat it did actually run. 195*523fa7a6SAndroid Build Coastguard Worker 196*523fa7a6SAndroid Build Coastguard WorkerIf it's not clear how to add a test for your PR, take a look at the blame for 197*523fa7a6SAndroid Build Coastguard Workerthe code you're modifying and find an author who has more context. Ask them 198*523fa7a6SAndroid Build Coastguard Workerfor their help in the PR comments. 199*523fa7a6SAndroid Build Coastguard Worker 200*523fa7a6SAndroid Build Coastguard WorkerTODO: Explain how to run tests locally without needing to push and wait for CI. 201*523fa7a6SAndroid Build Coastguard Worker 202*523fa7a6SAndroid Build Coastguard Worker### Continuous Integration 203*523fa7a6SAndroid Build Coastguard WorkerSee https://hud.pytorch.org/hud/pytorch/executorch/main for the current state of 204*523fa7a6SAndroid Build Coastguard Workerthe CI (continuous integration) jobs. If `main` is broken, consider rebasing 205*523fa7a6SAndroid Build Coastguard Workeryour PR onto the `viable/strict` branch, which points to the most recent 206*523fa7a6SAndroid Build Coastguard Workerall-green commit. 207*523fa7a6SAndroid Build Coastguard Worker 208*523fa7a6SAndroid Build Coastguard Worker 209*523fa7a6SAndroid Build Coastguard Worker 210*523fa7a6SAndroid Build Coastguard Worker## Updating Documentation 211*523fa7a6SAndroid Build Coastguard Worker 212*523fa7a6SAndroid Build Coastguard Worker### APIs 213*523fa7a6SAndroid Build Coastguard WorkerExecuTorch documents its APIs using inline code comments: doc strings for 214*523fa7a6SAndroid Build Coastguard WorkerPython, and Doxygen comments for C++. When modifying or adding an API, be sure 215*523fa7a6SAndroid Build Coastguard Workerto modify or add documentation to the interfaces that you change. If the API 216*523fa7a6SAndroid Build Coastguard Workerdoesn't have inline documentation yet, please help improve the code by adding 217*523fa7a6SAndroid Build Coastguard Workerdocumentation and describing the rest of the piece you modified. 218*523fa7a6SAndroid Build Coastguard Worker 219*523fa7a6SAndroid Build Coastguard WorkerAlso search for references to the API you modified under `docs/source` to see if 220*523fa7a6SAndroid Build Coastguard Workerany docs need to be modified to reflect your changes; these are the files that 221*523fa7a6SAndroid Build Coastguard Workerare published on https://pytorch.org/executorch. If you are adding a new API, 222*523fa7a6SAndroid Build Coastguard Workerlook for places in the docs that would benefit from talking about that API, or 223*523fa7a6SAndroid Build Coastguard Workereven create a new document for it. A job on the PR will give you a link to a 224*523fa7a6SAndroid Build Coastguard Workerwebsite preview based on your changes. 225*523fa7a6SAndroid Build Coastguard Worker 226*523fa7a6SAndroid Build Coastguard Worker 227*523fa7a6SAndroid Build Coastguard Worker 228*523fa7a6SAndroid Build Coastguard Worker## Pull Requests 229*523fa7a6SAndroid Build Coastguard WorkerThis repo uses Github pull requests (PRs) to stage and review code before 230*523fa7a6SAndroid Build Coastguard Workermerging it into the `main` branch. See the [Github 231*523fa7a6SAndroid Build Coastguard Workerdocs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) 232*523fa7a6SAndroid Build Coastguard Workerfor basics. 233*523fa7a6SAndroid Build Coastguard Worker 234*523fa7a6SAndroid Build Coastguard Worker1. Push your branch to your fork of `pytorch/executorch`. Most people do not 235*523fa7a6SAndroid Build Coastguard Worker have permission to push a branch directoy to the upstream repo. 236*523fa7a6SAndroid Build Coastguard Worker1. Create your PR 237*523fa7a6SAndroid Build Coastguard Worker - Use the `main` branch as the base. 238*523fa7a6SAndroid Build Coastguard Worker - Give the PR a clear and descriptive title. It will become the title of the 239*523fa7a6SAndroid Build Coastguard Worker merged commit, so it needs to be useful in the output of `git log`. 240*523fa7a6SAndroid Build Coastguard Worker - Bad title: "Fix a bug" 241*523fa7a6SAndroid Build Coastguard Worker - Good title: "Add XYZ method to ABC" 242*523fa7a6SAndroid Build Coastguard Worker - Give the PR a clear and thorough description. Don't just describe what the PR 243*523fa7a6SAndroid Build Coastguard Worker does: the diff will do that. Explain *why* you are making this change, in a 244*523fa7a6SAndroid Build Coastguard Worker way that will make sense to someone years from now. 245*523fa7a6SAndroid Build Coastguard Worker - Explain how you have tested your changes by including repeatable instructions for 246*523fa7a6SAndroid Build Coastguard Worker testing the PR. 247*523fa7a6SAndroid Build Coastguard Worker - If you added tests, this can be as simple as the command you used to run the 248*523fa7a6SAndroid Build Coastguard Worker tests. 249*523fa7a6SAndroid Build Coastguard Worker - If you tested the PR manually, include the steps and the outputs. Help a 250*523fa7a6SAndroid Build Coastguard Worker future editor understand how to test the code that you're modifying 251*523fa7a6SAndroid Build Coastguard Worker today. 252*523fa7a6SAndroid Build Coastguard Worker - If your PR contains or is representative of a feature/bug fix that should be 253*523fa7a6SAndroid Build Coastguard Worker called out in the release notes, please add a label for "Release notes: \<area\>", 254*523fa7a6SAndroid Build Coastguard Worker where \<area\> describes which part of ExecuTorch the change pertains to, e.g. 255*523fa7a6SAndroid Build Coastguard Worker "Release notes: runtime". Here are all of the categories: 256*523fa7a6SAndroid Build Coastguard Worker - `Release notes: runtime`: changes related to the core runtime which loads the program methods, initializes delegates, and runs the lowered graph. 257*523fa7a6SAndroid Build Coastguard Worker - `Release notes: exir`: changes to any internal representations, such as any edge-related dialects. Also any changes to passes that may modify the exir, such as memory planning. 258*523fa7a6SAndroid Build Coastguard Worker - `Release notes: quantization`: changes to quantization. 259*523fa7a6SAndroid Build Coastguard Worker - `Release notes: ops & kernels`: changes to the opset and any new / changed kernel implementations. 260*523fa7a6SAndroid Build Coastguard Worker - `Release notes: api`: changes to public facing apis (any interfaces, pybinded runtime methods, etc.). 261*523fa7a6SAndroid Build Coastguard Worker - `Release notes: backends`: changes to any of the backend delegates. 262*523fa7a6SAndroid Build Coastguard Worker - `Release notes: build`: changes related to the build system, including major dependency upgrades, notable build flags, optimizations, etc. 263*523fa7a6SAndroid Build Coastguard Worker - `Release notes: devtools`: changes to any of ExecuTorch's developer tools, for example the debugger & profiler. 264*523fa7a6SAndroid Build Coastguard Worker - `Release notes: examples`: changes to any code under `examples/`. 265*523fa7a6SAndroid Build Coastguard Worker - `Release notes: misc`: anything notable that doesn't belong in the above categories. 266*523fa7a6SAndroid Build Coastguard Worker - See https://github.com/pytorch/executorch/pull/3612 for an example PR that 267*523fa7a6SAndroid Build Coastguard Worker follows this advice. 268*523fa7a6SAndroid Build Coastguard Worker1. Before asking for a review, ensure that all [CI (continuous integration) 269*523fa7a6SAndroid Build Coastguard Worker jobs](#continuous-integration) on your pull request succeed. 270*523fa7a6SAndroid Build Coastguard Worker - If the jobs on your PR are broken but you're not sure why, add a comment 271*523fa7a6SAndroid Build Coastguard Worker and proceed to finding a reviewer. 272*523fa7a6SAndroid Build Coastguard Worker - Not all users can trigger the CI jobs. If the jobs don't run on your PR, 273*523fa7a6SAndroid Build Coastguard Worker proceed to finding a reviewer. 274*523fa7a6SAndroid Build Coastguard Worker1. Find reviewers 275*523fa7a6SAndroid Build Coastguard Worker - If you have been working with a member of the ExecuTorch repo, add them 276*523fa7a6SAndroid Build Coastguard Worker as a reviewer (*not* an "assignee"). 277*523fa7a6SAndroid Build Coastguard Worker - If not, look at the blame for the files that the PR modifies, and try 278*523fa7a6SAndroid Build Coastguard Worker picking one or two ExecuTorch repo members as reviewers (*not* 279*523fa7a6SAndroid Build Coastguard Worker "assignees"). 280*523fa7a6SAndroid Build Coastguard Worker - If you are unsure, leave a comment on the PR and keep it unassigned with no 281*523fa7a6SAndroid Build Coastguard Worker reviewers. A member of the ExecuTorch repo will find someone to review it. 282*523fa7a6SAndroid Build Coastguard Worker1. Address and discuss comments left by reviewers 283*523fa7a6SAndroid Build Coastguard Worker - If the reviewers have requests or questions, follow up with them. 284*523fa7a6SAndroid Build Coastguard Worker - The goal of the reviewer is to ensure that the code in the `main` branch of 285*523fa7a6SAndroid Build Coastguard Worker the repo is consistent, maintainable, and of high quality. 286*523fa7a6SAndroid Build Coastguard Worker1. Once the PR has been approved, 287*523fa7a6SAndroid Build Coastguard Worker - If you have the "write permission" in this repo, you can merge it yourself 288*523fa7a6SAndroid Build Coastguard Worker by clicking the "Squash and merge" button once it is green and all CI 289*523fa7a6SAndroid Build Coastguard Worker signals are passing. 290*523fa7a6SAndroid Build Coastguard Worker - If you don't have "write permission" in this repo, the reviewer will take 291*523fa7a6SAndroid Build Coastguard Worker care of the PR. The reviewer may import the PR into Meta's internal system 292*523fa7a6SAndroid Build Coastguard Worker to validate it against internal CI. 293*523fa7a6SAndroid Build Coastguard Worker - If the PR is approved but not merged within 5 business days, please comment 294*523fa7a6SAndroid Build Coastguard Worker on the PR to ask about its status. 295*523fa7a6SAndroid Build Coastguard Worker - Note that if the `main` [CI](#continuous-integration) jobs are broken, we 296*523fa7a6SAndroid Build Coastguard Worker will only merge PRs that fix the broken jobs until all critical jobs are 297*523fa7a6SAndroid Build Coastguard Worker fixed. 298*523fa7a6SAndroid Build Coastguard Worker 299*523fa7a6SAndroid Build Coastguard Worker 300*523fa7a6SAndroid Build Coastguard Worker 301*523fa7a6SAndroid Build Coastguard Worker## For Backend Delegate Authors 302*523fa7a6SAndroid Build Coastguard Worker 303*523fa7a6SAndroid Build Coastguard Worker- Use [this](/docs/source/backend-delegates-integration.md) guide when 304*523fa7a6SAndroid Build Coastguard Worker integrating your delegate with ExecuTorch. 305*523fa7a6SAndroid Build Coastguard Worker- Refer to [this](/docs/source/backend-delegates-dependencies.md) set of 306*523fa7a6SAndroid Build Coastguard Worker guidelines when including a third-party depenency for your delegate. 307*523fa7a6SAndroid Build Coastguard Worker 308*523fa7a6SAndroid Build Coastguard Worker 309*523fa7a6SAndroid Build Coastguard Worker 310*523fa7a6SAndroid Build Coastguard Worker## License 311*523fa7a6SAndroid Build Coastguard WorkerBy contributing to ExecuTorch, you agree that your contributions will be 312*523fa7a6SAndroid Build Coastguard Workerlicensed under the LICENSE file in the root directory of this source tree. 313*523fa7a6SAndroid Build Coastguard Worker 314*523fa7a6SAndroid Build Coastguard Worker 315*523fa7a6SAndroid Build Coastguard Worker 316*523fa7a6SAndroid Build Coastguard Worker## Contributor License Agreement ("CLA") 317*523fa7a6SAndroid Build Coastguard WorkerIn order to accept your pull request, we need you to submit a CLA. You only need 318*523fa7a6SAndroid Build Coastguard Workerto do this once to work on any of Meta's open source projects. 319*523fa7a6SAndroid Build Coastguard Worker 320*523fa7a6SAndroid Build Coastguard WorkerComplete your CLA here: <https://code.facebook.com/cla> 321*523fa7a6SAndroid Build Coastguard Worker 322*523fa7a6SAndroid Build Coastguard Worker 323