Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions .claude/skills/ktir-dialect.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ operation ::= `ktdp.construct_memory_view` $offset `,` `sizes` `:`
```mlir
#set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 31 >= 0, d1 >= 0, -d1 + 64 >= 0)>
%A_view = ktdp.construct_memory_view %A_start_address, sizes: [32, 64], strides: [64, 1] {
coordinate_set = #set, memory_space = #ktdp.spyre_memory_space<HBM>
coordinate_set = #set, memory_space = #ktdp.memory_space<global>
} : memref<32x64xf16>
```

Expand Down Expand Up @@ -254,12 +254,27 @@ access_tile<1 x 64 x index> // Fully static

Generic abstraction for device-specific memory space attributes within `ktdp`. Provides a uniform mechanism to associate IR values with a target-specific memory hierarchy while remaining extensible across backends.

Concrete implementations (e.g., `SpyreMemorySpaceAttr`) describe specific memory kinds (on-chip scratchpad, HBM) and optional core affinity. This is preferred over integer-based memory space annotations in memref types, which lack readability and semantic richness for distributed scratchpad architectures.
`MemorySpaceAttr` describes *where* memory is visible rather than naming device-specific
memories: `global` is reachable by every compute tile, `ct_local` is private to one, with
optional per-tile affinity via `ct_id`. This is preferred over integer-based memory space
annotations in memref types, which lack readability and semantic richness for distributed
scratchpad architectures.

```mlir
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
memory_space = #ktdp.memory_space<ct_local>
memory_space = #ktdp.memory_space<ct_local, ct_id = 7>
```

> **Divergence from RFC 0682.** The RFC specifies an abstract `KtdpMemorySpaceAttr`
> interface with a Spyre-specific `SpyreMemorySpaceAttr` implementation spelled
> `#ktdp.spyre_memory_space<HBM|LX[, core = N]>` (plus an `unspecified` kind).
> ktir-mlir-frontend#58 removed that interface and renamed the attribute to the
> device-agnostic form above; `unspecified` was dropped with no replacement, and the
> old spelling no longer parses. Treat the syntax here as authoritative over the RFC
> text. `ktir-cpu` maps `global`→`HBM` and `ct_local`→`LX` at the parse boundary,
> keeping the concrete Spyre hierarchy in the interpreter and latency model.

Future extensions will include richer metadata for compute-memory affinity.

