Skip to content

Commit 9b053f6

Browse files
-- This commit bumps IREE to iree-org/iree@402a9be46a. -- As part of the same it :- a. [removes "dangling" builders](iree-org/iree#21364) b. [adds explicit cast](iree-org/iree#21494) c. [adds explicit result type of enum](llvm/llvm-project#150308) d. updates MLIR-AIR to 53e3f44 e. adds `CascadeFlowOp`, `GetCascadeOp` and `PutCascadeOp` to AIE dialect. Signed-off-by: Abhishek Varma <[email protected]>
1 parent 3e64b52 commit 9b053f6

File tree

9 files changed

+90
-31
lines changed

9 files changed

+90
-31
lines changed

build_tools/ci/cpu_comparison/run.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,27 +2493,29 @@ def __init__(self):
24932493
# Note: The error tolerance for npu4 is higher than that for npu1_4col.
24942494
# npu1_4col uses a lookup table to compute exponentials,
24952495
# whereas npu4 uses a native exp2 instruction, which is less accurate.
2496-
for target, rtol in [["npu1_4col", 4e-2], ["npu4", 8e-2]]:
2497-
for run_benchmark in [False, True]:
2498-
self.register(
2499-
Softmax(
2500-
8192,
2501-
1024,
2502-
"bf16",
2503-
test_params=TestParams(
2504-
run_on_target=target,
2505-
name_suffix=target,
2506-
use_chess=True,
2507-
use_chess_for_ukernel=True,
2508-
use_ukernel=True,
2509-
tile_pipeline="general-copy",
2510-
run_benchmark=run_benchmark,
2511-
n_repeats=2,
2512-
n_kernel_runs=100,
2513-
rtol=rtol,
2514-
),
2515-
)
2516-
)
2496+
# TODO: Disable till iree-org/iree issue https://github.com/iree-org/iree/issues/21633
2497+
# gets fixed.
2498+
# for target, rtol in [["npu1_4col", 4e-2], ["npu4", 8e-2]]:
2499+
# for run_benchmark in [False, True]:
2500+
# self.register(
2501+
# Softmax(
2502+
# 8192,
2503+
# 1024,
2504+
# "bf16",
2505+
# test_params=TestParams(
2506+
# run_on_target=target,
2507+
# name_suffix=target,
2508+
# use_chess=True,
2509+
# use_chess_for_ukernel=True,
2510+
# use_ukernel=True,
2511+
# tile_pipeline="general-copy",
2512+
# run_benchmark=run_benchmark,
2513+
# n_repeats=2,
2514+
# n_kernel_runs=100,
2515+
# rtol=rtol,
2516+
# ),
2517+
# )
2518+
# )
25172519

25182520
# Reduction op tests:
25192521
self.register(

compiler/plugins/target/AMD-AIE/aie/AIEDialect.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,18 @@ LogicalResult DMABDOp::verify() {
580580
return success();
581581
}
582582

583+
//===----------------------------------------------------------------------===//
584+
// CascadeFlowOp
585+
//===----------------------------------------------------------------------===//
586+
587+
TileOp CascadeFlowOp::getSourceTileOp() {
588+
return cast<TileOp>(getSourceTile().getDefiningOp());
589+
}
590+
591+
TileOp CascadeFlowOp::getDestTileOp() {
592+
return cast<TileOp>(getDestTile().getDefiningOp());
593+
}
594+
583595
//===----------------------------------------------------------------------===//
584596
// AIE_FlowOp
585597
//===----------------------------------------------------------------------===//

compiler/plugins/target/AMD-AIE/aie/AIEOps.td

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -639,10 +639,6 @@ def AIE_ObjectFifoSubviewAccessOp : AIE_Op<"objectfifo.subview.access"> {
639639
let assemblyFormat = [{
640640
$subview `[` $index `]` attr-dict `:` type($subview) `->` type($output)
641641
}];
642-
643-
let builders = [
644-
OpBuilder<(ins "mlir::Value":$subview, "size_t":$index)>
645-
];
646642
}
647643

648644
// mlir-air legacy
@@ -674,6 +670,55 @@ def AIE_ShimDMAOp: AIE_Op<"shim_dma", [
674670
}];
675671
}
676672

