[rocprof-compute] Adding Triton backend to marker injection#6901
Open
ggottipa-amd wants to merge 37 commits into
Open
[rocprof-compute] Adding Triton backend to marker injection#6901ggottipa-amd wants to merge 37 commits into
ggottipa-amd wants to merge 37 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends rocprofiler-compute’s ROCTX marker injection and analysis pipeline to support a Triton backend alongside the existing PyTorch backend, adding new CLI flags, backend-aware operator filtering/listing, and shared Python-tier ROCTX initialization.
Changes:
- Add Triton tracing/profile CLI support (
--triton-trace) and analysis CLI support (--list-triton-operators,--triton-operator) with updated docs. - Implement and test a hardened Triton ROCTX injection backend that wraps Triton kernel launch entry points and attributes markers to a
Backendcolumn. - Generalize analyze-side operator selection/listing to be backend-aware (torch vs triton), including per-backend matched trace storage.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/rocprofiler-compute/tests/test_utils.py | Adds tests for backend-aware operator pattern parsing and backend filtering in analysis CLI. |
| projects/rocprofiler-compute/tests/test_profiler_base.py | Adds tests validating CLI framework selection and subprocess env var construction. |
| projects/rocprofiler-compute/tests/test_inject_roctx_module.py | Adds Triton backend unit tests (wrapping behavior, reentrancy guard, python-tier handling, kernel name extraction). |
| projects/rocprofiler-compute/src/utils/tty.py | Generalizes operator listing output to support a configurable framework label (PyTorch/Triton). |
| projects/rocprofiler-compute/src/utils/schema.py | Extends Workload to store matched API-trace rows per backend. |
| projects/rocprofiler-compute/src/utils/inject_roctx/_core.py | Introduces shared Python-tier ROCTX initialization (ensure_python_tier) and candidate path tracking. |
| projects/rocprofiler-compute/src/utils/inject_roctx/_backends/_triton.py | Adds/extends Triton backend wrapping logic for kernel launches and framework-root registration. |
| projects/rocprofiler-compute/src/utils/inject_roctx/_backends/_torch.py | Switches torch backend to use shared Python-tier initialization and shared candidate-path reporting. |
| projects/rocprofiler-compute/src/rocprof_compute_profile/profiler_base.py | Adds Triton framework selection mapping for ROCTX injection env var. |
| projects/rocprofiler-compute/src/rocprof_compute_analyze/analysis_cli.py | Refactors operator list/filter flow to be backend-aware and adds backend filtering on consolidated API traces. |
| projects/rocprofiler-compute/src/argparser.py | Adds CLI flags for Triton tracing and Triton operator listing/filtering. |
| projects/rocprofiler-compute/docs/how-to/profile/mode.rst | Documents Triton trace usage, requirements, and relationship to ROCTX frameworks env var. |
| projects/rocprofiler-compute/docs/how-to/analyze/cli.rst | Documents Triton operator analysis and its CLI usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
baf2456 to
de095d3
Compare
f2d20b8 to
50aabb3
Compare
c4ac4c9 to
46559c0
Compare
61a6658 to
81ee094
Compare
657626d to
7007129
Compare
a88ff64 to
6a8df5c
Compare
bff659e to
b0b3164
Compare
b72859d to
ab4f20e
Compare
Base automatically changed from
users/ggottipa-amd/inject-roctx-multi-framework
to
rocprofiler-compute-develop
June 22, 2026 18:03
47add6b to
41d52a1
Compare
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: Pratik Basyal <pratik.basyal@amd.com>
Co-authored-by: cfallows-amd <Carrie.Fallows@amd.com>
Co-authored-by: cfallows-amd <Carrie.Fallows@amd.com>
066804e to
491b779
Compare
cfallows-amd
approved these changes
Jun 29, 2026
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
This PR enables operator tracing for Triton workloads.
Technical Details
--triton-trace(and--ml-api-tracefor all backends) for profiling and--list-triton-operators/--triton-operatorfor analysis, driven by a shared backend registry.tests/workloads/triton_trace/MI300Aandtests/workloads/ml_api_trace/MI300A, so the per-backend analyze tests run CPU-only in CI.JIRA ID
AIPROFCOMP-635
Test Plan
Triton backend unit tests (wrapping, reentrancy dedup, kernel-name, percent-encode round trip)
ctest -R test_inject_roctx_packageFramework selection (flag -> backend, env var)
ctest -R test_profiler_baseAnalyze: per-backend operator filtering
ctest -R test_analyze_workloadsUtils: operator pattern parsing
ctest -R test_utilsC++ gtests: percent-encode + round-trip decode
ctest -R test-roctx-recordfnEnd-to-end Triton profile + analyze (requires GPU + Triton)
ctest -R test_profile_triton_traceTest Result
Tests Pass
Submission Checklist