---
Expand All @@ -281,17 +296,17 @@ module {

%A_view = ktdp.construct_memory_view %A_start_address, sizes: [96, 64], strides: [64, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 95 >= 0, d1 >= 0, -d1 + 63 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<96x64xf16>

%B_view = ktdp.construct_memory_view %B_start_address, sizes: [96, 64], strides: [64, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 95 >= 0, d1 >= 0, -d1 + 63 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<96x64xf16>

%C_view = ktdp.construct_memory_view %C_start_address, sizes: [96, 64], strides: [64, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 95 >= 0, d1 >= 0, -d1 + 63 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<96x64xf16>

scf.for %i = %c0 to %tile_size step %c1 {
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ jobs:
LLVM_HASH=$(curl -fsSL "https://raw.githubusercontent.com/torch-spyre/ktir-mlir-frontend/$FRONTEND_COMMIT/cmake/llvm-hash.txt")
curl -fsSL "$SETUP_MLIR" -o /tmp/setup_mlir.py
MLIR_DIR=$(GIT_PAT="${{ secrets.GITHUB_TOKEN }}" uv run python /tmp/setup_mlir.py --hash "$LLVM_HASH" --repo torch-spyre/ktir-mlir-frontend)
uv pip install scikit-build-core "nanobind>=2.12.0"
# The install step below uses --no-build-isolation, which bypasses
# ktir-mlir-frontend's build-system.requires — so its `cmake>=4.0`
# pin (torch-spyre/ktir-mlir-frontend#59) does not apply and must be
# satisfied here instead. cmake>=4.0 is required: CMake 3.x writes the
# full target name into its file-API reply filename, and MLIR's
# mlir_generate_type_stubs() builds a 283-char target name by joining
# DEPENDS_TARGETS, overflowing NAME_MAX (255). CMake 4.0 truncates the
# name and relies on the trailing hash.
uv pip install scikit-build-core "nanobind>=2.12.0" "cmake>=4.0" "ninja>=1.11"
echo "CMAKE_ARGS=-DMLIR_DIR=$MLIR_DIR" >> $GITHUB_ENV

- name: Install project and dependencies
Expand Down
6 changes: 5 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ The full spec is also mirrored in `.claude/skills/ktir-dialect.md`.
- Specifically verify:
- `ktdp` dialect ops (`get_compute_tile_id`, `construct_memory_view`, `construct_distributed_memory_view`, `construct_access_tile`, `construct_indirect_access_tile`, `load`, `store`) match the spec's syntax, operands, attributes, and semantics.
- `AccessTileType` element type is always `index`.
- `SpyreMemorySpaceAttr` uses `#ktdp.spyre_memory_space<...>` syntax.
- `MemorySpaceAttr` uses `#ktdp.memory_space<global|ct_local[, ct_id = N]>` syntax.
(This supersedes the RFC's `#ktdp.spyre_memory_space<HBM|LX[, core = N]>`, renamed
upstream in ktir-mlir-frontend#58; the old spelling no longer parses. The
interpreter still uses `HBM`/`LX` internally — translation happens at the parse
boundary via `parse_memory_space`/`format_memory_space` in `parser_utils.py`.)
- `coordinate_set` uses `IntegerSetAttr` (affine integer sets).
- `base_map` and `access_tile_order` use `AffineMapAttr`.
- `access_tile_order` follows lexicographic semantics (rightmost = innermost).
Expand Down
2 changes: 1 addition & 1 deletion docs/gap_analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
| # | Spec Item | Status | Notes |
|---|-----------|--------|-------|
| 3 | `AccessTileType` with dynamic dimensions (`?`) | ❌ | The spec allows `access_tile<? x 64 x index>` (partially/fully dynamic shapes). The parser only extracts static integer dimensions — dynamic `?` dimensions are silently dropped. |
| 4 | `MemorySpaceAttr` (generic) | 🟡 | The parser extracts `SpyreMemorySpaceAttr` (`HBM`/`LX`), but the spec describes `MemorySpaceAttr` as a generic extensible wrapper that could encapsulate other hardware backends. The implementation hardcodes Spyre-specific memory spaces only. |
| 4 | `MemorySpaceAttr` (generic) | 🟢 | Resolved upstream by [ktir-mlir-frontend#58](https://github.com/torch-spyre/ktir-mlir-frontend/pull/58), which removed the `KtdpMemorySpaceAttr` interface and replaced Spyre-specific `#ktdp.spyre_memory_space<HBM\|LX[, core = N]>` with device-agnostic `#ktdp.memory_space<global\|ct_local[, ct_id = N]>` (the `unspecified` kind was dropped). Both parsers now accept only the new spelling and translate to the interpreter's `HBM`/`LX` at the parse boundary (`parse_memory_space` / `format_memory_space` in `parser_utils.py`), so the Spyre hierarchy stays confined to the simulator and latency model. |

## C. Affine/Polyhedral Attributes

Expand Down
10 changes: 5 additions & 5 deletions examples/ktir/ffn_swiglu.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,27 @@ module {
// Create memory views
%x_view = ktdp.construct_memory_view %x_ptr, sizes: [1, 64], strides: [64, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 0 >= 0, d1 >= 0, -d1 + 63 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<1x64xf16>

%w_gate_view = ktdp.construct_memory_view %w_gate_ptr, sizes: [64, 128], strides: [128, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 63 >= 0, d1 >= 0, -d1 + 127 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<64x128xf16>

%w_up_view = ktdp.construct_memory_view %w_up_ptr, sizes: [64, 128], strides: [128, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 63 >= 0, d1 >= 0, -d1 + 127 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<64x128xf16>

%w_down_view = ktdp.construct_memory_view %w_down_ptr, sizes: [128, 64], strides: [64, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 127 >= 0, d1 >= 0, -d1 + 63 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<128x64xf16>

%out_view = ktdp.construct_memory_view %out_ptr, sizes: [1, 64], strides: [64, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 0 >= 0, d1 >= 0, -d1 + 63 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<1x64xf16>

// Load input x
Expand Down
28 changes: 14 additions & 14 deletions examples/ktir/ffn_swiglu_4core.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ module {

%x_view = ktdp.construct_memory_view %x_ptr, sizes: [4, 256], strides: [256, 1] {
coordinate_set = #x_set,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<4x256xf16>

%out_view = ktdp.construct_memory_view %out_ptr, sizes: [4, 256], strides: [256, 1] {
coordinate_set = #x_set,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<4x256xf16>

// ---- W_gate [256, 1024] distributed view: 4 column shards ----
Expand All @@ -139,19 +139,19 @@ module {

%gate_p0 = ktdp.construct_memory_view %w_gate_ptr, sizes: [256, 256], strides: [1024, 1] {
coordinate_set = #gate_col_0,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>
%gate_p1 = ktdp.construct_memory_view %gate_p1_base, sizes: [256, 256], strides: [1024, 1] {
coordinate_set = #gate_col_1,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>
%gate_p2 = ktdp.construct_memory_view %gate_p2_base, sizes: [256, 256], strides: [1024, 1] {
coordinate_set = #gate_col_2,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>
%gate_p3 = ktdp.construct_memory_view %gate_p3_base, sizes: [256, 256], strides: [1024, 1] {
coordinate_set = #gate_col_3,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>

%w_gate_dist = ktdp.construct_distributed_memory_view
Expand All @@ -166,19 +166,19 @@ module {

%up_p0 = ktdp.construct_memory_view %w_up_ptr, sizes: [256, 256], strides: [1024, 1] {
coordinate_set = #gate_col_0,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>
%up_p1 = ktdp.construct_memory_view %up_p1_base, sizes: [256, 256], strides: [1024, 1] {
coordinate_set = #gate_col_1,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>
%up_p2 = ktdp.construct_memory_view %up_p2_base, sizes: [256, 256], strides: [1024, 1] {
coordinate_set = #gate_col_2,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>
%up_p3 = ktdp.construct_memory_view %up_p3_base, sizes: [256, 256], strides: [1024, 1] {
coordinate_set = #gate_col_3,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>

%w_up_dist = ktdp.construct_distributed_memory_view
Expand All @@ -193,19 +193,19 @@ module {

%down_p0 = ktdp.construct_memory_view %w_down_ptr, sizes: [256, 256], strides: [256, 1] {
coordinate_set = #down_row_0,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>
%down_p1 = ktdp.construct_memory_view %down_p1_base, sizes: [256, 256], strides: [256, 1] {
coordinate_set = #down_row_1,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>
%down_p2 = ktdp.construct_memory_view %down_p2_base, sizes: [256, 256], strides: [256, 1] {
coordinate_set = #down_row_2,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>
%down_p3 = ktdp.construct_memory_view %down_p3_base, sizes: [256, 256], strides: [256, 1] {
coordinate_set = #down_row_3,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<256x256xf16>

%w_down_dist = ktdp.construct_distributed_memory_view
Expand Down
2 changes: 1 addition & 1 deletion examples/ktir/nested_yield.ktir
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module {
%c2 = arith.constant 2 : index
%one = arith.constant dense<1.000000e+00> : tensor<4xf32>
%zero = arith.constant dense<0.000000e+00> : tensor<4xf32>
%o_desc = ktdp.construct_memory_view %out, sizes: [4], strides: [1] {memory_space = #ktdp.spyre_memory_space<HBM>} : memref<4xf32>
%o_desc = ktdp.construct_memory_view %out, sizes: [4], strides: [1] {memory_space = #ktdp.memory_space<global>} : memref<4xf32>

%sum = scf.for %i = %c0 to %c2 step %c1 iter_args(%acc = %zero) -> (tensor<4xf32>) {
%next = arith.addf %acc, %one : tensor<4xf32>
Expand Down
4 changes: 2 additions & 2 deletions examples/ktir/reduce_generic.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module {
func.func @reduce_explicit_region(%arg0: index) attributes {grid = [1, 1]} {
%c0 = arith.constant 0 : index
%cst = arith.constant 0.000000e+00 : f16
%view = ktdp.construct_memory_view %arg0, sizes : [1, 4], strides : [4, 1] {coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 3 >= 0)>, memory_space = #ktdp.spyre_memory_space<HBM>} : memref<1x4xf16>
%view = ktdp.construct_memory_view %arg0, sizes : [1, 4], strides : [4, 1] {coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 3 >= 0)>, memory_space = #ktdp.memory_space<global>} : memref<1x4xf16>
%acc = ktdp.construct_access_tile %view[%c0, %c0] {
access_tile_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 3 >= 0)>,
access_tile_order = affine_map<(d0, d1) -> (d0, d1)>
Expand All @@ -22,7 +22,7 @@ module {
// linalg.reduce generic format returns tensor<1xf16>; extract scalar before splat
%scalar = tensor.extract %reduced[%c0] : tensor<1xf16>
%splat = tensor.splat %scalar : tensor<1x4xf16>
%out_view = ktdp.construct_memory_view %arg0, sizes : [1, 4], strides : [4, 1] {coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 3 >= 0)>, memory_space = #ktdp.spyre_memory_space<HBM>} : memref<1x4xf16>
%out_view = ktdp.construct_memory_view %arg0, sizes : [1, 4], strides : [4, 1] {coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 3 >= 0)>, memory_space = #ktdp.memory_space<global>} : memref<1x4xf16>
%out_acc = ktdp.construct_access_tile %out_view[%c0, %c0] {
access_tile_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 3 >= 0)>,
access_tile_order = affine_map<(d0, d1) -> (d0, d1)>
Expand Down
4 changes: 2 additions & 2 deletions examples/ktir/reduce_multiop.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module {
func.func @reduce_multiop(%arg0: index) attributes {grid = [1, 1]} {
%c0 = arith.constant 0 : index
%cst = arith.constant 0xFC00 : f16 // -inf (identity for max)
%view = ktdp.construct_memory_view %arg0, sizes : [1, 8], strides : [8, 1] {coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 7 >= 0)>, memory_space = #ktdp.spyre_memory_space<HBM>} : memref<1x8xf16>
%view = ktdp.construct_memory_view %arg0, sizes : [1, 8], strides : [8, 1] {coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 7 >= 0)>, memory_space = #ktdp.memory_space<global>} : memref<1x8xf16>
%acc = ktdp.construct_access_tile %view[%c0, %c0] {
access_tile_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 7 >= 0)>,
access_tile_order = affine_map<(d0, d1) -> (d0, d1)>
Expand All @@ -25,7 +25,7 @@ module {

%scalar = tensor.extract %reduced[%c0] : tensor<1xf16>
%splat = tensor.splat %scalar : tensor<1x8xf16>
%out_view = ktdp.construct_memory_view %arg0, sizes : [1, 8], strides : [8, 1] {coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 7 >= 0)>, memory_space = #ktdp.spyre_memory_space<HBM>} : memref<1x8xf16>
%out_view = ktdp.construct_memory_view %arg0, sizes : [1, 8], strides : [8, 1] {coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 7 >= 0)>, memory_space = #ktdp.memory_space<global>} : memref<1x8xf16>
%out_acc = ktdp.construct_access_tile %out_view[%c0, %c0] {
access_tile_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 + 7 >= 0)>,
access_tile_order = affine_map<(d0, d1) -> (d0, d1)>
Expand Down
4 changes: 2 additions & 2 deletions examples/ktir/ring_reduce.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module {
%row_view = ktdp.construct_memory_view %row_ptr,
sizes: [1, 128], strides: [128, 1] {
coordinate_set = #row_set,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<1x128xf16>

// (2) Access tile and load
Expand Down Expand Up @@ -89,7 +89,7 @@ module {
%out_view = ktdp.construct_memory_view %out_ptr,
sizes: [1, 128], strides: [128, 1] {
coordinate_set = #row_set,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<1x128xf16>

%out_acc = ktdp.construct_access_tile %out_view[%c0, %c0] {
Expand Down
4 changes: 2 additions & 2 deletions examples/ktir/ring_reduce_inner_loop.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module {
%row_view = ktdp.construct_memory_view %row_ptr,
sizes: [1, 128], strides: [128, 1] {
coordinate_set = #row_set,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<1x128xf16>

// (2) Access tile and load
Expand Down Expand Up @@ -109,7 +109,7 @@ module {
%out_view = ktdp.construct_memory_view %out_ptr,
sizes: [1, 128], strides: [128, 1] {
coordinate_set = #row_set,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<1x128xf16>

%out_acc = ktdp.construct_access_tile %out_view[%c0, %c0] {
Expand Down
4 changes: 2 additions & 2 deletions examples/ktir/scalar_broadcast.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module {
// Load the 1x1 scalar source from HBM.
%in_view = ktdp.construct_memory_view %in_ptr, sizes: [1, 1], strides: [1, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 >= 0, d1 >= 0, -d1 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<1x1xf16>

%in_tile = ktdp.construct_access_tile %in_view[%c0, %c0] {
Expand All @@ -39,7 +39,7 @@ module {
// Store to HBM.
%out_view = ktdp.construct_memory_view %out_ptr, sizes: [4, 64], strides: [64, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 3 >= 0, d1 >= 0, -d1 + 63 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<4x64xf16>

%out_tile = ktdp.construct_access_tile %out_view[%c0, %c0] {
Expand Down
4 changes: 2 additions & 2 deletions examples/ktir/softmax_wide.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ module {
%end = arith.select %cmp, %end_raw, %c_R : index // end = min(end_raw, R)
%input_view_1 = ktdp.construct_memory_view %input_ptr, sizes: [2, 262144], strides: [262144, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 1 >= 0, d1 >= 0, -d1 + 262143 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<2x262144xf16>

%output_view_2 = ktdp.construct_memory_view %output_ptr, sizes: [2, 262144], strides: [262144, 1] {
coordinate_set = affine_set<(d0, d1) : (d0 >= 0, -d0 + 1 >= 0, d1 >= 0, -d1 + 262143 >= 0)>,
memory_space = #ktdp.spyre_memory_space<HBM>
memory_space = #ktdp.memory_space<global>
} : memref<2x262144xf16>

scf.for %row = %start to %end step %c1 : index {
Expand Down
Loading
Loading