-
Notifications
You must be signed in to change notification settings - Fork 7
Print debug info about expr transform on GpuLower #2185
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
Conversation
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.
Mostly looks good, just some minor cleanup suggestions
@@ -109,6 +110,8 @@ auto parseDebugDumpOptions() { | |||
options_map[DebugDumpOption::BankConflictInfo] = true; | |||
} else if (token == "sync_map") { | |||
options_map[DebugDumpOption::SyncMap] = true; | |||
} else if (token == "pass_transform") { |
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.
We may want to use some more specific keyword than "pass_transfrom". Perhaps, "lower_verbose"?
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.
done, renamed lower_verbose
if (isDebugDumpEnabled(DebugDumpOption::PassTransform)) { | ||
std::cout << "Before validateIr:" << std::endl; | ||
for (auto exp : fusion_->exprs()) { | ||
std::cout << exp->toString() << std::endl; | ||
} | ||
} |
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.
Let's create a function to do this so that we don't need to have this code repeatedly.
void dumpExprs(const std::vector<Expr*>& exprs, std::string msg_pre) {
if (isDebugDumpEnabled(DebugDumpOption::PassTransform)) {
std::cout << msg_pre << ":" << std::endl;
for (auto exp : exprs) {
std::cout << exp->toString() << std::endl;
}
}
}
Ideally, we should have an actual pass manager to do this kind of pre- and post-processing automatically, which should also automatically enforce correct dependencies between passes, but for now, I think this should be fine.
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.
done. move to dumpExprsIfEnabled(const std::vector<Expr*>& exprs, std::string msg_pre)
…gic to func dumpExprsIfEnabled
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.
LGTM. Thanks for adding this functionality!
You may first need to merge |
done |
@azazhu Linter passes. You can merge it now. |
@zasdfgbnm , I don't have write permission. Could you add write permission to me? |
Sorry, I wasn't aware of that. ping @csarofeen for permission. I will merge this PR for you. |
add print debug info about expr transforms on GpuLower. So, we can review the expr strings and check if a pass's behavior meets our expectation.
use PYTORCH_NVFUSER_DUMP="pass_transform" to enable the debug print.