Repository navigation
[rocprofiler-sdk] : report SPM shader array and WGP dimensions - #12212
Merged
Merged
Conversation
Base automatically changed from
users/bingma/gfx12-spm-support-aqlprofile
to
develop
September 24, 2026 20:07
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🚫 Please fix the failed policies before requesting reviews. The following policy checks failed:
The |
sauverma93
force-pushed
the
users/sauverma/spm-sa-wgp
branch
from
September 28, 2026 14:55
5df993f to
7782227
Compare
sauverma93
marked this pull request as ready for review
September 29, 2026 11:34
SrirakshaNag
requested changes
Sep 30, 2026
sauverma93
force-pushed
the
users/sauverma/spm-sa-wgp
branch
2 times, most recently
from
October 10, 2026 10:10
68c538e to
68f3d6b
Compare
sauverma93
force-pushed
the
users/sauverma/spm-sa-wgp
branch
from
October 12, 2026 05:14
6747cda to
d1d6f1f
Compare
1 of 7 tasks
sauverma93
force-pushed
the
users/sauverma/spm-sa-wgp
branch
2 times, most recently
from
October 12, 2026 16:41
c542317 to
3c3933f
Compare
SrirakshaNag
approved these changes
Oct 12, 2026
SrirakshaNag
left a comment
Contributor
There was a problem hiding this comment.
Please address the one comment and with that addressed it looks good to me
bing-ma
requested changes
Oct 12, 2026
bing-ma
left a comment
Contributor
There was a problem hiding this comment.
I second Sriraksha’s latest comment. spm/tests/device_counting.cpp looks stale relative to the current support expansion.
sauverma93
force-pushed
the
users/sauverma/spm-sa-wgp
branch
2 times, most recently
from
October 12, 2026 20:42
1247347 to
d0ef6ea
Compare
Contributor
sauverma93
force-pushed
the
users/sauverma/spm-sa-wgp
branch
from
October 13, 2026 00:40
d0ef6ea to
fbe5ecf
Compare
gfx1250 SPM samples deliver a packed shader_engine value (wgp << 24 | sa << 16 | se) rather than a plain shader-engine index, so the SDK decode path reported packed values as shader engines and dropped the shader-array and WGP topology entirely. Decode the value with aqlprofile_spm_decode_shader_engine(), carry the shader array and WGP on spm_sample_t, and encode both into the counter instance id alongside XCC, shader engine, and instance. The dimensions are persisted as shader_array and wgp columns on rocpd_pmc_event, exposed through the spm_counters view, and included in the rocpd CSV counter name as counter_name[XCC:, Instance:, SE:, SA:, WGP:]. Agents without packed topology decode to shader array 0 and WGP 0; global samples leave both dimensions unset. Lift the aqlprofile gfx1250 SPM event-support gate and enable the SPM test suite for gfx1250 now that the SDK consumes the packed encoding. Add a spm_core unit test covering packed, shader-engine-only, and global decode, and extend the rocprofv3 SPM rocpd validation to assert the new columns and the CSV counter-name format.
The shared GFX12 id is supported in aqlprofile, and the SPM tests run on those GPUs alongside gfx1250.
sauverma93
force-pushed
the
users/sauverma/spm-sa-wgp
branch
from
October 13, 2026 13:08
fbe5ecf to
c8b1bfd
Compare
venkat1361
added a commit
that referenced
this pull request
Oct 14, 2026
…d_info_pmc. (#12913) ## Summary rocPD layout for SPM shader array (SA) and workgroup processor (WGP). The rocPD changes live in this pull request. #12212 decodes the dimensions and does not change rocPD. gfx1250 SPM samples pack those dimensions into `shader_engine` as `(wgp << 24) | (sa << 16) | se`. #12212 decodes that into a shader engine, a shader array, and a WGP, and carries them with XCC and instance on the SPM sample and the counter instance id. A decoded 0 is a real index when the counter has that dimension. A dimension the counter does not have is stored as NULL, not 0. See Absent location dimensions. Those five fields are the counter location. Schema 3.0.4 already stores XCC, shader engine, and instance on every `rocpd_pmc_event` row. 3.0.4 is also the schema that added HIP event records, so released 3.0.4 databases have to keep loading unchanged. SA and WGP therefore need a new schema. This pull request bumps the schema to 3.0.5 and stores the location on `rocpd_info_pmc`, one pmc id per counter location. `rocpd_pmc_event` keeps the sample id, that pmc id, and the value. An earlier version of #12212 wrote `shader_array` and `wgp` on `rocpd_pmc_event`; that change was removed from #12212, and this pull request does not put it back. #12655 is the other layout: it leaves the location on `rocpd_pmc_event` and adds `shader_array` and `wgp` there. The sample table stays free of hardware-location columns, so a later GPU can add a location field without widening every sample row. The branch is based on `users/sauverma/spm-sa-wgp` (#12212). The diff against that branch is the 3.0.5 layout. ## Technical Details - Register rocPD schema 3.0.5 and point it at the live SQL files. - Freeze the released 3.0.4 SQL under `versions/3.0.4/` and point the 3.0.4 entry there. That snapshot still has `xcc`, `shader_engine`, and `instance` on `rocpd_pmc_event`, and it does not have `shader_array` or `wgp`. - `rocpd_info_pmc` gains `xcc`, `shader_engine`, `shader_array`, `wgp`, and `instance`. The existing `instance_id` column is unchanged. The SPM instance is the new `instance` column. - The original counter row stays, with those five columns null. An ordinary PMC record still points at that row. - Each agent, counter, and location gets its own `rocpd_info_pmc` row. Later samples of the same key reuse that pmc id. See Location keys and pmc ids. - `rocpd_pmc_event` no longer has the location columns. Each SPM sample stores `sample_id`, the location's `pmc_id`, and the value. - The `spm_counters` view reads the location from `rocpd_info_pmc`. - rocprofv3 writes schema 3.0.5 by default. - CSV conversion checks the database schema through the `spm_counter_location` feature, which starts at 3.0.5: - 3.0.5 and newer: `counter_name[XCC:, Instance:, SE:, SA:, WGP:]`. - 3.0.4 and older: `counter_name[XCC:, SE:, Instance:]`. The query does not reference `shader_array` or `wgp`. - rocPD backward-compatibility tests cover 3.0.0 through 3.0.5. SA and WGP are absent from CSV counter names before 3.0.5 and present from 3.0.5. The rocprofv3 SPM rocpd check requires the five location columns on `rocpd_info_pmc` and requires them to be absent from `rocpd_pmc_event`. - The bump is noted in `versions.yml` and the changelog. ## Location keys and pmc ids An SPM location row is keyed by the sample's GPU agent, the counter id, and five location dimensions: XCC, shader engine, shader array, WGP, and instance. A dimension is part of the key only when that counter's dimension list on that agent contains it. The stored value is then the decoded index, and 0 is a real index. A dimension the counter does not provide stays absent in the key and is written as SQL `NULL`. The same counter and numeric location on two GPUs are different keys, and the row keeps the metadata of the sample's agent. New location pmc ids start at `0x7100000000000000` and increase by one for each new key. KFD event rows start at `0x7000000000000000` and increase from there, skipping ids already in use. The location range begins `0x0100000000000000` above the KFD start, so a location id does not collide with a KFD row or with an ordinary counter id. `0x7100000000000000` also fits in a signed 64-bit integer. ## Absent location dimensions A dimension the counter does not have is SQL `NULL` in rocPD and blank in the CSV name. A dimension the counter has is stored even when the index is 0. Presence comes from that counter's dimension list on the agent. It is not inferred from the architecture name, and a decoded 0 is not treated as missing. A gfx942 `SQ_CYCLES` sample on shader engine 2 has an XCC and a shader engine. It does not have a shader array or a WGP. - rocPD: `xcc = 0`, `shader_engine = 2`, `shader_array = NULL`, `wgp = NULL`, `instance = 0` - CSV: `SQ_CYCLES[XCC: 0, Instance: 0, SE: 2, SA: , WGP: ]` A gfx1200 `SQ_WAVES` sample at shader array 1 and WGP 2 has one XCC, so XCC is absent. Shader engine, shader array, and WGP are present, including shader engine 0. - rocPD: `xcc = NULL`, `shader_engine = 0`, `shader_array = 1`, `wgp = 2`, `instance = 0` - CSV: `SQ_WAVES[XCC: , Instance: 0, SE: 0, SA: 1, WGP: 2]` A global counter such as `TCC_HIT` has no shader engine, shader array, or WGP. - rocPD: `shader_engine = NULL`, `shader_array = NULL`, `wgp = NULL` - CSV: `TCC_HIT[XCC: 0, Instance: 0, SE: , SA: , WGP: ]` The base counter row still leaves all five location columns `NULL`. A location whose dimension is `NULL` and a location whose same dimension is 0 get different pmc ids. ## Issue Tracking AIPROFSDK-1151 ## Test Plan - [ ] rocPD back-compat tests for 3.0.0 through 3.0.5: SA and WGP absent before 3.0.5, present from 3.0.5 - [ ] A new database has the location columns on `rocpd_info_pmc` and not on `rocpd_pmc_event` - [ ] Repeated samples of one location share one pmc id - [ ] An ordinary PMC record still uses the base counter row - [ ] An older 3.0.3 or 3.0.4 database still converts with the previous counter name - [ ] A dimension the counter does not have is NULL in rocPD and blank in the CSV name, and a real index of 0 stays 0 ## Test Result The 3.0.5 table SQL loads in SQLite. Back-compat ctests and an on-hardware SPM run have not been executed. Row counts and write and query cost are not measured yet. ## Submission Checklist - [x] Look over the contributing guidelines at https://github.com/ROCm/rocm-systems/blob/develop/CONTRIBUTING.md. --------- Co-authored-by: Venkateshwar Reddy Kandula <Venkateshwarreddy.Kandula@amd.com>
6 of 8 tasks
Contributor
TheRock Submodule Bump ActivityNewest first
|
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Motivation
gfx1250 SPM samples deliver shader-engine topology as one packed integer,
(wgp << 24) | (sa << 16) | se. The SDK decode path treated that integer as a shader-engine index and dropped the shader array and workgroup processor.Technical Details
aqlprofile_spm_decode_shader_engine()and store shader array and workgroup processor on the SPM sample.Issue Tracking
ISSUE ID: AIPROFSDK-1151
Test Plan
spm_core.decode_shader_topology: packed(wgp=2, sa=1, se=3), plain shader engine4(shader array 0, workgroup processor 0), and global-1.Test Result
Local unit test
spm_core.decode_shader_topologypassed. Validated on gfx1250: decoded shader-array and workgroup-processor values are reported, and the existing SPM rocpd and JSON tests pass.Submission Checklist
gfx1250 follow-up
Three existing SPM integration tests fail on gfx1250. The JSON tool requests two TA counters, and
validate.pyrequires both, but gfx1250 has no metric definition for them, so they never appear in the samples. This will be addressed in a later PR.tests.integration.validate.test-spm-dispatch-collection-validate.test_spm_counter_valuestests.integration.validate.test-spm-dispatch-collection-validate.test_spm_counter_consistencytests.integration.validate.test-spm-dispatch-buffer-collection-validate.test_spm_counter_valuesTA_TA_BUSYTA_TOTAL_WAVEFRONTSgfx1250 does not reuse the gfx1201 event numbers.
SQC_ICACHE_REQis event 301 on gfx1201 and event 641 on gfx1250, so a gfx1250TA_TA_BUSYneeds its own TA event ID from the MI450 docs.These three counters were collected and are not the problem:
SQC_ICACHE_REQ,SQC_ICACHE_HITS,SQC_ICACHE_MISSES.