Skip to content

Commit

Permalink
Merge branch 'main' into decompose-constantofshape
Browse files Browse the repository at this point in the history
  • Loading branch information
tungld authored Sep 14, 2023
2 parents d2233e0 + ef90965 commit b57dd68
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/BuildOnLinuxOSX.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Firstly, install MLIR (as a part of LLVM-Project):
``` bash
git clone -n https://github.com/llvm/llvm-project.git
# Check out a specific branch that is known to work with ONNX-MLIR.
cd llvm-project && git checkout 91088978d712cd7b33610c59f69d87d5a39e3113 && cd ..
cd llvm-project && git checkout 6098d7d5f6533edb1b873107ddc1acde23b9235b && cd ..
```

[same-as-file]: <> (utils/build-mlir.sh)
Expand Down
2 changes: 1 addition & 1 deletion docs/BuildOnWindows.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Install MLIR (as a part of LLVM-Project):
```shell
git clone -n https://github.com/llvm/llvm-project.git
# Check out a specific branch that is known to work with ONNX-MLIR.
cd llvm-project && git checkout 91088978d712cd7b33610c59f69d87d5a39e3113 && cd ..
cd llvm-project && git checkout 6098d7d5f6533edb1b873107ddc1acde23b9235b && cd ..
```

[same-as-file]: <> (utils/build-mlir.cmd)
Expand Down
2 changes: 1 addition & 1 deletion docs/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The all_test_names.txt is automatically generated with command "make check-onnx-

### Adding ONNX-supported test cases to the current set of backend tests

When the ONNX-to-Krnl conversion of an operator is added, the corresponding backend tests for this operator should be added to test.py. The available test cases can be found in `third_part/onnx/onnx/backend/test/case/node`. You can identify new tests by looking for the new operator in `test/backend/all_test_names.txt`. Once you have located new tests, you may add the new tests in the `test/backend/inference_backend.py.` Please note to add suffix `_cpu` to the onnx test name. Associated with the test, you can define how to run the tests for the new operator. For example:
When the ONNX-to-Krnl conversion of an operator is added, the corresponding backend tests for this operator should be added to test.py. The available test cases can be found in `third_party/onnx/onnx/backend/test/case/node`. You can identify new tests by looking for the new operator in `test/backend/all_test_names.txt`. Once you have located new tests, you may add the new tests in the `test/backend/inference_backend.py.` Please note to add suffix `_cpu` to the onnx test name. Associated with the test, you can define how to run the tests for the new operator. For example:
```
"test_and2d_cpu": {STATIC_SHAPE:{}, DYNAMIC_SHAPE:{-1:{-1}}, CONSTANT_INPUT:{-1}},
```
Expand Down
4 changes: 2 additions & 2 deletions docs/UpdatingLLVMCommit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Updating the LLVM commit or MLIR-HLO submodule

ONNX-MLIR depends on `llvm-project` (among various other projects such as `mlir-hlo`). The `llvm-project` dependency is captured in [utils/clone-mlir.sh](clone-mlir.sh). `mlir-hlo` is a submodule found in the `third_party` directory.
ONNX-MLIR depends on `llvm-project` (among various other projects such as `mlir-hlo`). The `llvm-project` dependency is captured in [../utils/clone-mlir.sh](clone-mlir.sh). `mlir-hlo` is a submodule found in the `third_party` directory.

We plan to update `llvm-project` a couple of times a month in order to keep up-to-date with the advancements made in `mlir`, but also to decrease the complexity of each update. There is currently no plan to update `mlir-hlo` on any given schedule, though for a specific LLVM update it may be necessary to also update the `mlir-hlo` submodule for the build to continue working correctly. This is because `mlir-hlo` itself also has a dependency on `mlir`.

Expand All @@ -17,7 +17,7 @@ We've started an update rotation that is described [here](https://github.com/onn
## What is the update process?

