Skip to content

Commit 8a199e2

Browse files
mlxddime10
andauthored
Add dialect docs infra and static generated outputs (#1959)
**Context:** To ensure we can have accessible MLIR dialect and pass docs, we require adding the generated output of the `mlir-doc` target to the site documentation. As this requires a full clone of catalyst and all submodules, we add the files statically based on the latest generated output. **Description of the Change:** Add dialect and pass docs to the sphinx site as static additions. Add infra changes to allow easy generation of the dialect and pass documentation. **Benefits:** Ensures the above are easily accessible. **Possible Drawbacks:** Static generated files may grow stale, and will require periodic updates. **Related GitHub Issues:** --------- Co-authored-by: David Ittah <[email protected]>
1 parent 308ea06 commit 8a199e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3663
-6
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ enzyme:
134134

135135
dialects:
136136
$(MAKE) -C mlir dialects
137+
138+
.PHONY: dialect-docs
139+
dialect-docs:
140+
$(MAKE) -C mlir dialect-docs
137141

138142
runtime:
139143
$(MAKE) -C runtime runtime ENABLE_OQD=$(ENABLE_OQD)
@@ -222,6 +226,7 @@ wheel:
222226
cp $(COPY_FLAGS) $(DIALECTS_BUILD_DIR)/bin/catalyst $(MK_DIR)/frontend/bin/
223227
find $(MK_DIR)/frontend -type d -name __pycache__ -exec rm -rf {} +
224228

229+
225230
# Copy selected headers to `frontend/include' to include them in the wheel
226231
mkdir -p $(MK_DIR)/frontend/catalyst/include
227232
find $(DIALECTS_SRC_DIR)/include/Quantum $(DIALECTS_BUILD_DIR)/include/Quantum \

doc/_static/mlir-catalyst-ops.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* Custom CSS to override header fonts for MLIR Catalyst documentation */
2+
3+
/* restyle the Op and Attribute headers since they appear too large*/
4+
h1 {
5+
font-size: x-large;
6+
}
7+
8+
h2 {
9+
font-size: large;
10+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* Custom CSS to override header fonts for MLIR Catalyst documentation */
2+
3+
/* restyle the #### Options header since it appears too large*/
4+
h2 {
5+
font-size: large;
6+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!-- Autogenerated by mlir-tblgen; don't manually edit -->
2+
3+
# 'catalyst' Dialect
4+
5+
_A dialect supporting core Catalyst functionality._
6+
7+
The catalyst dialect serves as a standard library for the Catalyst compiler. It
8+
contains data structures that support core compiler functionality.
9+
10+
## Types
11+
12+
### ArrayListType
13+
14+
_A dynamically resizable array_
15+
16+
Syntax:
17+
18+
```
19+
!catalyst.arraylist<
20+
Type # elementType
21+
>
22+
```
23+
24+
#### Parameters:
25+
26+
| Parameter | C++ type | Description |
27+
| :-------: | :-------: | ----------- |
28+
| elementType | `Type` | |
Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
<link rel="stylesheet" href="https://mlir.llvm.org/css/theme.min.css">
2+
<link rel="stylesheet" href="https://mlir.llvm.org/css/chroma.min.css">
3+
<link rel="stylesheet" href="../../../_static/mlir-catalyst-ops.css">
4+
5+
<!-- Autogenerated by mlir-tblgen; don't manually edit -->
6+
7+
### `catalyst.assert` (::catalyst::AssertionOp)
8+
9+
_Asserts condition at runtime._
10+
11+
#### Attributes:
12+
13+
<table>
14+
<tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr>
15+
<tr><td><code>error</code></td><td>::mlir::StringAttr</td><td>string attribute</td></tr>
16+
</table>
17+
18+
#### Operands:
19+
20+
| Operand | Description |
21+
| :-----: | ----------- |
22+
| `assertion` | 1-bit signless integer |
23+
24+
25+
### `catalyst.callback_call` (::catalyst::CallbackCallOp)
26+
27+
Syntax:
28+
29+
```
30+
operation ::= `catalyst.callback_call` $callee `(` $inputs `)` attr-dict `:` functional-type($inputs, results)
31+
```
32+
33+
Interfaces: `CallOpInterface`, `MemoryEffectOpInterface`, `SymbolUserOpInterface`
34+
35+
#### Attributes:
36+
37+
<table>
38+
<tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr>
39+
<tr><td><code>callee</code></td><td>::mlir::FlatSymbolRefAttr</td><td>flat symbol reference attribute</td></tr>
40+
<tr><td><code>arg_attrs</code></td><td>::mlir::ArrayAttr</td><td>Array of dictionary attributes</td></tr>
41+
<tr><td><code>res_attrs</code></td><td>::mlir::ArrayAttr</td><td>Array of dictionary attributes</td></tr>
42+
</table>
43+
44+
#### Operands:
45+
46+
| Operand | Description |
47+
| :-----: | ----------- |
48+
| `inputs` | variadic of ranked tensor of any type values or memref of any type values |
49+
50+
#### Results:
51+
52+
| Result | Description |
53+
| :----: | ----------- |
54+
| &laquo;unnamed&raquo; | variadic of any type |
55+
56+
57+
### `catalyst.callback` (::catalyst::CallbackOp)
58+
59+
_Operation denoting a symbol to refer to user callbacks._
60+
61+
This is an operation that is intended to be placed at the module level.
62+
It corresponds to function bodies that are not yet constructed.
63+
64+
Traits: `IsolatedFromAbove`
65+
66+
Interfaces: `CallableOpInterface`, `FunctionOpInterface`, `Symbol`
67+
68+
#### Attributes:
69+
70+
<table>
71+
<tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr>
72+
<tr><td><code>sym_name</code></td><td>::mlir::StringAttr</td><td>string attribute</td></tr>
73+
<tr><td><code>function_type</code></td><td>::mlir::TypeAttr</td><td>type attribute of function type</td></tr>
74+
<tr><td><code>id</code></td><td>::mlir::IntegerAttr</td><td>64-bit signless integer attribute</td></tr>
75+
<tr><td><code>argc</code></td><td>::mlir::IntegerAttr</td><td>64-bit signless integer attribute</td></tr>
76+
<tr><td><code>resc</code></td><td>::mlir::IntegerAttr</td><td>64-bit signless integer attribute</td></tr>
77+
<tr><td><code>arg_attrs</code></td><td>::mlir::ArrayAttr</td><td>Array of dictionary attributes</td></tr>
78+
<tr><td><code>res_attrs</code></td><td>::mlir::ArrayAttr</td><td>Array of dictionary attributes</td></tr>
79+
</table>
80+
81+
82+
### `catalyst.custom_call` (::catalyst::CustomCallOp)
83+
84+
_CustomCall operation_
85+
86+
Syntax:
87+
88+
```
89+
operation ::= `catalyst.custom_call` `fn` `(`$call_target_name`)` `(` $inputs `)`
90+
attr-dict `:` functional-type(operands, results)
91+
```
92+
93+
Encapsulates an implementation-defined operation `call_target_name` that
94+
takes `inputs` and and produces `results`.
95+
96+
A custom call invokes code external to Catalyst. The `inputs` are passed to the
97+
external code, and the external code is expected to produce a result of the
98+
given type.
99+
100+
101+
Interfaces: `MemoryEffectOpInterface`
102+
103+
#### Attributes:
104+
105+
<table>
106+
<tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr>
107+
<tr><td><code>call_target_name</code></td><td>::mlir::StringAttr</td><td>string attribute</td></tr>
108+
<tr><td><code>number_original_arg</code></td><td>::mlir::DenseI32ArrayAttr</td><td>i32 dense array attribute</td></tr>
109+
</table>
110+
111+
#### Operands:
112+
113+
| Operand | Description |
114+
| :-----: | ----------- |
115+
| `inputs` | variadic of any type |
116+
117+
#### Results:
118+
119+
| Result | Description |
120+
| :----: | ----------- |
121+
| &laquo;unnamed&raquo; | variadic of any type |
122+
123+
124+
### `catalyst.launch_kernel` (::catalyst::LaunchKernelOp)
125+
126+
Syntax:
127+
128+
```
129+
operation ::= `catalyst.launch_kernel` $callee `(` $inputs `)` attr-dict `:` functional-type($inputs, results)
130+
```
131+
132+
Interfaces: `CallOpInterface`, `SymbolUserOpInterface`
133+
134+
#### Attributes:
135+
136+
<table>
137+
<tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr>
138+
<tr><td><code>callee</code></td><td>::mlir::SymbolRefAttr</td><td>symbol reference attribute</td></tr>
139+
<tr><td><code>arg_attrs</code></td><td>::mlir::ArrayAttr</td><td>Array of dictionary attributes</td></tr>
140+
<tr><td><code>res_attrs</code></td><td>::mlir::ArrayAttr</td><td>Array of dictionary attributes</td></tr>
141+
</table>
142+
143+
#### Operands:
144+
145+
| Operand | Description |
146+
| :-----: | ----------- |
147+
| `inputs` | variadic of ranked tensor of any type values or memref of any type values |
148+
149+
#### Results:
150+
151+
| Result | Description |
152+
| :----: | ----------- |
153+
| &laquo;unnamed&raquo; | variadic of any type |
154+
155+
156+
### `catalyst.list_dealloc` (::catalyst::ListDeallocOp)
157+
158+
_Deallocate the underlying memory of an arraylist._
159+
160+
Syntax:
161+
162+
```
163+
operation ::= `catalyst.list_dealloc` $list attr-dict `:` type($list)
164+
```
165+
166+
#### Operands:
167+
168+
| Operand | Description |
169+
| :-----: | ----------- |
170+
| `list` | a dynamically resizable array |
171+
172+
173+
### `catalyst.list_init` (::catalyst::ListInitOp)
174+
175+
_Initialize a dynamically resizable arraylist._
176+
177+
Syntax:
178+
179+
```
180+
operation ::= `catalyst.list_init` attr-dict `:` type($list)
181+
```
182+
183+
#### Results:
184+
185+
| Result | Description |
186+
| :----: | ----------- |
187+
| `list` | a dynamically resizable array |
188+
189+
190+
### `catalyst.list_load_data` (::catalyst::ListLoadDataOp)
191+
192+
_Get the underlying memref storing the data of an array list._
193+
194+
Syntax:
195+
196+
```
197+
operation ::= `catalyst.list_load_data` $list attr-dict `:` type($list) `->` type($data)
198+
```
199+
200+
#### Operands:
201+
202+
| Operand | Description |
203+
| :-----: | ----------- |
204+
| `list` | a dynamically resizable array |
205+
206+
#### Results:
207+
208+
| Result | Description |
209+
| :----: | ----------- |
210+
| `data` | memref of any type values |
211+
212+
213+
### `catalyst.list_pop` (::catalyst::ListPopOp)
214+
215+
_Remove an element from the end of an array list and return it._
216+
217+
Syntax:
218+
219+
```
220+
operation ::= `catalyst.list_pop` $list attr-dict `:` type($list)
221+
```
222+
223+
Interfaces: `InferTypeOpInterface`
224+
225+
#### Operands:
226+
227+
| Operand | Description |
228+
| :-----: | ----------- |
229+
| `list` | a dynamically resizable array |
230+
231+
#### Results:
232+
233+
| Result | Description |
234+
| :----: | ----------- |
235+
| `result` | any type |
236+
237+
238+
### `catalyst.list_push` (::catalyst::ListPushOp)
239+
240+
_Append an element to the end of an array list._
241+
242+
Syntax:
243+
244+
```
245+
operation ::= `catalyst.list_push` $value `,` $list attr-dict `:` type($list)
246+
```
247+
248+
#### Operands:
249+
250+
| Operand | Description |
251+
| :-----: | ----------- |
252+
| `value` | any type |
253+
| `list` | a dynamically resizable array |
254+
255+
256+
### `catalyst.print` (::catalyst::PrintOp)
257+
258+
_Prints numeric values or constant strings at runtime._
259+
260+
#### Attributes:
261+
262+
<table>
263+
<tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr>
264+
<tr><td><code>const_val</code></td><td>::mlir::StringAttr</td><td>string attribute</td></tr>
265+
<tr><td><code>print_descriptor</code></td><td>::mlir::UnitAttr</td><td>unit attribute</td></tr>
266+
</table>
267+
268+
#### Operands:
269+
270+
| Operand | Description |
271+
| :-----: | ----------- |
272+
| `val` | any type |
273+

0 commit comments

Comments
 (0)