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
16 changes: 14 additions & 2 deletions projects/rocprofiler-sdk/source/lib/output/metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,20 @@ process_agent_counters(rocprofiler_agent_id_t agent_id,
auto _dim_ids = std::vector<rocprofiler_counter_dimension_id_t>{};
auto _dim_info = std::vector<rocprofiler_counter_record_dimension_info_t>{};

ROCPROFILER_CHECK(rocprofiler_query_counter_info(
counters[i], ROCPROFILER_COUNTER_INFO_VERSION_1, &_info));
auto status = rocprofiler_query_counter_info(
counters[i], ROCPROFILER_COUNTER_INFO_VERSION_1, &_info);

if(status != ROCPROFILER_STATUS_SUCCESS)
{
ROCP_WARNING << fmt::format(
"[{}] skipping counter metadata for handle {} because "
"rocprofiler_query_counter_info(...) failed: {} :: {}",
__FUNCTION__,
counters[i].handle,
rocprofiler_get_status_name(status),
rocprofiler_get_status_string(status));
continue;
}

if(counters_set_data != nullptr && counters_set_data->count(_info.name) == 0)
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ get_query_info(rocprofiler_agent_id_t agent, const counters::Metric& metric)
hsa_ven_amd_aqlprofile_id_query_t query = {metric.block().c_str(), 0, 0};
if(aqlprofile_get_pmc_info(&profile, AQLPROFILE_INFO_BLOCK_ID, &query) != HSA_STATUS_SUCCESS)
{
ROCP_DFATAL << fmt::format("AQL failed to query info for counter {}", metric);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related: #4039

throw std::runtime_error(fmt::format("AQL failed to query info for counter {}", metric));
}
return query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,15 @@ getBlockDimensions(rocprofiler_agent_id_t agent_id, const Metric& metric)
{
auto dims = std::map<int, uint64_t>{};
auto status = aql::get_dim_info(agent_id, event, 0, dims);
CHECK_EQ(status, ROCPROFILER_STATUS_SUCCESS) << rocprofiler_get_status_string(status);
// Event-level error handling: Skip individual events with invalid dimension info.
// This allows the metric to succeed partially if some events are valid.
if(status != ROCPROFILER_STATUS_SUCCESS)
{
ROCP_WARNING << "Failed to get dimension info for event in metric '" << metric.name()
<< "': " << rocprofiler_get_status_string(status)
<< ". Event will be skipped.";
continue;
}

for(const auto& [id, extent] : dims)
{
Expand Down Expand Up @@ -113,10 +121,13 @@ generate_dimensions(rocprofiler_agent_id_t agent_id)
{
// Generate dimensions for this specific agent
dims.emplace(ast.out_id().handle, ast_copy.set_dimensions(agent_id));
} catch(std::runtime_error& e)
}
// Metric-level error handling: Skip entire metric on validation failures
catch(const std::runtime_error& e)
{
ROCP_FATAL << metric << " has improper dimensions"
<< " " << e.what();
ROCP_WARNING << "Invalid counter '" << metric << "' in YAML configuration - "
<< e.what() << ". Counter will be skipped.";
continue;
}
}
return {.id_to_dim = dims};
Expand Down
Loading
Loading