Repository navigation
[DT] Collapse MaterializeEncodingIntoPaddingPass into the generic pass. - #22472
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR consolidates encoding materialization by merging the separate padding encoding pass into the main MaterializeDeviceEncodingPass. The changes eliminate the specialized MaterializeEncodingIntoPaddingPass and handle both data tiling and padding encoding resolution through a unified pass with configurable resolver types.
Key changes:
- Removed the separate
MaterializeEncodingIntoPaddingPassand its associatedaddEncodingToPaddingPassesfunction - Extended
MaterializeDeviceEncodingPasswith a newtest-gpu-encoding-resolveroption that supports bothgpu_data_tilingandgpu_paddingresolver kinds - Updated test files to use the unified pass with appropriate resolver configuration
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Passes.cpp | Removed call to addEncodingToPaddingPasses from the pass pipeline |
| Passes.td | Replaced boolean test-cl-gpu-target option with enum-based test-gpu-encoding-resolver option supporting multiple resolver types |
| Passes.h | Removed declaration of addEncodingToPaddingPasses function |
| MaterializeEncodingIntoPadding.cpp | Deleted entire file containing the specialized padding pass |
| MaterializeEncoding.cpp | Refactored to handle both data tiling and padding resolvers based on the new enum option |
| EncodingUtils.h | Added TestingResolverKind enum defining resolver types for testing |
| materialize_encoding_*.mlir | Updated test RUN lines to use the unified pass with appropriate resolver configuration |
| CMakeLists.txt / BUILD.bazel | Removed MaterializeEncodingIntoPadding.cpp from build files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ebf0278 to
4c5c8a7
Compare
|
I need to update few more comments and docs. |
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
1f2a5ba to
8c765b2
Compare
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
| ::mlir::iree_compiler::detail::TestingResolverKind resolverSource = | ||
| ::mlir::iree_compiler::detail::TestingResolverKind::kNone) { |
There was a problem hiding this comment.
do we need these ::mlir:: prefixes?
There was a problem hiding this comment.
There are other detail namespaces in either mlir or iree_compiler which makes it confusing.
There was a problem hiding this comment.
I'd think that iree_compiler::detail would suffice, no?
There was a problem hiding this comment.
And what’s worse: unqualified search starts at the bottom of that list and stops as soon as there is a namespace match.
Sorry, I was wrong on my previous response. And it is why I was confused about the above sentence. The root cause is that we are using namespace and the tablegen generates detail namespace in IREE::Encoding dialect. I removed the using namespace and it looks happy now.
There was a problem hiding this comment.
I'd think that iree_compiler::detail would suffice, no?
This is correct. I misremembered the guidance from absl. I read it again this morning.
https://abseil.io/tips/130
https://abseil.io/tips/119
| #define IREE_COMPILER_CODEGEN_COMMON_PASSES_H_ | ||
|
|
||
| #include "iree/compiler/Codegen/Common/CombineLayoutTransformation.h" | ||
| #include "iree/compiler/Codegen/Common/EncodingUtils.h" |
There was a problem hiding this comment.
This is needed because we declare enum class and use it in Passes.td. To be more specific, it is required by this include:
iree/compiler/src/iree/compiler/Codegen/Common/Passes.h
Lines 181 to 182 in b973dea
| clEnumValN(::mlir::iree_compiler::detail::TestingResolverKind::kGPUPadding, "gpu_padding", | ||
| "Use iree_gpu.gpu_padding_resolver<>."), | ||
| clEnumValN(::mlir::iree_compiler::detail::TestingResolverKind::kNone, "none", | ||
| "Ignore testing resolvers.") |
There was a problem hiding this comment.
| "Ignore testing resolvers.") | |
| "Ignore testing resolvers. Fall back to identity resolver.") |
Nit: Might be useful to mention this here as well.
There was a problem hiding this comment.
Thanks, I missed it!
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
Signed-off-by: hanhanW <[email protected]>
…s. (iree-org#22472) This PR consolidates encoding materialization by merging the separate padding encoding pass into the main `MaterializeDeviceEncodingPass`. The changes eliminate the specialized `MaterializeEncodingIntoPaddingPass` and handle both data tiling and padding encoding resolution through a unified pass. The pass still prioritizes the pre-configured encoding resolver. If it is not present, it tries testing encoding resolver. Key changes: - Removed the separate `MaterializeEncodingIntoPaddingPass` and its associated `addEncodingToPaddingPasses` function. - Extended `MaterializeDeviceEncodingPass` with a new `test-gpu-encoding-resolver` option that supports both `gpu_data_tiling` and `gpu_padding` resolver kinds for testing purpose. - Updated test files to use the unified pass with appropriate resolver configuration. Fixes iree-org#20160 --------- Signed-off-by: hanhanW <[email protected]>
…s. (iree-org#22472) This PR consolidates encoding materialization by merging the separate padding encoding pass into the main `MaterializeDeviceEncodingPass`. The changes eliminate the specialized `MaterializeEncodingIntoPaddingPass` and handle both data tiling and padding encoding resolution through a unified pass. The pass still prioritizes the pre-configured encoding resolver. If it is not present, it tries testing encoding resolver. Key changes: - Removed the separate `MaterializeEncodingIntoPaddingPass` and its associated `addEncodingToPaddingPasses` function. - Extended `MaterializeDeviceEncodingPass` with a new `test-gpu-encoding-resolver` option that supports both `gpu_data_tiling` and `gpu_padding` resolver kinds for testing purpose. - Updated test files to use the unified pass with appropriate resolver configuration. Fixes iree-org#20160 --------- Signed-off-by: hanhanW <[email protected]>
This PR consolidates encoding materialization by merging the separate padding encoding pass into the main
MaterializeDeviceEncodingPass. The changes eliminate the specializedMaterializeEncodingIntoPaddingPassand handle both data tiling and padding encoding resolution through a unified pass. The pass still prioritizes the pre-configured encoding resolver. If it is not present, it tries testing encoding resolver.Key changes:
MaterializeEncodingIntoPaddingPassand its associatedaddEncodingToPaddingPassesfunction.MaterializeDeviceEncodingPasswith a newtest-gpu-encoding-resolveroption that supports bothgpu_data_tilingandgpu_paddingresolver kinds for testing purpose.Fixes #20160