1. **Lookup green commit hashes**: From the Github issue https://github.com/llvm/torch-mlir/issues/1178, find the LLVM and MLIR-HLO green commits for the week when ONNX-MLIR is being updated.
2. **Update the `llvm-project` commit**: Update the LLVM commit referenced in the source tree to the green commit hash for the LLVM project from Step 1. The current locations that need to be updated are [utils/clone-mlir.sh](clone-mlir.sh), [docs/BuildOnLinuxOSX.md](BuildOnLinuxOSX.md) and [docs/BuildOnWindows.md](BuildOnWindows.md).
2. **Update the `llvm-project` commit**: Update the LLVM commit referenced in the source tree to the green commit hash for the LLVM project from Step 1. The current locations that need to be updated are [utils/clone-mlir.sh](../utils/clone-mlir.sh), [docs/BuildOnLinuxOSX.md](BuildOnLinuxOSX.md) and [docs/BuildOnWindows.md](BuildOnWindows.md).
3. **Update the `mlir-hlo` submodule**: In the `third-party/mlir-hlo` directory, run `git fetch` followed by `git checkout <mlir-hlo-commit-hash>` (where `<mlir-hlo-commit-hash>` is the green commit hash for the MLIR-HLO project from Step 1).
4. **Rebuild and test ONNX-MLIR**: This might involve fixing various API breakages introduced upstream (they are likely unrelated to what you are working on). If these fixes are too complex, please file a work-in-progress PR explaining the issues you are running into asking for help so that someone from the community can help.

Expand Down
1 change: 1 addition & 0 deletions src/Accelerators/NNPA/Dialect/ZHigh/ZHigh.td
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def ZHigh_Dialect : Dialect {
let summary = "A high-level dialect for the ONNX NNPA accelerator ISA.";
let cppNamespace = "::onnx_mlir::zhigh";
let useDefaultAttributePrinterParser = 1;
let usePropertiesForAttributes = 0;
}

//===----------------------------------------------------------------------===//
Expand Down
1 change: 1 addition & 0 deletions src/Accelerators/NNPA/Dialect/ZLow/ZLow.td
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def ZLow_Dialect : Dialect {
let name = "zlow";
let summary = "A low-level dialect for the ONNX NNPA accelerator ISA.";
let cppNamespace = "::onnx_mlir::zlow";
let usePropertiesForAttributes = 0;
}

// Base class for ZLow dialect operations. This operation inherits from the
Expand Down
1 change: 1 addition & 0 deletions src/Dialect/Krnl/Krnl.td
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ include "src/Interface/SpecializedKernelOpInterface.td"
def Krnl_Dialect : Dialect {
let name = "krnl";
let cppNamespace = "::mlir";
let usePropertiesForAttributes = 0;
let useDefaultTypePrinterParser = 1;
let dependentDialects = [
"affine::AffineDialect",
Expand Down
1 change: 1 addition & 0 deletions src/Dialect/ONNX/ONNX.td
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def ONNX_Dialect : Dialect {
let cppNamespace = "::mlir";
let useDefaultTypePrinterParser = 1;
let useDefaultAttributePrinterParser = 0;
let usePropertiesForAttributes = 0;
let dependentDialects = ["func::FuncDialect"];
let hasConstantMaterializer = 1;
let extraClassDeclaration = [{
Expand Down
2 changes: 1 addition & 1 deletion third_party/mlir-hlo
Submodule mlir-hlo updated 3953 files
2 changes: 1 addition & 1 deletion utils/clone-mlir.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
git clone -n https://github.com/llvm/llvm-project.git
# Check out a specific branch that is known to work with ONNX-MLIR.
cd llvm-project && git checkout 91088978d712cd7b33610c59f69d87d5a39e3113 && cd ..
cd llvm-project && git checkout 6098d7d5f6533edb1b873107ddc1acde23b9235b && cd ..

0 comments on commit b57dd68

Please sign in to comment.