673+
def AIE_CascadeFlowOp: AIE_Op<"cascade_flow", []> {
674+
let arguments = (
675+
ins Index:$source_tile,
676+
Index:$dest_tile
677+
);
678+
let summary = "A cascade connection between tiles";
679+
let description = [{
680+
The `aie.cascade_flow` operation represents a cascade connection between two `aie.tile` operations.
681+
During lowering, this is replaced by `aie.configure_cascade` operations for each `aie.tile` based on
682+
their relative placement to one another.
683+
684+
Example:
685+
```
686+
%tile03 = aie.tile(0, 3)
687+
%tile13 = aie.tile(1, 3)
688+
aie.cascade_flow(%tile03, %tile13)
689+
```
690+
}];
691+
let assemblyFormat = [{
692+
`(` $source_tile `,` $dest_tile `)` attr-dict
693+
}];
694+
let extraClassDeclaration = [{
695+
TileOp getSourceTileOp();
696+
TileOp getDestTileOp();
697+
}];
698+
}
699+
700+
def AIE_GetCascadeOp: AIE_Op<"get_cascade", []>, Results<(outs AnyType:$cascade_value)> {
701+
let summary = "An op to read from a cascading stream from a neighboring core";
702+
let description = [{
703+
An op to read from a cascading stream from a neighboring core.
704+
The result type of this operation must have a size that matches the cascade size,
705+
which is architecture-dependent. e.g. AIE1: i384 or vector<8xi48> AIE2: i512 or vector<16xi32>
706+
}];
707+
let assemblyFormat = [{ `(` `)` attr-dict `:` type($cascade_value) }];
708+
}
709+
710+
def AIE_PutCascadeOp: AIE_Op<"put_cascade", []> {
711+
let summary = "An op to write to a cascading stream from a neighboring core";
712+
let description = [{
713+
An op to write to a cascading stream from a neighboring core.
714+
The argument type of this operation must have a size that matches the cascade size,
715+
which is architecture-dependent. e.g. AIE1: i384 or vector<8xi48> AIE2: i512 or vector<16xi32>
716+
}];
717+
718+
let arguments = (ins AnyType:$cascade_value);
719+
let assemblyFormat = [{ `(` $cascade_value `:` type($cascade_value) `)` attr-dict }];
720+
}
721+
677722
// legacy to support tests
678723

679724
def AIE_ObjectFifoRegisterExternalBuffersOp: AIE_Op<"objectfifo.register_external_buffers"> {

compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIEOps.td

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,9 +1414,7 @@ def AMDAIE_LogicalObjectFifoFromMemrefOp
14141414
$memref `,``{` $tiles `}` attr-dict `:` type($memref) `->` type($output)
14151415
}];
14161416

1417-
// Build a LogicalObjectFifoFromMemrefOp with just a memref value.
14181417
let builders = [
1419-
OpBuilder<(ins "mlir::Value":$memref)>,
14201418
// Build `LogicalObjectFifoFromMemrefOp` with an array of static tile
14211419
// locations.
14221420
OpBuilder<

compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include "iree-dialects/Dialect/LinalgTransform/Passes.h"
2424
#include "iree/compiler/Utils/ToolUtils.h"
2525
#include "llvm/ADT/StringRef.h"
26+
#include "llvm/IR/LLVMContext.h"
27+
#include "llvm/IR/Module.h"
2628
#include "llvm/Support/Debug.h"
2729
#include "llvm/Support/FileSystem.h"
2830
#include "llvm/Support/JSON.h"

compiler/plugins/target/AMD-AIE/iree-amd-aie/Transforms/AMDAIEInsertLoopsForVectorization.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class AMDAIEInsertLoopsForVectorizationPass
117117
} else {
118118
rewriter.eraseOp(genericOp);
119119
}
120-
genericOp = result->resultOp;
120+
genericOp = cast<linalg::GenericOp>(result->resultOp);
121121
return;
122122
}
123123

runtime/src/iree-amd-aie/aie_runtime/iree_aie_router.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct PhysPortType {
9292
};
9393

9494
struct PhysPort {
95-
enum Direction { SRC, DST };
95+
enum Direction : uint8_t { SRC, DST };
9696
TileLoc tileLoc;
9797
Port port;
9898
Direction direction;

third_party/iree

Submodule iree updated 472 files

third_party/mlir-air

Submodule mlir-air updated 100 files

0 commit comments

Comments
 (0)