Skip to content
Closed
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
19 changes: 19 additions & 0 deletions projects/rocprofiler-sdk/.cmake-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,25 @@ parse:
DIRECTORY: '*'
TARGET: '*'
SOURCE: '*'
rocprofiler_add_test:
flags:
- WILL_FAIL
kwargs:
NAME: 1
TARGET: 1
WORKING_DIRECTORY: 1
DEPENDS: 1
TIMEOUT: 1
LABELS: 1
DISABLED: 1
ARGS: '*'
COMMAND: '*'
ATTACHED_FILES: '*'
ATTACHED_FILES_ON_FAIL: '*'
ENVIRONMENT: '*'
PASS_REGULAR_EXPRESSION: '*'
FAIL_REGULAR_EXPRESSION: '*'
SKIP_REGULAR_EXPRESSION: '*'
override_spec: {}
vartags: []
proptags: []
Expand Down
2 changes: 1 addition & 1 deletion projects/rocprofiler-sdk/cmake/rocprofiler_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ include(rocprofiler_memcheck)

# default FAIL_REGULAR_EXPRESSION for tests
set(ROCPROFILER_DEFAULT_FAIL_REGEX
"threw an exception|Permission denied|Could not create logging file|failed with error code|Subprocess aborted"
"threw an exception|terminate called after throwing|Permission denied|Could not create logging file|failed with error code|Subprocess aborted"
CACHE INTERNAL "Default FAIL_REGULAR_EXPRESSION for tests" FORCE)

# this should be defaulted to OFF by ROCm 7.0.1 or 7.1 this should only used to disable
Expand Down
2 changes: 1 addition & 1 deletion projects/rocprofiler-sdk/samples/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ find_package(libdw REQUIRED)

# default FAIL_REGULAR_EXPRESSION for tests
set(ROCPROFILER_DEFAULT_FAIL_REGEX
"threw an exception|Permission denied|Could not create logging file|failed with error code|Subprocess aborted"
"threw an exception|terminate called after throwing|Permission denied|Could not create logging file|failed with error code|Subprocess aborted"
CACHE INTERNAL "Default FAIL_REGULAR_EXPRESSION for tests")

# build flags
Expand Down
78 changes: 74 additions & 4 deletions projects/rocprofiler-sdk/source/docs/rocprofv3-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1684,13 +1684,13 @@
"start_timestamp",
"end_timestamp",
"thread_id",
"agent_id",
"agent_id",
"address",
"allocation_size"
]
}
},
"rocdecoder_api": {
}
},
"rocdecoder_api": {
"type": "array",
"description": "ROCDecode API records.",
"items": {
Expand Down Expand Up @@ -1749,6 +1749,76 @@
"thread_id"
]
}
},
"rccl_api_traces": {
"type": "array",
"description": "RCCL API records.",
"items": {
"type": "object",
"properties": {
"size": {
"type": "integer",
"description": "Size of the RCCL API record."
},
"kind": {
"type": "integer",
"description": "Kind of the RCCL API."
},
"operation": {
"type": "integer",
"description": "Operation of the RCCL API."
},
"correlation_id": {
"type": "object",
"description": "Correlation ID information.",
"properties": {
"internal": {
"type": "integer",
"description": "Internal correlation ID."
},
"external": {
"type": "integer",
"description": "External correlation ID."
},
"ancestor": {
"type": "integer",
"description": "Ancestor correlation ID."
}
},
"required": [
"internal",
"external",
"ancestor"
]
},
"start_timestamp": {
"type": "integer",
"description": "Start timestamp."
},
"end_timestamp": {
"type": "integer",
"description": "End timestamp."
},
"thread_id": {
"type": "integer",
"description": "Thread ID."
},
"args": {
"type": "array",
"description": "RCCL API args"
}
},
"required": [
"size",
"kind",
"operation",
"correlation_id",
"start_timestamp",
"end_timestamp",
"thread_id",
"args"
]
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <rocprofiler-sdk/fwd.h>
#include <rocprofiler-sdk/hip/api_args.h>
#include <rocprofiler-sdk/kfd/kfd_id.h>
#include <rocprofiler-sdk/rccl/api_args.h>
#include <rocprofiler-sdk/rccl/api_id.h>
#include <rocprofiler-sdk/rocdecode/api_args.h>
#include <rocprofiler-sdk/rocdecode/api_id.h>

Expand Down Expand Up @@ -208,6 +210,25 @@ typedef struct rocprofiler_buffer_tracing_rccl_api_record_t
/// @brief Specification of the API function, e.g., ::rocprofiler_rccl_api_id_t
} rocprofiler_buffer_tracing_rccl_api_record_t;

typedef struct rocprofiler_buffer_tracing_rccl_api_ext_record_t
{
uint64_t size; ///< size of this struct
rocprofiler_buffer_tracing_kind_t kind;
rocprofiler_rccl_api_id_t operation;
rocprofiler_correlation_id_t correlation_id; ///< correlation ids for record
rocprofiler_timestamp_t start_timestamp; ///< start time in nanoseconds
rocprofiler_timestamp_t end_timestamp; ///< end time in nanoseconds
rocprofiler_thread_id_t thread_id; ///< id for thread generating this record
rocprofiler_rccl_api_args_t args; ///< arguments of function call
rocprofiler_rccl_api_retval_t retval; ///< return value of function call

/// @var kind
/// @brief ::ROCPROFILER_BUFFER_TRACING_RCCL_API_EXT
/// @var operation
/// @brief Specification of the API function (@see
/// ::rocprofiler_rccl_api_id_t)
} rocprofiler_buffer_tracing_rccl_api_ext_record_t;

/**
* @brief ROCProfiler Buffer rocDecode API Record.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,8 @@ ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_KFD_EVENT_DROPPED_EVENTS);
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_KFD_PAGE_MIGRATE);
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_KFD_PAGE_FAULT);
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_KFD_QUEUE);
static_assert(ROCPROFILER_BUFFER_TRACING_LAST == 33);
ROCPROFILER_ENUM_LABEL(ROCPROFILER_BUFFER_TRACING_RCCL_API_EXT);
static_assert(ROCPROFILER_BUFFER_TRACING_LAST == 34);

// rocprofiler_code_object_operation_t
ROCPROFILER_ENUM_LABEL(ROCPROFILER_CODE_OBJECT_NONE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(KERNEL_DISPATCH, kernel_dispatch)
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(SCRATCH_MEMORY, scratch_memory)
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(CORRELATION_ID_RETIREMENT, none)
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(RCCL_API, rccl_api)
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(RCCL_API_EXT, rccl_api)
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(OMPT, openmp)
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(RUNTIME_INITIALIZATION, none)
ROCPROFILER_PERFETTO_BUFFER_TRACING_CATEGORY(ROCDECODE_API, rocdecode_api)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,16 @@ save(ArchiveT& ar, rocprofiler_buffer_tracing_rccl_api_record_t data)
save_buffer_tracing_api_record(ar, data);
}

template <typename ArchiveT>
void
save(ArchiveT& ar, rocprofiler_buffer_tracing_rccl_api_ext_record_t data)
{
save_buffer_tracing_api_record(ar, data);
auto args = sdk::serialization::get_buffer_tracing_args(data);
ROCP_SDK_SAVE_VALUE("args", args);
ROCP_SDK_SAVE_DATA_FIELD(retval);
}

template <typename ArchiveT>
void
save(ArchiveT& ar, rocprofiler_buffer_tracing_rocdecode_api_record_t data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ typedef enum rocprofiler_buffer_tracing_kind_t // NOLINT(performance-enum-size)
ROCPROFILER_BUFFER_TRACING_KFD_QUEUE, ///< @see rocprofiler_kfd_queue_operation_t
ROCPROFILER_BUFFER_TRACING_MARKER_CORE_RANGE_API, ///< @see
///< ::rocprofiler_marker_core_range_api_id_t
ROCPROFILER_BUFFER_TRACING_RCCL_API_EXT,
ROCPROFILER_BUFFER_TRACING_LAST,

/// @var ROCPROFILER_BUFFER_TRACING_HIP_RUNTIME_API_EXT
Expand All @@ -238,6 +239,8 @@ typedef enum rocprofiler_buffer_tracing_kind_t // NOLINT(performance-enum-size)
/// contains the function argument(s) and return value
/// @var ROCPROFILER_BUFFER_TRACING_ROCDECODE_API_EXT
/// @brief Similar to ROCPROFILER_BUFFER_TRACING_ROCDECODE_API except the buffer record
/// @var ROCPROFILER_BUFFER_TRACING_RCCL_API_EXT
/// @brief Similar to ROCPROFILER_BUFFER_TRACING_RCCL_API except the buffer record
/// contains the function argument(s) and return value
} rocprofiler_buffer_tracing_kind_t;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ using hsa_buffered_output_t =
using marker_buffered_output_t =
buffered_output<rocprofiler_buffer_tracing_marker_api_record_t, domain_type::MARKER>;
using rccl_buffered_output_t =
buffered_output<rocprofiler_buffer_tracing_rccl_api_record_t, domain_type::RCCL>;
buffered_output<rocprofiler_buffer_tracing_rccl_api_ext_record_t, domain_type::RCCL>;
using counter_collection_buffered_output_t =
buffered_output<tool_counter_record_t, domain_type::COUNTER_COLLECTION>;
using scratch_memory_buffered_output_t =
Expand Down
8 changes: 4 additions & 4 deletions projects/rocprofiler-sdk/source/lib/output/generateCSV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,10 +706,10 @@ generate_csv(const output_config&
}

void
generate_csv(const output_config& cfg,
const metadata& tool_metadata,
const generator<rocprofiler_buffer_tracing_rccl_api_record_t>& data,
const stats_entry_t& stats)
generate_csv(const output_config& cfg,
const metadata& tool_metadata,
const generator<rocprofiler_buffer_tracing_rccl_api_ext_record_t>& data,
const stats_entry_t& stats)
{
if(data.empty()) return;

Expand Down
8 changes: 4 additions & 4 deletions projects/rocprofiler-sdk/source/lib/output/generateCSV.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ generate_csv(const output_config&
const stats_entry_t& stats);

void
generate_csv(const output_config& cfg,
const metadata& tool_metadata,
const generator<rocprofiler_buffer_tracing_rccl_api_record_t>& data,
const stats_entry_t& stats);
generate_csv(const output_config& cfg,
const metadata& tool_metadata,
const generator<rocprofiler_buffer_tracing_rccl_api_ext_record_t>& data,
const stats_entry_t& stats);

void
generate_csv(const output_config& cfg,
Expand Down
4 changes: 2 additions & 2 deletions projects/rocprofiler-sdk/source/lib/output/generateJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ write_json(
const generator<tool_counter_record_t>& counter_collection_gen,
const generator<rocprofiler_buffer_tracing_marker_api_record_t>& marker_api_gen,
const generator<rocprofiler_buffer_tracing_scratch_memory_record_t>& scratch_memory_gen,
const generator<rocprofiler_buffer_tracing_rccl_api_record_t>& rccl_api_gen,
const generator<rocprofiler_buffer_tracing_rccl_api_ext_record_t>& rccl_api_ext_gen,
const generator<tool_buffer_tracing_memory_allocation_ext_record_t>& memory_allocation_gen,
const generator<rocprofiler_buffer_tracing_rocdecode_api_ext_record_t>& rocdecode_api_gen,
const generator<rocprofiler_buffer_tracing_rocjpeg_api_record_t>& rocjpeg_api_gen,
Expand Down Expand Up @@ -234,7 +234,7 @@ write_json(
json_ar(cereal::make_nvp("hip_api", hip_api_gen));
json_ar(cereal::make_nvp("hsa_api", hsa_api_gen));
json_ar(cereal::make_nvp("marker_api", marker_api_gen));
json_ar(cereal::make_nvp("rccl_api", rccl_api_gen));
json_ar(cereal::make_nvp("rccl_api", rccl_api_ext_gen));
json_ar(cereal::make_nvp("memory_copy", memory_copy_gen));
json_ar(cereal::make_nvp("memory_allocation", memory_allocation_gen));
json_ar(cereal::make_nvp("scratch_memory", scratch_memory_gen));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ write_json(
const generator<tool_counter_record_t>& counter_collection_gen,
const generator<rocprofiler_buffer_tracing_marker_api_record_t>& marker_api_gen,
const generator<rocprofiler_buffer_tracing_scratch_memory_record_t>& scratch_memory_gen,
const generator<rocprofiler_buffer_tracing_rccl_api_record_t>& rccl_api_gen,
const generator<rocprofiler_buffer_tracing_rccl_api_ext_record_t>& rccl_api_ext_gen,
const generator<tool_buffer_tracing_memory_allocation_ext_record_t>& memory_allocation_gen,
const generator<rocprofiler_buffer_tracing_rocdecode_api_ext_record_t>& rocdecode_api_gen,
const generator<rocprofiler_buffer_tracing_rocjpeg_api_record_t>& rocjpeg_api_gen,
Expand Down
27 changes: 24 additions & 3 deletions projects/rocprofiler-sdk/source/lib/output/generateOTF2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ write_otf2(const output_config& cfg,
std::deque<tool_buffer_tracing_memory_copy_ext_record_t>* memory_copy_data,
std::deque<rocprofiler_buffer_tracing_marker_api_record_t>* marker_api_data,
std::deque<rocprofiler_buffer_tracing_scratch_memory_record_t>* /*scratch_memory_data*/,
std::deque<rocprofiler_buffer_tracing_rccl_api_record_t>* rccl_api_data,
std::deque<rocprofiler_buffer_tracing_rccl_api_ext_record_t>* rccl_api_ext_data,
std::deque<tool_buffer_tracing_memory_allocation_ext_record_t>* memory_allocation_data,
std::deque<rocprofiler_buffer_tracing_rocdecode_api_ext_record_t>* rocdecode_api_data,
std::deque<rocprofiler_buffer_tracing_rocjpeg_api_record_t>* rocjpeg_api_data)
Expand Down Expand Up @@ -417,7 +417,7 @@ write_otf2(const output_config& cfg,
tids.emplace(itr.thread_id);
for(auto itr : *marker_api_data)
tids.emplace(itr.thread_id);
for(auto itr : *rccl_api_data)
for(auto itr : *rccl_api_ext_data)
tids.emplace(itr.thread_id);
for(auto itr : *rocdecode_api_data)
tids.emplace(itr.thread_id);
Expand Down Expand Up @@ -615,7 +615,6 @@ write_otf2(const output_config& cfg,
add_event_data(hsa_api_data, sdk::category::hsa_api{});
add_event_data(hip_api_data, sdk::category::hip_api{});
add_event_data(marker_api_data, sdk::category::marker_api{});
add_event_data(rccl_api_data, sdk::category::rccl_api{});
add_event_data(rocjpeg_api_data, sdk::category::rocjpeg_api{});
}

Expand All @@ -641,6 +640,28 @@ write_otf2(const output_config& cfg,
nullptr});
}

