Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented tiling and fusion path for GPU #383

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
30 changes: 30 additions & 0 deletions include/gc/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,36 @@ def GpuToGpuOcl : Pass<"gpu-to-gpuocl", "ModuleOp"> {
"Call finish() after each kernel launch.">
];
}

def GpuTilingAndFusion : Pass<"gpu-tiling", "func::FuncOp"> {
let summary = "GPU tiling and fusion path.";
let description = [{
This pass tiles linalg operations and creates two nested csf.forall loops. When converting to gpu.launch,
the inner loop is mapped to the block sizes and the outer - to grid sizes. The tiles calculation is based
on the GPU device properties, retrieved from the DLTI attributes. If the DLTI attributes are not specified,
defaults to the pass options.
}];
let options = [
Option<"numEus", "num-eus", "size_t",
/*default=*/"448",
"Number of Execution Units.">,
Option<"numEusPerSlice", "num-eus-per-slice", "size_t",
/*default=*/"8",
"Number of Execution Units per slice.">,
Option<"numThreadsPerEu", "num-threads-per-eu", "size_t",
/*default=*/"8",
"Number of threads per Execution Unit.">,
Option<"cacheSize", "cache-size", "size_t",
/*default=*/"131072",
"Execution Unit cache size.">,
Option<"vectorWidth", "vector-width", "size_t",
/*default=*/"512",
"The maximum width of EU's vector registers.">,
Option<"workGroupSize", "work-group-size", "size_t",
/*default=*/"64",
"The maximum workgroup size.">
];
}
#endif // GC_USE_IMEX

def IterativeTilingAndFusion : Pass<"iterative-tiling-and-fusion",
Expand Down
1 change: 1 addition & 0 deletions lib/gc/Transforms/GPU/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set_property(GLOBAL APPEND PROPERTY IMEX_LIBS ${IMEX_LIBS})
gc_add_mlir_library(GcGpuPasses
AddContextArg.cpp
AllocsToSLM.cpp
GpuTilingAndFusion.cpp
GpuToGpuOcl.cpp
LinalgToXeGPU.cpp
Pipeline.cpp
Expand Down
Loading
Loading