Skip to content
Merged
Show file tree
Hide file tree
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: 0 additions & 4 deletions .github/workflows/build-test-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ jobs:
ref: ${{ inputs.pytorch_ref }}
mode: ${{ inputs.pytorch_mode }}

- name: Build Proton with XPU support
run: |
echo TRITON_BUILD_PROTON_XPU=1 | tee -a $GITHUB_ENV

- name: Build Triton
uses: ./.github/actions/setup-triton
with:
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ def build_extension(self, ext):
# environment variables we will pass through to cmake
passthrough_args = [
"TRITON_BUILD_PROTON",
"TRITON_BUILD_PROTON_XPU",
"TRITON_BUILD_WITH_CCACHE",
"TRITON_PARALLEL_LINK_JOBS",
]
Expand Down
5 changes: 0 additions & 5 deletions third_party/proton/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ project(Proton LANGUAGES CXX)
set(PROTON_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/csrc")
set(PROTON_COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/common")

option(TRITON_BUILD_PROTON_XPU "Build Proton with XPU support" OFF)
if(TRITON_BUILD_PROTON_XPU)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTRITON_BUILD_PROTON_XPU")
endif()

# ============ Check for includes =============
if(NOT CUPTI_INCLUDE_DIR)
message(FATAL_ERROR "CUPTI include directory not defined")
Expand Down
11 changes: 3 additions & 8 deletions third_party/proton/csrc/lib/Driver/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
set(SOURCE_FILES
add_proton_library(ProtonDriver
Device.cpp
GPU/CudaApi.cpp
GPU/CuptiApi.cpp
GPU/HipApi.cpp
GPU/HsaApi.cpp
GPU/RoctracerApi.cpp
GPU/NvtxApi.cpp
GPU/XpuApi.cpp
GPU/XpuptiApi.cpp
)

if(TRITON_BUILD_PROTON_XPU)
list(APPEND SOURCE_FILES GPU/XpuApi.cpp)
list(APPEND SOURCE_FILES GPU/XpuptiApi.cpp)
endif()

add_proton_library(ProtonDriver ${SOURCE_FILES})
4 changes: 0 additions & 4 deletions third_party/proton/csrc/lib/Driver/Device.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#include "Device.h"
#include "Driver/GPU/CudaApi.h"
#include "Driver/GPU/HipApi.h"
#ifdef TRITON_BUILD_PROTON_XPU
#include "Driver/GPU/XpuApi.h"
#endif

#include "Utility/Errors.h"

Expand All @@ -16,11 +14,9 @@ Device getDevice(DeviceType type, uint64_t index) {
if (type == DeviceType::HIP) {
return hip::getDevice(index);
}
#ifdef TRITON_BUILD_PROTON_XPU
if (type == DeviceType::XPU) {
return xpu::getDevice(index);
}
#endif
throw std::runtime_error("DeviceType not supported");
}

Expand Down
23 changes: 9 additions & 14 deletions third_party/proton/csrc/lib/Profiler/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
set(SOURCE_FILES
Cupti/CuptiPCSampling.cpp
Cupti/CuptiProfiler.cpp
RocTracer/RoctracerProfiler.cpp
Instrumentation/InstrumentationProfiler.cpp
Instrumentation/CudaRuntime.cpp
Instrumentation/HipRuntime.cpp
Instrumentation/Metadata.cpp
add_proton_library(ProtonProfiler
Cupti/CuptiPCSampling.cpp
Cupti/CuptiProfiler.cpp
RocTracer/RoctracerProfiler.cpp
Xpupti/XpuptiProfiler.cpp
Instrumentation/InstrumentationProfiler.cpp
Instrumentation/CudaRuntime.cpp
Instrumentation/HipRuntime.cpp
Instrumentation/Metadata.cpp
)

if(TRITON_BUILD_PROTON_XPU)
list(APPEND SOURCE_FILES Xpupti/XpuptiProfiler.cpp)
endif()

add_proton_library(ProtonProfiler ${SOURCE_FILES})
9 changes: 2 additions & 7 deletions third_party/proton/csrc/lib/Session/Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
#include "Context/Shadow.h"
#include "Data/TraceData.h"
#include "Data/TreeData.h"
#include "Driver/GPU/XpuApi.h"
#include "Profiler/Cupti/CuptiProfiler.h"
#include "Profiler/Instrumentation/InstrumentationProfiler.h"
#include "Profiler/Roctracer/RoctracerProfiler.h"
#ifdef TRITON_BUILD_PROTON_XPU
#include "Driver/GPU/XpuApi.h"
#include "Profiler/Xpupti/XpuptiProfiler.h"
#endif
#include "Utility/String.h"

namespace proton {
Expand All @@ -24,13 +22,10 @@ Profiler *makeProfiler(const std::string &name, void *sycl_queue = nullptr,
return &RoctracerProfiler::instance();
} else if (proton::toLower(name) == "instrumentation") {
return &InstrumentationProfiler::instance();
}
#ifdef TRITON_BUILD_PROTON_XPU
if (proton::toLower(name) == "xpupti") {
} else if (proton::toLower(name) == "xpupti") {
xpu::PROTON_UTILS = utils_cache_path;
return &XpuptiProfiler::instance().setSyclQueue(sycl_queue);
}
#endif
throw std::runtime_error("Unknown profiler: " + name);
}

Expand Down
Loading