Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
385f45e
fix(rocprofiler-sdk): stop rocpd summing kernel-replay passes of a re…
amd-vkale Oct 6, 2026
d05a5dc
test(rocprofiler-sdk): declare --rocpd-input next to --json-input
amd-vkale Oct 9, 2026
b4b19d4
fix(rocprofiler-sdk): report the kernel-replay pass in rocpd pmc_events
amd-vkale Oct 9, 2026
fa88015
fix(rocprofiler-sdk): version replay-aware rocpd views
amd-vkale Oct 14, 2026
c187d3d
Merge remote-tracking branch 'upstream/develop' into cursor/rocpd-rep…
amd-vkale Oct 15, 2026
0642ee4
docs(rocprofiler-sdk): add remove-callbacks and iteration-range to Un…
amd-vkale Oct 15, 2026
d50d001
docs(rocprofiler-sdk): keep Unreleased remove-callbacks notes on #13600
amd-vkale Oct 15, 2026
14a5529
fix(rocprofiler-sdk): format back-compat tests and trigger pre-commit…
amd-vkale Oct 16, 2026
3447e74
fix(rocprofiler-sdk): parse replay_pass without SQLite JSON1
amd-vkale Oct 16, 2026
efa48ab
fix(rocprofiler-sdk): harden rocpd-back-compat schema fixture setup
amd-vkale Oct 16, 2026
ba20f7e
docs(rocprofiler-sdk): restore Unreleased remove-callbacks and iterat…
amd-vkale Oct 16, 2026
be19d72
fix(rocprofiler-sdk): load rocpd from the rocprofv3 prefix
amd-vkale Nov 7, 2026
36d7807
Merge remote-tracking branch 'upstream/develop' into cursor/rocpd-rep…
amd-vkale Nov 7, 2026
37c5d79
fix(rocprofiler-sdk): point rocpd tests at the build schema
amd-vkale Nov 10, 2026
a640afc
fix(rocprofiler-sdk): resolve the rocpd test schema from the library …
amd-vkale Nov 11, 2026
817fbfe
fix(rocprofiler-sdk): point rocprofv3 at its own rocpd schema
amd-vkale Nov 11, 2026
db04e05
fix(rocprofiler-sdk): format the schema-path launch test
amd-vkale Nov 11, 2026
0786414
fix(rocprofiler-sdk): resolve the rocpd test schema by searching for …
amd-vkale Nov 11, 2026
1737a05
fix(rocprofiler-sdk): locate the rocpd SQL schema from the library th…
amd-vkale Nov 11, 2026
b8dfea6
test(rocprofiler-sdk): drop the stale-install schema path test for now
amd-vkale Nov 11, 2026
12267f8
fix(rocprofiler-sdk): give install-tree tests the schema this build w…
amd-vkale Nov 12, 2026
54879a0
Merge branch 'develop' into cursor/rocpd-repeated-pmc-counter-0e6b
amd-vkale Nov 12, 2026
7228305
fix(rocprofiler-sdk): do not doorbell SDMA NOP padding before the wra…
amd-vkale Nov 12, 2026
0322062
fix(rocprofiler-sdk): skip KFD queue destroy while the engine is stil…
amd-vkale Nov 12, 2026
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
2 changes: 2 additions & 0 deletions projects/rocprofiler-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Full documentation for ROCprofiler-SDK is available at [rocm.docs.amd.com/projec

### Resolved issues

- Fixed rocpd reporting a counter at N times its value under `rocprofv3 --replay-mode kernel` when N `--pmc` groups list it, for example a sanity counter such as `SQ_WAVES` in every group. Every pass of a replayed dispatch shares the dispatch's record, so the `counters_collection` view, and the counter CSV and Perfetto output that `rocpd convert` builds from it, summed the passes. Passes after the first are now tagged with `replay_pass` in `rocpd_pmc_event.extdata`, the view averages a counter over the passes that collected it, and the `pmc_events` view reports each row's pass in a new `replay_pass` column. This behavior is identified by rocpd schema version 3.0.6.

### Known issues

### Removed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ Default ``rocpd``
The default output format is ``rocpd``. Convert with ``rocpd convert`` as described in
:ref:`using-rocpd-output-format`.

The ``counters_collection`` view, which ``rocpd convert`` uses for counter CSV and Perfetto output,
has one row per dispatch and counter. A counter repeated across groups is collected by every pass
whose group lists it, and the view reports the mean of those passes, so a sanity counter such as
``SQ_WAVES`` in every group reads the same as it does in a single pass. The individual passes stay
Comment thread
Copilot marked this conversation as resolved.
Resolved
in the database: a ``rocpd_pmc_event`` row from a pass after the first carries the pass index as
``replay_pass`` in its ``extdata`` column, and a row without it belongs to pass 0. The
``pmc_events`` view, which has one row per counter instance and pass, reports it as a
``replay_pass`` column.

The mean counts only passes that contain that counter. A replay pass dedicated to another service,
such as ATT, has no PMC row and therefore does not change the counter's denominator. For a run
without kernel replay, all PMC rows are untagged, so ``counters_collection`` retains its existing
columns and continues to report the sum across hardware instances.

What is snapshotted
===================

Expand Down
11 changes: 10 additions & 1 deletion projects/rocprofiler-sdk/source/lib/output/generateRocpd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ read_schema_file(rocpd_db& db, rocpd_sql_schema_kind_t schema_kind)
{
auto _variables = common::init_public_api_struct(rocpd_sql_schema_jinja_variables_t{});
auto _options = ROCPD_SQL_OPTIONS_NONE;
auto _version = rocpd_version_triplet_t{3, 0, 5}; // default schema version
auto _version = rocpd_version_triplet_t{3, 0, 6}; // default schema version

_variables.uuid = db.uuid.c_str();
_variables.guid = db.guid.c_str();
Expand Down Expand Up @@ -1691,6 +1691,14 @@ write_rocpd(
auto dispatch_id = info.dispatch_id;

auto evt_id = dispatch_evt_ids.at(dispatch_id);
// Every kernel-replay pass of a dispatch shares its event, so counters_collection
// needs replay_pass to average a counter collected by several passes instead of
// summing them. Pass 0 keeps the column default, so non-replay rows are unchanged;
// extdata is always bound so the insert batch keeps a single column list.
const auto extdata =
(record.replay_pass == 0)
? std::string{"{}"}
: fmt::format(R"({{"replay_pass":{}}})", record.replay_pass);
for(const auto& count : record.read())
{
get_insert_statement(db,
Expand All @@ -1700,6 +1708,7 @@ write_rocpd(
insert_value("event_id", evt_id),
insert_value("pmc_id", count.id.handle),
insert_value("value", count.value),
insert_value("extdata", extdata),
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions projects/rocprofiler-sdk/source/lib/python/rocpd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ using RocpdImportData with multiple databases, these views query across the atta
| memory_allocations | Alloc/free with type, level, agent, size, queue/stream. | Memory usage. |
| scratch_memory | Scratch-only allocations (subset of memory_allocate). | GPU scratch analysis. |
| pmc_info | PMC counter metadata. | Discover available counters. |
| pmc_events | PMC values per kernel (counter name, value, duration). | Counter time series. |
| counters_collection | Aggregated PMC per dispatch/kernel/counter (e.g. SUM of value). | Counter summaries per kernel. |
| pmc_events | PMC values per kernel (counter name, value, duration, kernel-replay pass). | Counter time series. |
| counters_collection | Aggregated PMC per dispatch/kernel/counter: instances are summed, kernel-replay passes are averaged. | Counter summaries per kernel. |
| events_args | Events with argument rows (category, arg name/value). | API or event arguments. |
| stream_args | Stream arguments with stream description. | Stream-related API analysis. |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ SELECT
K.end,
(K.end - K.start) AS duration,
PMC_I.name AS counter_name,
PMC_E.value AS counter_value
PMC_E.value AS counter_value,
-- Kernel-replay pass that collected the value. Rows without the tag are pass 0.
COALESCE(json_extract(PMC_E.extdata, '$.replay_pass'), 0) AS replay_pass
FROM
`rocpd_pmc_event` PMC_E
INNER JOIN `rocpd_info_pmc` PMC_I ON PMC_I.id = PMC_E.pmc_id
Expand Down Expand Up @@ -784,7 +786,12 @@ SELECT
PMC_I.expression,
PMC_I.value_type,
PMC_I.id AS counter_id,
SUM(PMC_E.value) AS value,
-- Kernel replay records every pass of a dispatch under the same event and tags passes after
-- the first with extdata.replay_pass. Sum the instances of each pass, then average over the
-- passes that collected the counter instead of adding the passes together.
SUM(PMC_E.value) / COUNT(
DISTINCT COALESCE(json_extract(PMC_E.extdata, '$.replay_pass'), 0)
) AS value,
Comment thread
amd-vkale marked this conversation as resolved.
Resolved
K.start,
K.end,
PMC_I.is_constant,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- RocPD schema version 3.0.5
-- RocPD schema version 3.0.6

CREATE TABLE IF NOT EXISTS
"rocpd_metadata{{uuid}}" (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ rocprofiler-sdk-rocpd:
rocpd_data_views: versions/3.0.4/data_views.sql
rocpd_summary_views: versions/3.0.4/summary_views.sql
- version: "3.0.5"
rocpd_metadata: versions/3.0.5/rocpd_metadata.sql
rocpd_tables: versions/3.0.5/rocpd_tables.sql
rocpd_views: versions/3.0.5/rocpd_views.sql
rocpd_indexes: versions/3.0.5/rocpd_indexes.sql
rocpd_data_views: versions/3.0.5/data_views.sql
rocpd_summary_views: versions/3.0.5/summary_views.sql
- version: "3.0.6"
rocpd_metadata: rocpd_metadata.sql
rocpd_tables: rocpd_tables.sql
rocpd_views: rocpd_views.sql
Expand Down Expand Up @@ -74,3 +81,8 @@ rocprofiler-sdk-rocpd:
# - SPM location dimensions not provided for a counter are stored as NULL.
# instance is always set on a location row
# - spm_counters view reads those fields from rocpd_info_pmc

# Version 3.0.6
# - Kernel-replay passes after the first tag their rocpd_pmc_event rows with replay_pass in extdata
# - counters_collection averages a counter over the passes that collected it instead of summing them
# - pmc_events reports the kernel-replay pass in a replay_pass column
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
#
#

set(rocpd_schemas data_views.sql rocpd_indexes.sql rocpd_metadata.sql rocpd_tables.sql
rocpd_views.sql summary_views.sql)

rocpd_configure_schema_files(VERSION "3.0.5" FILES ${rocpd_schemas})
Loading
Loading