for(auto itr : *rccl_api_ext_data)
{
auto name = buffer_names.at(itr.kind, itr.operation);
_hash_data.emplace(
get_hash_id(name),
region_info{std::string{name}, OTF2_REGION_ROLE_FUNCTION, OTF2_PARADIGM_USER});

auto& _evt_info = thread_event_info.at(itr.thread_id);
_evt_info.event_count += 1;

_data.emplace_back(evt_data{ROCPROFILER_CALLBACK_PHASE_ENTER,
name,
_evt_info.get_location(),
itr.start_timestamp,
get_attr(sdk::category::rccl_api{})});
_data.emplace_back(evt_data{ROCPROFILER_CALLBACK_PHASE_EXIT,
name,
_evt_info.get_location(),
itr.end_timestamp,
nullptr});
}

for(auto itr : *memory_copy_data)
{
auto name = buffer_names.at(itr.kind, itr.operation);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ write_otf2(const output_config& cfg,
std::deque<tool_buffer_tracing_memory_copy_ext_record_t>* memory_copy_data,
std::deque<rocprofiler_buffer_tracing_marker_api_record_t>* marker_api_data,
std::deque<rocprofiler_buffer_tracing_scratch_memory_record_t>* scratch_memory_data,
std::deque<rocprofiler_buffer_tracing_rccl_api_record_t>* rccl_api_data,
std::deque<rocprofiler_buffer_tracing_rccl_api_ext_record_t>* rccl_api_ext_data,
std::deque<tool_buffer_tracing_memory_allocation_ext_record_t>* memory_allocation_data,
std::deque<rocprofiler_buffer_tracing_rocdecode_api_ext_record_t>* rocdecode_api_data,
std::deque<rocprofiler_buffer_tracing_rocjpeg_api_record_t>* rocjpeg_api_data);
Expand Down
Loading
Loading