Skip to content

Commit

Permalink
[SYCL][XPTI][Doc] PI -> UR renaming (#15164)
Browse files Browse the repository at this point in the history
Closes #15109
  • Loading branch information
martygrant authored Sep 9, 2024
1 parent 93ee5b9 commit 9723157
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 58 deletions.
28 changes: 14 additions & 14 deletions sycl/doc/design/SYCLInstrumentationUsingXPTI.md

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions sycl/source/detail/xpti_registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ namespace detail {
// We define a sycl stream name and this will be used by the instrumentation
// framework
inline constexpr const char *SYCL_STREAM_NAME = "sycl";
// Stream name being used for traces generated from the SYCL plugin layer
inline constexpr const char *SYCL_PICALL_STREAM_NAME = "sycl.pi";
// Stream name being used for traces generated from UR calls. This stream
// contains information about function arguments.
inline constexpr const char *SYCL_PIDEBUGCALL_STREAM_NAME = "sycl.pi.debug";
inline constexpr auto SYCL_MEM_ALLOC_STREAM_NAME =
"sycl.experimental.mem_alloc";

Expand Down
4 changes: 2 additions & 2 deletions xpti/doc/SYCL_Tracing_Implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ and all kernel executions in the applications are added as nodes in this
global graph. In the SYCL runtime, there is no obvious location where the
creation of the global graph can be inserted as many objects are
instantiated statically. Currently, we embed the graph creation in the
plugin interface (PI) layer `initialize()` call. In this call, we will
Unified Runtime (UR) layer `initializePlugins()` call. In this call, we will
perform two operations:

1. Initialize all listeners and create a trace event to represent the graph.
This is done in `sycl/include/sycl/detail/pi.cpp`.
This is done in `sycl/include/sycl/detail/ur.cpp`.
2. Send a `graph_create` event to all subscribers. This notification
will only be sent once.

Expand Down
2 changes: 1 addition & 1 deletion xptifw/samples/sycl_perf_collector/sycl-perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ help()
echo " -c,--color Boolean option, if provided will display output in color for stack data"
echo " -s,--streams Streams to monitor in the SYCL runtime. Multiple streams can be provided"
echo -e " as comma separated values for ${yellow}<Value4>${green}"
echo -e " Example:- ${yellow}sycl,sycl.pi,sycl.perf ${clear}${green}"
echo -e " Example:- ${yellow}sycl,ur.call,sycl.perf ${clear}${green}"
echo " -e,--calibrate Boolean option, if provided will run the application with an empty collector."
echo " -v,--verbose Boolean option, if provided will display verbose output of the collector status"
echo " -d,--debug Boolean option, if provided will display debug output, including saved record information."
Expand Down
12 changes: 6 additions & 6 deletions xptifw/samples/sycl_perf_collector/sycl_perf_collector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ event_instances_t *GRecordsInProgress = nullptr;
xpti::utils::timer::measurement_t GMeasure;

constexpr const char *GStreamBasic = "sycl";
constexpr const char *GStreamPI = "sycl.pi";
constexpr const char *GStreamPI = "ur.call";
constexpr const char *GStreamMemory = "sycl.experimental.mem_alloc";
constexpr const char *GStreamL0 = "sycl.experimental.level_zero.call";
constexpr const char *GStreamCuda = "sycl.experimental.cuda.call";
Expand Down Expand Up @@ -154,7 +154,7 @@ XPTI_CALLBACK_API void graphCallback(uint16_t trace_type,
xpti::trace_event_data_t *parent,
xpti::trace_event_data_t *event,
uint64_t instance, const void *user_data);
XPTI_CALLBACK_API void syclPiCallback(uint16_t trace_type,
XPTI_CALLBACK_API void syclURCallback(uint16_t trace_type,
xpti::trace_event_data_t *parent,
xpti::trace_event_data_t *event,
uint64_t instance, const void *user_data);
Expand Down Expand Up @@ -219,7 +219,7 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
// characteristics that can be encapsulated in a launcher application
//
// 1. XPTI_SYCL_PERF_OUTPUT=[json,csv,table,stack,all]
// 2. XPTI_STREAMS=[all] or [sycl,sycl.pi,sycl.perf,sycl.perf.detail,...]
// 2. XPTI_STREAMS=[all] or [sycl,ur.call,sycl.perf,sycl.perf.detail,...]
// 3. XPTI_STDOUT_USE_COLOR=[1,0]
// 4. XPTI_IGNORE_LIST=piPlatformsGet,piProgramBuild
// 5. XPTI_SIMULATION=10,20,50,100
Expand Down Expand Up @@ -464,10 +464,10 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
auto StreamID = xptiRegisterStream(stream_name);
xptiRegisterCallback(StreamID,
(uint16_t)xpti::trace_point_type_t::function_begin,
syclPiCallback);
syclURCallback);
xptiRegisterCallback(StreamID,
(uint16_t)xpti::trace_point_type_t::function_end,
syclPiCallback);
syclURCallback);
} else if (std::string(GStreamL0) == stream_name && Check) {
auto StreamID = xptiRegisterStream(stream_name);
xptiRegisterCallback(StreamID,
Expand Down Expand Up @@ -909,7 +909,7 @@ XPTI_CALLBACK_API void graphMemCallback(uint16_t TraceType,
// Need to add DOT writer here
}

XPTI_CALLBACK_API void syclPiCallback(uint16_t TraceType,
XPTI_CALLBACK_API void syclURCallback(uint16_t TraceType,
xpti::trace_event_data_t *Parent,
xpti::trace_event_data_t *Event,
uint64_t Instance, const void *UserData) {
Expand Down
18 changes: 0 additions & 18 deletions xptifw/samples/syclpi_collector/CMakeLists.txt

This file was deleted.

18 changes: 18 additions & 0 deletions xptifw/samples/syclur_collector/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
add_library(xpti_syclur_collector SHARED
syclur_collector.cpp
)
target_compile_definitions(xpti_syclur_collector PUBLIC XPTI_CALLBACK_API_EXPORTS=1)
target_link_libraries(xpti_syclur_collector PRIVATE
${xptifw_lib}
${CMAKE_DL_LIBS}
)
target_include_directories(xpti_syclur_collector PRIVATE
${XPTIFW_DIR}/include
${XPTI_DIR}/include
${XPTIFW_DIR}/samples/include
)

if (XPTI_ENABLE_TBB)
target_link_libraries(xpti_syclur_collector PRIVATE tbb)
endif()

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Example SYCL PI Layer Collector
# Example SYCL UR Layer Collector

The SYCL PI layer collector demonstrates the creation of a subscriber and prints
of the data received from SYCL PI layer stream. In order to obtain the data from
The SYCL UR layer collector demonstrates the creation of a subscriber and prints
of the data received from SYCL UR layer stream. In order to obtain the data from
an application instrumented with XPTI, the following steps must be performed.

1. Set the environment variable that indicates that tracing has been enabled.
Expand All @@ -19,9 +19,8 @@ an application instrumented with XPTI, the following steps must be performed.
`XPTI_FRAMEWORK_DISPATCHER=/path/to/libxptifw.[so,dll,dylib]`

3. Set the environment variable that points to the subscriber, which in this
case is `libsyclpi_collector.[so,dll,dylib]`.

`XPTI_SUBSCRIBERS=/path/to/libxpti_syclpi_collector.[so,dll,dylib]`
case is `libsyclur_collector.[so,dll,dylib]`.

`XPTI_SUBSCRIBERS=/path/to/libxpti_syclur_collector.[so,dll,dylib]`
For more detail on the framework, the tests that are provided and their usage,
please consult the [XPTI Framework library documentation](doc/XPTI_Framework.md).
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// An example collector/tool that prints out just the SYCL PI layer trace
// An example collector/tool that prints out just the SYCL UR layer trace
// events
//
#include "xpti/xpti_trace_framework.h"
Expand Down Expand Up @@ -32,15 +32,15 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
const char *stream_name) {
// The example basic collector under xptifw/samples/basic_collector takes in
// streams from anyone as an example. In this collector, we will accept
// streams from just the SYCL plugin interface (PI) layer.
// streams from just the SYCL Unified Runtime (UR) layer.
printf("Stream Name: %s\n", stream_name);
if (std::string("sycl.pi") == stream_name) {
if (std::string("ur.call") == stream_name) {
// Register this stream to get the stream ID; This stream may already have
// been registered by the framework and will return the previously
// registered stream ID. In this sample, we subscribe to only the events
// generated by the SYCL PI layer. The protocol described by the PI layer
// generated by the SYCL UR layer. The protocol described by the UR layer
// is that `user_data` field in the tpCallback() function will contain the
// SYCL PI function name.
// SYCL UR function name.
GStreamID = xptiRegisterStream(stream_name);
xptiRegisterCallback(GStreamID,
(uint16_t)xpti::trace_point_type_t::function_begin,
Expand Down Expand Up @@ -80,6 +80,6 @@ XPTI_CALLBACK_API void tpCallback(uint16_t TraceType,
be = "END";
else
be = "BEGIN";
printf("SYCL_PI: %-35s %s\n", Name, be);
printf("SYCL_UR: %-35s %s\n", Name, be);
}
}

0 comments on commit 9723157

Please sign in to comment.