Skip to content

Conversation

@moksiuc
Copy link

@moksiuc moksiuc commented Nov 14, 2025

Summary:

Code cleanup of XPU profiler plugin to prepare it for incoming PR with implementation of XPU scope profiler.

Changes:

  • removed unused code
  • clean up lists of included headers
  • added missing copyright headers
  • simplified algorithms
  • run clang-format

@meta-cla meta-cla bot added the cla signed label Nov 14, 2025
@moksiuc moksiuc changed the title Code cleanup for scope profiler Code cleanup of XPU profiler for incoming scope profiler Nov 14, 2025
@moksiuc
Copy link
Author

moksiuc commented Nov 14, 2025

@EikanWang, @gujinghui
First PR extracted from:
#1174

errors_.push_back(err_msg);
const ITraceActivity* act) {
bool rangeEnabled = captureWindowStartTime_ || captureWindowEndTime_;
if (rangeEnabled) {

Choose a reason for hiding this comment

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

@moksiuc Could you give detailed comments for this change? Looks like the code is different from CUDA path.

bool out_of_range = act.timestamp() < captureWindowStartTime_ ||

If this change is for range profiler, let's move to next PRs. If not, please give comments in the code.

}

// FIXME: Deprecate this method while activity._sycl_queue_id got correct IDs
// from PTI

Choose a reason for hiding this comment

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

This comment should be not reasonable, as there should be no queue ID in SYCL runtime.
Let's remove the comments?

Copy link
Author

Choose a reason for hiding this comment

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

As far as I know PTI is working on this issue and it is better that the comment stays to remember to remove this method completely in the future.


void XpuptiActivityApi::bufferRequested(uint8_t** buffer, size_t* size) {
std::lock_guard<std::mutex> guard(mutex_);
if (allocatedGpuTraceBuffers_.size() >= (size_t)maxGpuBufferCount_) {

Choose a reason for hiding this comment

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

@moksiuc Why we do not need to care about the buffer size limitation now? PTI will handle it by itself?

Copy link
Author

Choose a reason for hiding this comment

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

This path of the code was not used in our case. This 'if' only sets 'stopCollection = true;' what was not used anywhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants