Skip to content

Rewrite the cuhook using cupti#332

Open
eddy16112 wants to merge 8 commits intomainfrom
wei/cuhook
Open

Rewrite the cuhook using cupti#332
eddy16112 wants to merge 8 commits intomainfrom
wei/cuhook

Conversation

@eddy16112
Copy link
Copy Markdown
Contributor

No description provided.

@eddy16112 eddy16112 requested review from apryakhin and muraj October 9, 2025 21:56
@eddy16112 eddy16112 self-assigned this Oct 9, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.11%. Comparing base (c28d3f9) to head (9e78f37).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #332   +/-   ##
=======================================
  Coverage   29.10%   29.11%           
=======================================
  Files         194      194           
  Lines       40184    40184           
  Branches    14567    14567           
=======================================
+ Hits        11697    11698    +1     
  Misses      28070    28070           
+ Partials      417      416    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

atomic<size_t> cudaipc_responses_received{0};
int cuda_api_version = 0;

CudaHook *cuda_hook{nullptr};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please do not add CudaHook to the cuda module, since everything here is public and accessible to applications. We actually need to move some of these things in here to some internal structure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree with you. Before we have an internal module structure, we will either put it here or move it into the .cc and declare it as a static variable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I declared it as static variable inside cuda_module.cc

cupti_api_initialized = true;
}
if (config->cfg_enable_cuhook && CUPTI_HAS_FNPTR(cuptiSubscribe)) {
cuda_hook = new CudaHook();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why does this have to be a separate object?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it will be cleaner to pack all cu hook related variables and functions into a class.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just do not like floating functions and variables, but you prefer not put them into a class, I am OK removing it.

@@ -1,3 +1,4 @@

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we instead just delete this file entirely? Why does this need to be separate from cuda_module or cuda_internal.cc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The cuda hook is a separate feature, so I think it is better to put it into a different file. The cuda_module and cuda_internal are already over 2000 lines. IMHO, we should divided them into something like cuda_memory.cc, cuda_channel.cc and etc.

@eddy16112 eddy16112 requested a review from muraj October 15, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants