-
Notifications
You must be signed in to change notification settings - Fork 24
Devdocs #1684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
DEVDOCS.md
Outdated
|
|
||
| ## Overview | ||
|
|
||
| Enzyme-JAX is a C++ project that integrates the Enzyme automatic differentiation tool with JAX, enabling automatic differentiation of external C++ code within JAX. The project uses LLVM's MLIR framework for intermediate representation and transformation of code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at this point its grown a bit more than just enzyme. It also contains polygeist's high performance raising, parallelization, and cross compilation workflow; as well as a bunch of tensor/linear algebra/communication optiumizations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Enzyme-JAX is a C++ project that integrates the Enzyme automatic differentiation tool with JAX, enabling automatic differentiation of external C++ code within JAX. The project uses LLVM's MLIR framework for intermediate representation and transformation of code. | |
| Enzyme-JAX is a C++ project whose original aim was to integrate the Enzyme automatic differentiation tool [1] with JAX, enabling automatic differentiation of external C++ code within JAX. It has since expanded to incorporate Polygeist's [2] high performance raising, parallelization, cross compilation workflow, as well as numerous tensor, linear algerba, and communication optimizations. The project uses LLVM's MLIR framework for intermediate representation and transformation of code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Maybe this should better be moved to the main README?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's reasonable.
| #### 2. **Passes** (`src/enzyme_ad/jax/Passes/`) | ||
| MLIR passes implement transformations and optimizations. | ||
|
|
||
| - Tablegen definitions in `src/enzyme_ad/jax/Passes/Passes.td` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a bit more detail here?
for example enzymehloopt.cpp contains (nearly) all the stablehlo/linear algebra level transformations
we can also make a subsection for the (polygeist) raising passes?
|
|
||
| ## Testing | ||
|
|
||
| Run tests with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe also add a link to what a lit test is (e.g. syntax is command at top, file below, with checks, link to full spec), where tests go/etc?
DEVDOCS.md
Outdated
|
|
||
| ### Quick Build | ||
| ```bash | ||
| bazel build --repo_env=CC=clang-18 --color=yes --copt=-fbracket-depth=1024 --host_copt=-fbracket-depth=1024 -c dbg :enzymexlamlir-opt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in princpile the bracket depth shouldnt be required here [and is added via the .bazelrc]
| ``` | ||
| enzymexlamlir-opt --enzyme-hlo-generate-td="patterns=and_pad_pad" --transform-interpreter --enzyme-hlo-remove-transform -allow-unregistered-dialect input.mlir | ||
| ``` | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe also a fourth section for derivative rules ? [cc @avik-pal ]
DEVDOCS.md
Outdated
|
|
||
| ## Overview | ||
|
|
||
| Enzyme-JAX is a C++ project that integrates the Enzyme automatic differentiation tool with JAX, enabling automatic differentiation of external C++ code within JAX. The project uses LLVM's MLIR framework for intermediate representation and transformation of code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Enzyme-JAX is a C++ project that integrates the Enzyme automatic differentiation tool with JAX, enabling automatic differentiation of external C++ code within JAX. The project uses LLVM's MLIR framework for intermediate representation and transformation of code. | |
| Enzyme-JAX is a C++ project whose original aim was to integrate the Enzyme automatic differentiation tool [1] with JAX, enabling automatic differentiation of external C++ code within JAX. It has since expanded to incorporate Polygeist's [2] high performance raising, parallelization, cross compilation workflow, as well as numerous tensor, linear algerba, and communication optimizations. The project uses LLVM's MLIR framework for intermediate representation and transformation of code. |
| 2. Inherit from `mlir::OpRewritePattern<OpType>` | ||
| 3. Implement `matchAndRewrite()` method | ||
| 4. Register in `EnzymeHLOOptPass::runOnOperation()` | ||
| 5. Register as Transform operation in `TransformOps.td` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also say to add to primitives.py which I often forget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Feel free to just push, otherwise I can do it later. I didn't even know about primitives.py 🙈
I wrote some development information in a single file. Please chime in and correct/add more information. This probably also needs to be refactored to a proper wiki layout before merging.