-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate StableHLO at openxla/stablehlo@b27ef13c
PiperOrigin-RevId: 618971032
- Loading branch information
Showing
29 changed files
with
486 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": 6, | ||
"configurePresets": [ | ||
{ | ||
"name": "debug", | ||
"displayName": "Debug w/ ccache", | ||
"generator": "Ninja", | ||
"binaryDir": "build/", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug", | ||
"LLVM_ENABLE_ASSERTIONS": "ON", | ||
"LLVM_ENABLE_LLD": "ON", | ||
"STABLEHLO_ENABLE_BINDINGS_PYTHON" : "OFF", | ||
"STABLEHLO_ENABLE_SPLIT_DWARF": "ON", | ||
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache", | ||
"CMAKE_CXX_COMPILER": "clang++", | ||
"CMAKE_C_COMPILER_LAUNCHER": "ccache", | ||
"CMAKE_C_COMPILER": "clang", | ||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON", | ||
"MLIR_DIR": "${sourceDir}/llvm-build/lib/cmake/mlir" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# IDE setup | ||
|
||
You can find on this page some _opinionated_ IDE setup instructions. | ||
Of course the best IDE is the one that _works for you_. | ||
|
||
> If you have an improvement or recommendation to any of the setups, we welcome contributions. | ||
## Visual Studio Code (vscode) | ||
|
||
### CMake | ||
|
||
Visual Studio Code (vscode) can work pretty well with the CMake build system. | ||
|
||
The following extensions are recommended: | ||
|
||
* [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) | ||
* [clangd](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) | ||
|
||
> Note: Installing the `clangd` extension will inform you that you | ||
will need to disable the default _intellisense_ extension. | ||
This is fine, as `clangd` will provide the same functionality. | ||
|
||
We include a [CmakePresets.json](../CMakePresets.json) file in the root of the repository. | ||
This file is used by the `CMake Tools` extension to provide a list of _presets_ that | ||
can be used to configure the build. The `CMake Tools` extension will automatically | ||
detect this file and provide the presets. | ||
|
||
Additionally, all the configured presets generate the `compile_commands.json` file | ||
in the build directory which will then be picked up by `clangd`. | ||
|
||
We recommend additionally setting the following in your `.vscode/settings.json` file: | ||
|
||
```json | ||
{ | ||
"files.exclude": { | ||
"**/bazel-*": true | ||
} | ||
} | ||
``` | ||
|
||
## Vim | ||
|
||
### LLVM/MLIR settings | ||
|
||
Check out the official instructions for [LLVM](https://github.com/llvm/llvm-project/blob/main/llvm/utils/vim/README) | ||
and [MLIR](https://github.com/llvm/llvm-project/blob/main/mlir/utils/vim/README) | ||
settings to enable syntax highlighting and other goodies. | ||
|
||
### IDE-like features | ||
|
||
Check out the official [documentation for | ||
`clangd`](https://releases.llvm.org/9.0.1/tools/clang/tools/extra/docs/clangd/Installation.html) | ||
to enable features like autocompletion, go to definition, etc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# [RFC] StableHLO Extensibility | ||
|
||
Status: Approved<br/> | ||
Initial version: 6/9/2023<br/> | ||
Last updated: 3/8/2024<br/> | ||
Discussion thread: [openxla-discuss](https://groups.google.com/a/openxla.org/g/openxla-discuss/c/Ao5K8fvXoEk/m/OaddRrgyAgAJ). | ||
|
||
## Summary | ||
|
||
For full details and RFC discussion, see: | ||
[[RFC] StableHLO Extensibility](https://docs.google.com/document/d/1bSyyLA-p1F7KjZgjo563F1WFsPwcZc4eaH5WyQfbsi0/edit#heading=h.kfv34azf3j5k). | ||
|
||
In its role as a portability layer between ML frameworks and ML compilers, | ||
StableHLO provides a common vocabulary of well-understood ops along with | ||
compatibility guarantees for them. However, this all works only for a closed set | ||
of ops within the StableHLO dialect. In this document, we propose to offer a | ||
mechanism to create portable abstractions of StableHLO ops. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.