Skip to content

[rocprofiler-sdk] : support SPM reference-clock sample intervals - #12213

Merged
venkat1361 merged 6 commits into
developfrom
users/sauverma/spm-refclk
Oct 14, 2026
Merged

venkat1361 merged 6 commits into
developfrom
users/sauverma/spm-refclk

Conversation

@sauverma93

@sauverma93 sauverma93 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

SPM sample intervals were always programmed in shader-clock cycles. aqlprofile already exposes a reference-clock sampling mode on gfx1250, and rocprofv3 had no way to select it.

Technical Details

  • Add ROCPROFILER_SPM_PARAMETER_TYPE_SAMPLE_INTERVAL_REFCLK_CYCLES.
  • Plumb --spm-sample-interval-unit refclk_cycles from rocprofv3 through the tool configuration into the aqlprofile SAMPLE_MODE parameter.
  • Agent configuration queries report shader-clock and reference-clock intervals separately, using the aqlprofile interval mode.
  • Reference-clock intervals are gfx1250-only. rocprofiler_spm_create_counter_config returns ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENT on other agents, and the configuration query does not advertise a reference-clock interval there.

Issue Tracking

ISSUE ID: AIPROFSDK-1151

Test Plan

  • spm_core.query_agent_configurations: shader-clock minimum is 1 on gfx1250 and 32 on other SPM architectures. A reference-clock interval with minimum 1 is present only on gfx1250.
  • rocprofv3-test-spm-refclk-json-execute: run simple-transpose with --spm-sample-interval-unit refclk_cycles and write a JSON profile.
  • rocprofv3-test-spm-refclk-json-validate: compare that JSON with a normal PMC run, the same way as the shader-clock SPM test.
  • On a non-gfx1250 agent, requesting refclk_cycles fails before the run is configured.

Test Result

Local unit test spm_core.query_agent_configurations passed. rocprofv3 --help lists --spm-sample-interval-unit {sclk_cycles,refclk_cycles}. Validated on gfx1250: a refclk_cycles SPM run produces samples.

Submission Checklist

@github-actions github-actions Bot added documentation Improvements or additions to documentation project: rocprofiler-sdk labels Sep 24, 2026
Base automatically changed from users/bingma/gfx12-spm-support-aqlprofile to develop September 24, 2026 20:07
@therock-pr-bot

therock-pr-bot Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/rocprofiler-sdk/source/bin/rocprofv3.py, projects/rocprofiler-sdk/source/include/rocprofiler-sdk/experimental/spm.h, projects/rocprofiler-sdk/source/lib/python/rocprofv3/avail.py, projects/rocprofiler-sdk/source/lib/rocprofiler-sdk-tool/config.cpp, projects/rocprofiler-sdk/source/lib/rocprofiler-sdk-tool/tool.cpp (+4 more); no test file found
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@sauverma93
sauverma93 force-pushed the users/sauverma/spm-refclk branch from 4c28358 to e6618f6 Compare September 28, 2026 14:55
@sauverma93
sauverma93 changed the base branch from develop to users/sauverma/spm-sa-wgp September 29, 2026 08:01
@sauverma93
sauverma93 force-pushed the users/sauverma/spm-refclk branch from e6618f6 to ab4e0a2 Compare September 29, 2026 08:01
@sauverma93
sauverma93 changed the base branch from users/sauverma/spm-sa-wgp to develop September 29, 2026 08:08
@sauverma93
sauverma93 changed the base branch from develop to users/sauverma/spm-sa-wgp September 29, 2026 08:08
@sauverma93
sauverma93 added this pull request to stack #12455 September 29, 2026 08:13
@sauverma93
sauverma93 marked this pull request as ready for review September 29, 2026 11:33
@sauverma93
sauverma93 requested review from a team as code owners September 29, 2026 11:33
@sauverma93 sauverma93 changed the title support SPM reference-clock sample intervals [rocprofiler-sdk] : support SPM reference-clock sample intervals Sep 29, 2026
@sauverma93
sauverma93 force-pushed the users/sauverma/spm-refclk branch 2 times, most recently from 4210e82 to c9a890b Compare October 10, 2026 12:43
@sauverma93
sauverma93 force-pushed the users/sauverma/spm-refclk branch 5 times, most recently from 8b85083 to f40cf2c Compare October 12, 2026 16:41

@SrirakshaNag SrirakshaNag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please address the comment on docs

@bing-ma bing-ma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please fix the minor doc issue that Sriraksha pointed out around the rocprofv3-avail command wording.

@sauverma93
sauverma93 force-pushed the users/sauverma/spm-refclk branch 2 times, most recently from b2828e8 to a7655f8 Compare October 12, 2026 20:42

@bing-ma bing-ma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me.

@sauverma93
sauverma93 force-pushed the users/sauverma/spm-refclk branch 2 times, most recently from 324c226 to 2bcc85d Compare October 13, 2026 13:08
Base automatically changed from users/sauverma/spm-sa-wgp to develop October 13, 2026 17:02
SPM sample intervals were always programmed in shader-clock cycles even
though aqlprofile exposes a reference-clock sampling mode on gfx1250.

Add ROCPROFILER_SPM_PARAMETER_TYPE_SAMPLE_INTERVAL_REFCLK_CYCLES and
plumb it from the rocprofv3 --spm-sample-interval-unit refclk_cycles
option through the tool configuration into the aqlprofile SAMPLE_MODE
parameter. Agent configuration queries now distinguish the two clocks by
the aqlprofile interval mode instead of reporting every interval as
SCLK.

Reference-clock intervals are restricted to gfx1250:
rocprofiler_spm_create_counter_config rejects them with
ROCPROFILER_STATUS_ERROR_INVALID_ARGUMENT on other agents, and the
configuration query does not advertise REFCLK there, so rocprofv3 fails
before configuring a run.

Extend the query unit test to assert per-architecture interval ranges
and REFCLK availability, add a gfx1250-only rocprofv3 refclk integration
test, and document the new unit in the SPM how-to guide.
@sauverma93
sauverma93 force-pushed the users/sauverma/spm-refclk branch from 2bcc85d to 88e40bf Compare October 13, 2026 17:02
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage Report

Code Coverage Report

Tests Only

code coverage tests.png

Samples Only

code coverage samples.png

Tests + Samples

code coverage all.png

@venkat1361
venkat1361 merged commit 88e4b84 into develop Oct 14, 2026
366 of 384 checks passed
@venkat1361
venkat1361 deleted the users/sauverma/spm-refclk branch October 14, 2026 01:44
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation organization: ROCm project: rocprofiler-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants