Skip to content

[XPTI][INFRA] Sample E2E data collection timing test for XPTI #13045

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

Merged
merged 17 commits into from
Mar 28, 2024

Conversation

tovinkere
Copy link
Contributor

XPTI has unit tests that time the cost of each individual framework action, but an E2E timing test isn't available. This PR adds a new sample collector that shows how data can be pulled from the SYCL runtime using XPTI and provides timing information for the callback handler costs/event.

Allows:

  1. Zero cost application with XPTI_TRACE_ENABLE=0
  2. Zero cost callback handlers when run in calibration mode
  3. Full E2E test when run with "--format none" which gives the average cost of callback handlers/event

 + There is no infrastructure to record the performance impact
   due to changes in the framework on the entire stack.
 + Re-organizes some helper functions that will eventually
   support the testing framework

Signed-off-by: Vasanth Tovinkere <[email protected]>
Signed-off-by: Vasanth Tovinkere <[email protected]>
  + Initial check in of the infrastructure

Signed-off-by: Vasanth Tovinkere <[email protected]>
  + Allows the use of "none" for format field in case the
    measurements need to include the capture of the data and
    not writing out to a file

Signed-off-by: Vasanth Tovinkere <[email protected]>
  + Added clean up of all allocated objects

Signed-off-by: Vasanth Tovinkere <[email protected]>
@tovinkere tovinkere requested a review from a team as a code owner March 16, 2024 04:54
  + Converted the last static variable to be dynamically
    allocated
  + Added verbose option to allow the collector to print
    information for debugging

Signed-off-by: Vasanth Tovinkere <[email protected]>
Copy link
Contributor

github-actions bot commented Mar 22, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

Signed-off-by: Vasanth Tovinkere <[email protected]>
Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova left a comment

Choose a reason for hiding this comment

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

looks ok overall

xptiRegisterCallback(StreamID,
(uint16_t)xpti::trace_point_type_t::function_end,
syclPiCallback);
} else if (std::string("sycl.perf") == stream_name && Check) {
Copy link
Contributor

Choose a reason for hiding this comment

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

what is sycl.perf and sycl.perf.detail is enabled at the same time? will we handle them proper;y in the same callback function?

Copy link
Contributor Author

@tovinkere tovinkere Mar 26, 2024

Choose a reason for hiding this comment

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

@KseniyaTikhomirova Those to could be removed as it is from a later patch. sycl.perf/sycl.perf.detail is being considered to complement the the "sycl" stream.

return;
record_and_save("sycl.experimental.mem_alloc", (Event ? Event : Parent),
TraceType, Instance,
(TraceType & 0x0001) ? "Memory_allocation_end"
Copy link
Contributor

Choose a reason for hiding this comment

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

why capital latters? would be better to use the same style as for other traces.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, was probably a typo.

  + The output messages are now broken into verbose and debug
    to differentiate progress messages from debug output
  + The collector by default does not subscribe to levelzero
    or Cuda streams as they are dependent on the system and
    L0 tracer success. All streams subscribed by default will
    succeed in the current implementation.

Signed-off-by: Vasanth Tovinkere <[email protected]>
@tovinkere
Copy link
Contributor Author

tovinkere commented Mar 26, 2024

The failure is due to this issue #13149 and not related to this PR.
@KseniyaTikhomirova Can you review the final changes?

Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova left a comment

Choose a reason for hiding this comment

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

LGTM

@againull againull merged commit 0c0b586 into intel:sycl Mar 28, 2024
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.

3 participants