Skip to content

Commit

Permalink
[XPU][Kineto Submodule] Introduce kineto-based XPU profiler (pytorch#…
Browse files Browse the repository at this point in the history
…130811)

As XPU became a PyTorch built-in device, the profiler support is indispensable part of functionality completeness. This PR is associated with the PR to introduce XPU profiler plugin into the kineto. When USE_XPU is enabled, the LIBKINETO_NOXPUPTI option will be suppressed accordingly, which allows kineto to build with XPU profiler plugin.

Associated PR to introduce kineto-based XPU profiler into kineto:
pytorch/kineto#961

Also updates the Kineto Submodule to include XPU changes.

Co-authored-by: Aaron Enye Shi <[email protected]>
Pull Request resolved: pytorch#130811
Approved by: https://github.com/aaronenyeshi
  • Loading branch information
zejun-chen authored and pytorchmergebot committed Aug 7, 2024
1 parent 0755188 commit 26b0011
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,14 @@ if(USE_KINETO)
message(STATUS "Using Kineto with Roctracer support")
endif()

if(LIBKINETO_NOCUPTI AND LIBKINETO_NOROCTRACER)
if(NOT USE_XPU)
set(LIBKINETO_NOXPUPTI ON CACHE STRING "" FORCE)
else()
set(LIBKINETO_NOXPUPTI OFF CACHE STRING "")
message(STATUS "Using Kineto with XPUPTI support")
endif()

if(LIBKINETO_NOCUPTI AND LIBKINETO_NOROCTRACER AND LIBKINETO_NOXPUPTI)
message(STATUS "Using CPU-only version of Kineto")
endif()

Expand Down Expand Up @@ -1662,7 +1669,12 @@ if(USE_KINETO)
if(LIBKINETO_NOROCTRACER)
string(APPEND CMAKE_CXX_FLAGS " -DLIBKINETO_NOROCTRACER")
endif()
if(LIBKINETO_NOCUPTI AND LIBKINETO_NOROCTRACER)
if(LIBKINETO_NOXPUPTI)
string(APPEND CMAKE_CXX_FLAGS " -DLIBKINETO_NOXPUPTI=ON")
else()
string(APPEND CMAKE_CXX_FLAGS " -DLIBKINETO_NOXPUPTI=OFF")
endif()
if(LIBKINETO_NOCUPTI AND LIBKINETO_NOROCTRACER AND LIBKINETO_NOXPUPTI)
message(STATUS "Configured Kineto (CPU)")
else()
message(STATUS "Configured Kineto")
Expand Down

0 comments on commit 26b0011

Please sign in to comment.