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

Fix dump effective bandwidth #1962

Merged
merged 3 commits into from
Sep 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion torch/csrc/jit/codegen/cuda/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,8 @@ std::vector<at::Tensor> FusionExecutor::runFusion(
!args.getCacheId().has_value() || outputs.empty(),
"short cut input cache is not compatible with pre-allocated output");

size_t num_inputs = args.size();

if (isDebugDumpEnabled(DebugDumpOption::FusionArgs)) {
std::cout << "Arguments for fusion" << fusion_id_ << ":" << std::endl
<< "Inputs:" << std::endl;
Expand Down Expand Up @@ -1260,7 +1262,7 @@ std::vector<at::Tensor> FusionExecutor::runFusion(

bytes_processed_ = 0;
// Figure how many bytes are inputs, outputs, and temporary buffers
for (auto i : c10::irange(args.size())) {
for (auto i : c10::irange(num_inputs)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cc @naoyam

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks. I believe some code cleanup would be due here (not about this particular fix)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Apology for this half finished work. I get dragged away in the middle of the refactor.

I do plan on coming back here and clean things up after 1.13.

Copy link
Owner

Choose a reason for hiding this comment

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

whoops 😳

if (auto tensor_arg_abstract =
dynamic_cast<const TensorArgAbstract*>(args[i])) {
bytes_processed_ += tensor_arg_abstract->numel() *
Expand Down