-
Notifications
You must be signed in to change notification settings - Fork 53
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
Modifying option for nvrtc #2926
Conversation
Option namingWe already have
So I think we have four related utilities that use three different env vars. One of the utilities is clearly for functional debugging (this PR), while the others are mostly for profiling and perf debugging. I think we should rename the |
Here's the original PR to introduce |
+1 |
funny enough, I was trying to use Looks like you guys don't mind the renaming. I'll:
|
Do we need |
Yes, those two are different.
I verified with the generated PTX. We only see
|
But realistically, since this is only for @xwang233 's compute sanitizer stuff, is |
…on::KernelLineInfo
Yes, that's what I'm asking about. For sanitizer, I think |
@@ -162,6 +161,8 @@ std::unordered_map<EnableOption, std::vector<std::string>> Options< | |||
{"static_fusion_count", EnableOption::StaticFusionCount}, | |||
{"warn_register_spill", EnableOption::WarnRegisterSpill}, | |||
{"io_to_lower_precision", EnableOption::IoToLowerPrecision}, | |||
{"kernel_debug", EnableOption::KernelDebug}, | |||
{"kernel_lineinfo", EnableOption::KernelLineInfo}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tagging @zasdfgbnm , this is renamed from DebugDumpOption::DebugInfo
csrc/fusion_executor/executor.cpp
Outdated
@@ -179,7 +179,7 @@ std::string FusionExecutor::getStructuredCode( | |||
<< code << "\n======================================\n\n"; | |||
} | |||
if (isDebugDumpEnabled(DebugDumpOption::CudaToFile) || | |||
isDebugDumpEnabled(DebugDumpOption::DebugInfo)) { | |||
isOptionEnabled(EnableOption::KernelLineInfo)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me a little unexpected that an enable option dumps a file. Do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree and I'm more than happy to remove this one. tagging @zasdfgbnm to see if there's a reason that we were dumping the cuda source in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a strong request (so approved the PR already), but my preference is to remove this line. I feel that's clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree and I'm more than happy to remove this one. tagging @zasdfgbnm to see if there's a reason that we were dumping the cuda source in the first place.
I think the original intention was indeed dumping some useful info for analyses using ncu. This can be done NVFUSER_ENABLE=kernel_lineinfo NVFUSER_DUMP=cuda_to_file
. Now that we have (too) many options, I'd prefer each option as simple as possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably there because the line info is pretty useless without the dumped kernel. If you only provide NVFUSER_DUMP=debug_info
and not cuda_to_file
, then ncu-ui
will not show the source (it gives a file not found when you try to look at the source and asks where the file is).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably there because the line info is pretty useless without the dumped kernel. If you only provide
NVFUSER_DUMP=debug_info
and notcuda_to_file
, thenncu-ui
will not show the source (it gives a file not found when you try to look at the source and asks where the file is).
🤯 That's a real surprise... I though I've been using the lineinfo on my local machine when I copy over just the profile file without the actual cuda source.
I must have got something wrong... Let me try playing with it a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The discussion here covers all the information. I have nothing more to add, and I am OK with the change. Just a small request that we should document how to use these flags in our wiki page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. I'll remember to do that before merging this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, you don't have to manually copy the cuda source. you can opt in with --import-source 1
in ncu to import the source into the report, so you don't need to manually resolve that in ncu-ui.
But yeah, you still need to have the cuda source dumped out in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the cleanup!
Adding
NVFUSER_ENABLE=kernel_debug
to enable debug option-G
in nvrtc;Moving
DebugDumpOption::DebugInfo
toEnableOption::KernelLineInfo
.