Skip to content

Commit 2908846

Browse files
authored
[PROTON][XPU] Remove ze_tracing_layer dependency (#5302)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent a9e92c0 commit 2908846

File tree

2 files changed

+0
-94
lines changed

2 files changed

+0
-94
lines changed

third_party/proton/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,8 @@ endforeach()
8787
add_library(proton SHARED ${_proton_obj_sources})
8888

8989
target_link_libraries(proton PRIVATE Python3::Module)
90-
find_library(ZE_TRACING_LIB NAMES ze_tracing_layer PATHS /usr/lib/x86_64-linux-gnu)
9190
find_library(ZE_LOADER_LIB NAMES ze_loader PATHS /usr/lib/x86_64-linux-gnu)
9291

93-
if(ZE_TRACING_LIB)
94-
target_link_libraries(proton PRIVATE ${ZE_TRACING_LIB})
95-
endif()
9692
if(ZE_LOADER_LIB)
9793
target_link_libraries(proton PRIVATE ${ZE_LOADER_LIB})
9894
endif()

third_party/proton/csrc/lib/Profiler/Xpupti/XpuptiProfiler.cpp

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "pti/pti_view.h"
1010
#include <cassert>
1111
#include <cstring>
12-
#include <level_zero/layers/zel_tracing_api.h>
1312
#include <level_zero/zet_api.h>
1413

1514
#include <algorithm>
@@ -207,61 +206,6 @@ struct XpuptiProfiler::XpuptiProfilerPimpl
207206

208207
static uint32_t get_correlation_id(xpupti::Pti_Activity *activity);
209208

210-
static void OnEnterCommandListAppendLaunchKernel(
211-
ze_command_list_append_launch_kernel_params_t *params, ze_result_t result,
212-
void *global_user_data, void **instance_user_data) {
213-
std::cout << "Function zeCommandListAppendLaunchKernel is called on enter"
214-
<< std::endl;
215-
ze_kernel_handle_t kernel = *(params->phKernel);
216-
217-
size_t size = 0;
218-
ze_result_t status = zeKernelGetName(kernel, &size, nullptr);
219-
assert(status == ZE_RESULT_SUCCESS);
220-
221-
std::vector<char> name(size);
222-
status = zeKernelGetName(kernel, &size, name.data());
223-
assert(status == ZE_RESULT_SUCCESS);
224-
std::string str(name.begin(), name.end());
225-
std::cout << "OnEnterCommandListAppendLaunchKernel::demangled kernel_name: "
226-
<< Demangle(name.data()) << "\n";
227-
228-
threadState.enterOp();
229-
230-
size_t numInstances = 1;
231-
// FIXME: 4 - debug value
232-
uint32_t correlationId = 4;
233-
threadState.profiler.correlation.correlate(correlationId, numInstances);
234-
}
235-
236-
static void OnEnterCommandListAppendLaunchCooperativeKernel(
237-
ze_command_list_append_launch_cooperative_kernel_params_t *params,
238-
ze_result_t result, void *global_user_data, void **instance_user_data) {
239-
std::cout << "Function zeCommandListAppendLaunchKernel is called on enter"
240-
<< std::endl;
241-
threadState.enterOp();
242-
// FIXME: 4 - debug value
243-
threadState.profiler.correlation.correlate(4, 1);
244-
}
245-
246-
static void OnExitCommandListAppendLaunchKernel(
247-
ze_command_list_append_launch_kernel_params_t *params, ze_result_t result,
248-
void *global_user_data, void **instance_user_data) {
249-
std::cout << "Function zeCommandListAppendLaunchKernel is called on exit"
250-
<< std::endl;
251-
threadState.exitOp();
252-
// Track outstanding op for flush
253-
// FIXME: 4 - debug value
254-
uint32_t correlationId = 4;
255-
threadState.profiler.correlation.submit(correlationId);
256-
// here works
257-
// uint64_t corr_id = 0;
258-
// auto res =
259-
// ptiViewPopExternalCorrelationId(pti_view_external_kind::PTI_VIEW_EXTERNAL_KIND_CUSTOM_1,
260-
// &corr_id); std::cout << "ptiViewPopExternalCorrelationId res: " << res <<
261-
// "\n" << std::flush; std::cout << "ptiViewPopExternalCorrelationId
262-
// corr_id: " << corr_id << "\n";
263-
}
264-
265209
static void allocBuffer(uint8_t **buffer, size_t *bufferSize);
266210
static void completeBuffer(uint8_t *buffer, size_t size, size_t validSize);
267211
static void callbackFn(pti_callback_domain domain,
@@ -377,8 +321,6 @@ void CallbackCommon(pti_callback_domain domain,
377321
std::cout << std::endl;
378322
}
379323

380-
zel_tracer_handle_t tracer = nullptr;
381-
382324
typedef void (*EnumDeviceUUIDsFunc)(std::vector<std::array<uint8_t, 16>>);
383325

384326
int callEnumDeviceUUIDs(const std::string &utils_cache_path) {
@@ -442,30 +384,6 @@ void XpuptiProfiler::XpuptiProfilerPimpl::doStart() {
442384
ze_result_t status = ZE_RESULT_SUCCESS;
443385
// status = zeInit(ZE_INIT_FLAG_GPU_ONLY);
444386
// assert(status == ZE_RESULT_SUCCESS);
445-
446-
zel_tracer_desc_t tracer_desc = {ZEL_STRUCTURE_TYPE_TRACER_DESC, nullptr,
447-
nullptr};
448-
449-
status = zelTracerCreate(&tracer_desc, &tracer);
450-
std::cout << "zelTracerCreate: " << status << "\n" << std::flush;
451-
assert(status == ZE_RESULT_SUCCESS);
452-
453-
zet_core_callbacks_t prologue_callbacks = {};
454-
zet_core_callbacks_t epilogue_callbacks = {};
455-
prologue_callbacks.CommandList.pfnAppendLaunchKernelCb =
456-
OnEnterCommandListAppendLaunchKernel;
457-
// prologue_callbacks.CommandList.pfnAppendLaunchCooperativeKernelCb =
458-
// OnEnterCommandListAppendLaunchCooperativeKernel;
459-
epilogue_callbacks.CommandList.pfnAppendLaunchKernelCb =
460-
OnExitCommandListAppendLaunchKernel;
461-
462-
status = zelTracerSetPrologues(tracer, &prologue_callbacks);
463-
assert(status == ZE_RESULT_SUCCESS);
464-
status = zelTracerSetEpilogues(tracer, &epilogue_callbacks);
465-
assert(status == ZE_RESULT_SUCCESS);
466-
467-
status = zelTracerSetEnabled(tracer, true);
468-
assert(status == ZE_RESULT_SUCCESS);
469387
*/
470388

471389
xpupti::viewSetCallbacks<true>(allocBuffer, completeBuffer);
@@ -499,14 +417,6 @@ void XpuptiProfiler::XpuptiProfilerPimpl::doFlush() {
499417
}
500418

501419
void XpuptiProfiler::XpuptiProfilerPimpl::doStop() {
502-
/*
503-
ze_result_t status = ZE_RESULT_SUCCESS;
504-
status = zelTracerSetEnabled(tracer, false);
505-
assert(status == ZE_RESULT_SUCCESS);
506-
status = zelTracerDestroy(tracer);
507-
assert(status == ZE_RESULT_SUCCESS);
508-
*/
509-
510420
xpupti::viewDisable<true>(PTI_VIEW_DEVICE_GPU_KERNEL);
511421
xpupti::viewDisable<true>(PTI_VIEW_DEVICE_GPU_MEM_FILL);
512422
xpupti::viewDisable<true>(PTI_VIEW_DEVICE_GPU_MEM_COPY);

0 commit comments

Comments
 (0)