Skip to content

Commit

Permalink
Add docs for Encoding, IREECodegen, and IREEGPU dialects. (#17743)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottTodd authored Jun 26, 2024
1 parent ebc9f0f commit c62fc9d
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library", "iree_gentbl_cc_library", "iree_td_library")
load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library", "iree_gentbl_cc_library", "iree_tablegen_doc", "iree_td_library")
load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")

package(
Expand Down Expand Up @@ -199,3 +199,19 @@ iree_gentbl_cc_library(
"//compiler/src/iree/compiler/Codegen/Interfaces:td_files",
],
)

iree_tablegen_doc(
name = "IREECodegenDialectDocGen",
tbl_outs = [
(
[
"--gen-dialect-doc",
"--dialect=iree_codegen",
],
"IREECodegenDialect.md",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "IREECodegenOps.td",
deps = [":td_files"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,13 @@ iree_tablegen_library(
--gen-op-defs UKernelOps.cpp.inc
)

iree_tablegen_doc(
NAME
IREECodegenDialectDocGen
TD_FILE
"IREECodegenOps.td"
OUTS
--gen-dialect-doc --dialect=iree_codegen IREECodegenDialect.md
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def IREECodegen_Dialect : Dialect {
let cppNamespace = "::mlir::iree_compiler::IREE::Codegen";

let summary = [{
A dialect representing attributes used by the IREE Code generation.
A dialect for common functionality used by IREE code generation.
}];
let description = [{
This dialect is primarily meant to hold attributes that carry the
Expand Down
18 changes: 17 additions & 1 deletion compiler/src/iree/compiler/Codegen/Dialect/GPU/IR/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library", "iree_gentbl_cc_library", "iree_td_library")
load("//build_tools/bazel:build_defs.oss.bzl", "iree_compiler_cc_library", "iree_gentbl_cc_library", "iree_tablegen_doc", "iree_td_library")
load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")

package(
Expand Down Expand Up @@ -187,3 +187,19 @@ iree_gentbl_cc_library(
":td_files",
],
)

iree_tablegen_doc(
name = "IREEGPUDialectDocGen",
tbl_outs = [
(
[
"--gen-dialect-doc",
"--dialect=iree_gpu",
],
"IREEGPUDialect.md",
),
],
tblgen = "@llvm-project//mlir:mlir-tblgen",
td_file = "IREEGPUOps.td",
deps = [":td_files"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,13 @@ iree_tablegen_library(
--gen-op-defs IREEGPUOps.cpp.inc
)

iree_tablegen_doc(
NAME
IREEGPUDialectDocGen
TD_FILE
"IREEGPUOps.td"
OUTS
--gen-dialect-doc --dialect=iree_gpu IREEGPUDialect.md
)

### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def IREEGPU_Dialect : Dialect {
let cppNamespace = "::mlir::iree_compiler::IREE::GPU";

let summary = [{
A dialect representing attributes used by GPU focused IREE code generation.
A dialect for common functionality used by GPU focused IREE code generation.
}];
let description = [{
This dialect provides operations and attributes to aid in code generation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def IREEGPU_MultiMmaOp : Op<IREEGPU_Dialect, "multi_mma", [
: tensor<?x?x16x16xf16>, tensor<?x?x16x16xf16> into tensor<?x?x16x16xf32>
```

## Motivation, Design Choices, and Pitfalls
#### Motivation, Design Choices, and Pitfalls

The idea behind this operation is to decouple the layout setting/tiling
required to target certain intrinsics from the lowering to them. Because
Expand Down
3 changes: 3 additions & 0 deletions docs/website/docs/reference/mlir-dialects/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ these dialects can be found in the
Dialect | Description
--------------------------- | -----------
[Check](./Check.md) | Defines assertions for IREE tests
[Encoding](./Encoding.md) | Tensor encoding attributes and related ops
[Flow](./Flow.md) | Models execution data flow and partitioning
[HAL](./HAL.md) | Represents operations against the IREE HAL[^1]
[HAL/Inline](./HALInline.md) | Inline HAL interop runtime module dialect
[HAL/Loader](./HALLoader.md) | HAL inline executable loader runtime module dialect
[IO/Parameters](./IOParameters.md) | External parameter resource management APIs
[IREECodegen](./IREECodegen.md) | Common functionality used by IREE code generation
[IREEGPU](./IREEGPU.md) | Common functionality used by GPU focused IREE code generation
[LinalgExt](./LinalgExt.md) | Extensions to the Linalg dialect for specific operations
[Stream](./Stream.md) | Model execution partitioning and scheduling
[Util](./Util.md) | Types and ops common across IREE subdialects
Expand Down
3 changes: 3 additions & 0 deletions docs/website/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,14 @@ nav:
# Note: these files are generated by generate_extra_files.sh.
- "Internal dialects":
- Check: "reference/mlir-dialects/Check.md"
- Encoding: "reference/mlir-dialects/Encoding.md"
- Flow: "reference/mlir-dialects/Flow.md"
- HAL: "reference/mlir-dialects/HAL.md"
- HAL/Inline: "reference/mlir-dialects/HALInline.md"
- HAL/Loader: "reference/mlir-dialects/HALLoader.md"
- IO/Parameters: "reference/mlir-dialects/IOParameters.md"
- IREECodegen: "reference/mlir-dialects/IREECodegen.md"
- IREEGPU: "reference/mlir-dialects/IREEGPU.md"
- LinalgExt: "reference/mlir-dialects/LinalgExt.md"
- Stream: "reference/mlir-dialects/Stream.md"
- Util: "reference/mlir-dialects/Util.md"
Expand Down
3 changes: 3 additions & 0 deletions docs/website/postprocess_dialect_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,13 @@ def main(args):
dialect_sources_map = {
"Check.md": "compiler/src/iree/compiler/Modules/Check/IR",
"Flow.md": "compiler/src/iree/compiler/Dialect/Flow/IR",
"Encoding.md": "compiler/src/iree/compiler/Dialect/Encoding/IR",
"HAL.md": "compiler/src/iree/compiler/Dialect/HAL/IR",
"HALInline.md": "compiler/src/iree/compiler/Modules/HAL/Inline/IR",
"HALLoader.md": "compiler/src/iree/compiler/Modules/HAL/Loader/IR",
"IOParameters.md": "compiler/src/iree/compiler/Modules/IO/Parameters/IR",
"IREECodegen.md": "compiler/src/iree/compiler/Codegen/Dialect/Codegen/IR",
"IREEGPU.md": "compiler/src/iree/compiler/Codegen/Dialect/GPU/IR",
"IREEInput.md": "llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/Input",
"IREEVectorExt.md": "llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/VectorExt/IR",
"LinalgExt.md": "compiler/src/iree/compiler/Dialect/LinalgExt/IR",
Expand Down

0 comments on commit c62fc9d

Please sign in to comment.