-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add a dump option to dump a fusion IR graph #3603
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,7 @@ | |||||
#include <global_allocator.h> | ||||||
#include <instrumentation.h> | ||||||
#include <ir/all_nodes.h> | ||||||
#include <ir/graphviz.h> | ||||||
#include <ir/utils.h> | ||||||
#include <iter_visitor.h> | ||||||
#include <kernel_ir.h> | ||||||
|
@@ -304,6 +305,9 @@ void KernelExecutor::compile( | |||||
NVF_ERROR( | ||||||
!fusion->outputs().empty(), "No output found for this kernel, aborting."); | ||||||
|
||||||
createKernelId( | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove Fuser/csrc/runtime/executor.cpp Lines 421 to 422 in d623221
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just moved it here. I also am not sure if this should be a stateful operation. It seems just returning a string seems sufficient, but didn't bother to do a further cleanup. |
||||||
scheduler_type, fusion_id_, concrete_id_, runtime_id_, group_id_); | ||||||
|
||||||
// TODO: refactor the options_ passed through | ||||||
options_.device = c10::Device(c10::DeviceType::CUDA, args.getDeviceIndex()); | ||||||
|
||||||
|
@@ -346,10 +350,21 @@ void KernelExecutor::compile( | |||||
} | ||||||
} | ||||||
|
||||||
if (isDebugDumpEnabled(DebugDumpOption::FusionIrMath)) { | ||||||
fusion->printMath(); | ||||||
} | ||||||
|
||||||
if (isDebugDumpEnabled(DebugDumpOption::FusionIr)) { | ||||||
fusion->print(); | ||||||
} else if (isDebugDumpEnabled(DebugDumpOption::FusionIrMath)) { | ||||||
fusion->printMath(); | ||||||
} | ||||||
|
||||||
if (isDebugDumpEnabled(DebugDumpOption::FusionIrGraph)) { | ||||||
std::stringstream file_name; | ||||||
file_name << "__tmp_fusion_ir_graph_" << kernel_id_ << ".dot"; | ||||||
IrGraphGenerator::print( | ||||||
fusion, | ||||||
file_name.str().c_str(), | ||||||
IrGraphGenerator::DetailLevel::ComputeOnly); | ||||||
} | ||||||
|
||||||
//! Force index_type to int and disable magic zero if we detect that the | ||||||
|
@@ -418,8 +433,7 @@ void KernelExecutor::compile( | |||||
for (const auto& hook : post_lowering_hooks_) { | ||||||
hook(kernel); | ||||||
} | ||||||
createKernelId( | ||||||
scheduler_type, fusion_id_, concrete_id_, runtime_id_, group_id_); | ||||||
|
||||||
setUsedTVs(); | ||||||
|
||||||
if (isDebugDumpEnabled(DebugDumpOption::KernelIr)) { | ||||||
|
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.
Just changed to the alphabetical ordering