Skip to content

[mlir][gpu] Remove offloadingHandler from ModuleToBinary #90368

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

Merged
merged 1 commit into from
Apr 28, 2024

Conversation

fabianmcg
Copy link
Contributor

This patch removes the offloadingHandler option from the ModuleToBinary pass. The option is removed as it cannot be parsed from textual form.

This fixes issue #90344.

This patch removes the `offloadingHandler` option from the `ModuleToBinary`
pass. The option is removed as it cannot be parsed from textual form.

This fixes issue llvm#90344.
@llvmbot
Copy link
Member

llvmbot commented Apr 28, 2024

@llvm/pr-subscribers-mlir-gpu

@llvm/pr-subscribers-mlir

Author: Fabian Mora (fabianmcg)

Changes

This patch removes the offloadingHandler option from the ModuleToBinary pass. The option is removed as it cannot be parsed from textual form.

This fixes issue #90344.


Full diff: https://github.com/llvm/llvm-project/pull/90368.diff

2 Files Affected:

  • (modified) mlir/include/mlir/Dialect/GPU/Transforms/Passes.td (-2)
  • (modified) mlir/lib/Dialect/GPU/Transforms/ModuleToBinary.cpp (+1-4)
diff --git a/mlir/include/mlir/Dialect/GPU/Transforms/Passes.td b/mlir/include/mlir/Dialect/GPU/Transforms/Passes.td
index a8235bed6f2764..4a9ddafdd177d2 100644
--- a/mlir/include/mlir/Dialect/GPU/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/GPU/Transforms/Passes.td
@@ -88,8 +88,6 @@ def GpuModuleToBinaryPass
     4. `fatbinary`, `fatbin`: produces fatbinaries.
   }];
   let options = [
-    Option<"offloadingHandler", "handler", "Attribute", "nullptr",
-           "Offloading handler to be attached to the resulting binary op.">,
     Option<"toolkitPath", "toolkit", "std::string", [{""}],
            "Toolkit path.">,
     ListOption<"linkFiles", "l", "std::string",
diff --git a/mlir/lib/Dialect/GPU/Transforms/ModuleToBinary.cpp b/mlir/lib/Dialect/GPU/Transforms/ModuleToBinary.cpp
index 01613ab5268bc4..836e939a8295ba 100644
--- a/mlir/lib/Dialect/GPU/Transforms/ModuleToBinary.cpp
+++ b/mlir/lib/Dialect/GPU/Transforms/ModuleToBinary.cpp
@@ -88,10 +88,7 @@ void GpuModuleToBinaryPass::runOnOperation() {
   TargetOptions targetOptions(toolkitPath, linkFiles, cmdOptions, *targetFormat,
                               lazyTableBuilder);
   if (failed(transformGpuModulesToBinaries(
-          getOperation(),
-          offloadingHandler ? dyn_cast<OffloadingLLVMTranslationAttrInterface>(
-                                  offloadingHandler.getValue())
-                            : OffloadingLLVMTranslationAttrInterface(nullptr),
+          getOperation(), OffloadingLLVMTranslationAttrInterface(nullptr),
           targetOptions)))
     return signalPassFailure();
 }

@fabianmcg
Copy link
Contributor Author

I opted for removing the option for now.
The alternative of adding an option parser for an mlir::Attribute doesn't work, as parsing an attribute requires a valid MLIRContext and there's no safe way to pass the context to the option parser.

@fabianmcg fabianmcg merged commit dc6ce60 into llvm:main Apr 28, 2024
@fabianmcg fabianmcg deleted the pr-gpu-fix branch June 10, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants