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

[MLIR][NVVM] Print ptxas path in debug output for "serialize-to-binary" #132373

Merged
merged 1 commit into from
Mar 25, 2025

Conversation

grypp
Copy link
Member

@grypp grypp commented Mar 21, 2025

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Mar 21, 2025

@llvm/pr-subscribers-mlir-llvm

@llvm/pr-subscribers-mlir-gpu

Author: Guray Ozen (grypp)

Changes

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

2 Files Affected:

  • (modified) mlir/lib/Target/LLVM/NVVM/Target.cpp (+1)
  • (modified) mlir/test/Integration/GPU/CUDA/command-line-arg.mlir (+1)
diff --git a/mlir/lib/Target/LLVM/NVVM/Target.cpp b/mlir/lib/Target/LLVM/NVVM/Target.cpp
index fa8c597da58b1..69a247b06bf16 100644
--- a/mlir/lib/Target/LLVM/NVVM/Target.cpp
+++ b/mlir/lib/Target/LLVM/NVVM/Target.cpp
@@ -455,6 +455,7 @@ NVPTXSerializer::compileToBinary(const std::string &ptxCode) {
   LLVM_DEBUG({
     llvm::dbgs() << "Tool invocation for module: "
                  << getOperation().getNameAttr() << "\n";
+    llvm::dbgs() << "ptxas executable:" << ptxasCompiler.value() << "\n";
     llvm::interleave(ptxasArgs, llvm::dbgs(), " ");
     llvm::dbgs() << "\n";
     if (createFatbin) {
diff --git a/mlir/test/Integration/GPU/CUDA/command-line-arg.mlir b/mlir/test/Integration/GPU/CUDA/command-line-arg.mlir
index 34dde6e03c80e..f65eda6a2a88d 100644
--- a/mlir/test/Integration/GPU/CUDA/command-line-arg.mlir
+++ b/mlir/test/Integration/GPU/CUDA/command-line-arg.mlir
@@ -16,6 +16,7 @@ func.func @host_function(%arg0 : f32, %arg1 : memref<?xf32>) {
     return
 }
 
+// CHECK: ptxas executable:
 // CHECK: ptxas -arch sm_80
 // CHECK-SAME: -v 
 // CHECK-SAME: --register-usage-level=8

@llvmbot
Copy link
Member

llvmbot commented Mar 21, 2025

@llvm/pr-subscribers-mlir

Author: Guray Ozen (grypp)

Changes

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

2 Files Affected:

  • (modified) mlir/lib/Target/LLVM/NVVM/Target.cpp (+1)
  • (modified) mlir/test/Integration/GPU/CUDA/command-line-arg.mlir (+1)
diff --git a/mlir/lib/Target/LLVM/NVVM/Target.cpp b/mlir/lib/Target/LLVM/NVVM/Target.cpp
index fa8c597da58b1..69a247b06bf16 100644
--- a/mlir/lib/Target/LLVM/NVVM/Target.cpp
+++ b/mlir/lib/Target/LLVM/NVVM/Target.cpp
@@ -455,6 +455,7 @@ NVPTXSerializer::compileToBinary(const std::string &ptxCode) {
   LLVM_DEBUG({
     llvm::dbgs() << "Tool invocation for module: "
                  << getOperation().getNameAttr() << "\n";
+    llvm::dbgs() << "ptxas executable:" << ptxasCompiler.value() << "\n";
     llvm::interleave(ptxasArgs, llvm::dbgs(), " ");
     llvm::dbgs() << "\n";
     if (createFatbin) {
diff --git a/mlir/test/Integration/GPU/CUDA/command-line-arg.mlir b/mlir/test/Integration/GPU/CUDA/command-line-arg.mlir
index 34dde6e03c80e..f65eda6a2a88d 100644
--- a/mlir/test/Integration/GPU/CUDA/command-line-arg.mlir
+++ b/mlir/test/Integration/GPU/CUDA/command-line-arg.mlir
@@ -16,6 +16,7 @@ func.func @host_function(%arg0 : f32, %arg1 : memref<?xf32>) {
     return
 }
 
+// CHECK: ptxas executable:
 // CHECK: ptxas -arch sm_80
 // CHECK-SAME: -v 
 // CHECK-SAME: --register-usage-level=8

@@ -16,6 +16,7 @@ func.func @host_function(%arg0 : f32, %arg1 : memref<?xf32>) {
return
}

// CHECK: ptxas executable:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm puzzled that we have this test in-tree, in general we never test debug output, and I don't understand how is this test passing in release mode?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add a test for every code I write, so I probably added these test automatically :)

This is a CUDA integration test. Perhaps we don't run CUDA integration tests in release mode?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible, can you remove it please?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed from this PR.
I have written other tests as well for debug runs. let me put a new PR that removes them all.

@joker-eph joker-eph changed the title [MLIR][NVVM] Print ptxas path [MLIR][NVVM] Print ptxas path in Debug Output for "serialize-to-binary" Mar 21, 2025
@joker-eph joker-eph changed the title [MLIR][NVVM] Print ptxas path in Debug Output for "serialize-to-binary" [MLIR][NVVM] Print ptxas path in debug output for "serialize-to-binary" Mar 21, 2025
@grypp grypp merged commit 9910d34 into llvm:main Mar 25, 2025
11 checks passed
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