Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions include/NeuraDialect/NeuraOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ def Neura_CounterOp : Op<NeuraDialect, "counter", [Pure, AttrSizedOperandSegment
%c32 = arith.constant 32 : index
%c1 = arith.constant 1 : index
%idx = neura.counter from %c0 to %c32 step %c1
{counter_hierarchy = "leaf", counter_dynamism = "static", counter_id = 0 : i32} : index
{counter_hierarchy = "leaf", counter_dynamism = "constant_bound", counter_id = 0 : i32} : index

Example (dynamic upper bound from kernel input):
%idx = neura.counter from %c0 to %N step %c1
Expand Down Expand Up @@ -986,4 +986,4 @@ def Neura_FusedOp : Op<NeuraDialect, "fused_op", [NoTerminator]> {
let regions = (region SizedRegion<1>:$body);

let hasVerifier = 0;
}
}
23 changes: 14 additions & 9 deletions include/TaskflowDialect/TaskflowPasses.td
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def ConstructHyperblockFromTask
}

def ClassifyTaskAndCounter : Pass<"classify-task-and-counter", "ModuleOp"> {
let summary = "Classifies taskflow counters (hierarchy/dynamism/id) and "
"tasks (task_type) in a single pass";
let summary =
"Classifies taskflow counters and marks runtime-managable tasks";
let description = [{
Annotates every taskflow.task and its contained taskflow.counter ops.

Expand All @@ -61,16 +61,21 @@ def ClassifyTaskAndCounter : Pass<"classify-task-and-counter", "ModuleOp"> {
"relay" : middle loop (has parent and children)
"leaf" : innermost loop (no children; also single-loop tasks)

counter_dynamism – bound predictability:
"static" : all bounds are compile-time constants
"symbol_dynamic" : bounds trace to function args / memref.dim
"irregular_dynamic" : bounds depend on earlier task outputs
counter_dynamism – AMOEBA bound class:
"constant_bound" : all bounds are compile-time constants
"symbol_bound" : bounds are known before the task launches
"dynamic_bound" : bounds are produced during task execution

counter_id – unique integer index within the task (0-based)

Per task:
task_type – worst-case counter_dynamism across all counters
("irregular_dynamic" > "symbol_dynamic" > "static")
dlp_replicable = true when the task has hyperblocks without
loop-carried dependence and can be considered for data-level parallel
replication.

runtime_managable = true only when the task has at least one
symbol_bound counter and is DLP-replicable.
Non-runtime-managable tasks are left unmarked.
}];
let constructor = "taskflow::createClassifyTaskAndCounterPass()";
let dependentDialects = ["mlir::affine::AffineDialect",
Expand Down Expand Up @@ -198,4 +203,4 @@ def ResourceAwareTaskOptimization
let dependentDialects = ["mlir::affine::AffineDialect",
"mlir::func::FuncDialect"];
}
#endif // TASKFLOW_PASSES_TD
#endif // TASKFLOW_PASSES_TD
Loading
Loading