Commit Graph

838 Commitit

Tekijä SHA1 Viesti Päivämäärä
Welton, Benjamin b5e1645a14 Fix hsa_code_object_app test deadlock with profiler serialization (#577)
Problem with original test:
- Created circular dependencies between queues:
  * Queue1: Kernel A → Barrier(waits for signal_2) → Kernel C
  * Queue2: Barrier(waits for signal_1) → Kernel B → sets signal_2
- With strict "one kernel at a time" serialization, this created deadlock:
  * Queue1 executed Kernel A, then blocked on barrier waiting for signal_2
  * Serializer switched to Queue2, but Queue2 was blocked waiting for signal_1
  * Neither queue could proceed: Queue1 needed Queue2's Kernel B to complete,
    but Queue2 couldn't start until Queue1 finished completely
- Test would hang indefinitely at hsa_signal_wait_relaxed() for signal_2

Solution implemented:
- Reordered packet submission to eliminate circular dependencies
- Ensured signal producers execute before consumers need them:
  * Kernel A produces signal_1 before Queue2's barrier needs it
  * Kernel B produces signal_2 before Queue1's continuation needs it
- Dependencies now flow forward without cycles, allowing serializer progress

Refactoring changes:
- Extract common functionality into helper functions:
  * create_completion_signal() for signal creation
  * create_queue() for queue creation
  * submit_kernel_packet() for kernel dispatch packets
  * submit_barrier_packet() for barrier packets
- Add comprehensive documentation explaining expected execution pattern
- Simplify main() function making the dependency flow more readable

Co-authored-by: Benjamin Welton <bewelton@amd.com>
2025-08-05 17:29:07 -07:00
Kandula, Venkateshwar reddy 6918af0dd6 [CI] fix RHEL requirements issue (#563)
* use gcc/g++ from /opt/rh/
2025-08-05 15:47:47 -05:00
Bhardwaj, Gopesh 5f422c1993 Fix missing include file in rocJPEG test app (#525)
- Fixes compilation error for rocJPEG test app
- SWDEV-544094
2025-08-05 11:50:01 -05:00
Baraldi, Giovanni 54161f54fe Update readme for aqlprofile (#570)
* Update readme for aqlprofile

* Apply suggestions from code review

Co-authored-by: Rawat, Swati <Swati.Rawat@amd.com>

---------

Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>
Co-authored-by: Rawat, Swati <Swati.Rawat@amd.com>
2025-08-05 11:11:40 -05:00
U, Srihari fc3eb4211d [SDK] Fix data race by syncing emplace and flush operations. (#529)
* Fix data race by syncing reader and writer

* Address review comments
2025-08-05 11:07:00 -05:00
Radosavljevic, Milan e3206c8a29 Include installation sql header in rocpd library (#576)
Include installation of rocpd sql header
2025-08-05 11:04:09 -05:00
Rawat, Swati ca9905d6bb Update CHANGELOG.md (#557)
* Update CHANGELOG.md

* some more updates

---------

Co-authored-by: srawat <120587655+SwRaw@users.noreply.github.com>
2025-08-05 10:29:42 -05:00
Baraldi, Giovanni fd6f96ffb5 Adding GPU index as a parameter for ATT (#547)
* Adding GPU index as a parameter for ATT

* Tidy fix

* Using tokenize

* Update tests/rocprofv3/advanced-thread-trace/CMakeLists.txt

Co-authored-by: Indic, Vladimir <Vladimir.Indic@amd.com>

* Update tests/rocprofv3/advanced-thread-trace/CMakeLists.txt

* Adding error logging. Using idx instead of id.

---------

Co-authored-by: Giovanni <gbaraldi@amd.com>
Co-authored-by: Indic, Vladimir <Vladimir.Indic@amd.com>
2025-08-04 23:15:50 +02:00
Trowbridge, Ian 533a8329d8 Revert memory allocation CSV output file header and update tests (#532)
* Reverted header and field location for csv memory allocation and updated tests

* Updated example csv file and made small update
2025-08-04 13:22:27 -05:00
U, Srihari 7251cea0bc Fix rocpd kernel traces csv output (#497)
* Fix rocpd kernel traces csv

* Updated CHANGELOG.md

* Add guid header

* address comment.

* Fix test failures

---------

Co-authored-by: Srihari Uttanur <srihariu@amd.com>
2025-08-01 08:31:21 +05:30
Vaddireddy, Sushma a1e2905559 Adding MI100 counters (#501)
* Enable MI100 counters

* Update counter_defs.yaml

* Adding MI100 counters to tests

* Added TCC counters

---------

Co-authored-by: Sushma Vaddireddy <svaddire@amd.com>
2025-07-31 13:36:25 -07:00
Kandula, Venkateshwar reddy e0901eba28 [Samples] Remove thread trace sample dependency on rocprofiler-sdk-amd-comgr. (#555)
* remove samples dependency on rocprofiler-sdk-amd-comgr.

* add find package for amd_comgr.

---------

Co-authored-by: Venkateshwar Reddy Kandula <vkandula@amd.com>
2025-07-31 10:24:32 -05:00
Bonnell, Jason fbe0f65beb use new azure runners (#533)
* use new azure runners

* update core-deb logic in continuous_integration.yml

* more logic changes in continuous_integration.yml

* changes to runs-on conditional in continuous_integration.yml

* update runs-on conditional again on continuous_integration.yml

* utulize matrix system list, add gpu variable and separate runner

* Remove trailing comma from matrix

* Delete .github/workflows/generate_afar.yml

---------

Co-authored-by: Kandula, Venkateshwar reddy <Venkateshwarreddy.Kandula@amd.com>
Co-authored-by: Elwazir, Ammar <Ammar.Elwazir@amd.com>
2025-07-30 14:40:47 -05:00
Bhardwaj, Gopesh 4120c12ed5 SWDEV-544115 Adding documentation for rocprofv3 advanced options (#516)
* SWDEV-544115 Adding documentaiton for rocprofv3 advanced options

* minor changes

* updating rocpd documentation

* updated changelog

* adressed Feedback
2025-07-30 22:25:40 +05:30
Baraldi, Giovanni 1ba08cd4df Removing ATT buffer size limitation (#534)
* Removing SQTT buffer size limitation

* Update source/lib/rocprofiler-sdk/thread_trace/core.cpp

* Added testing for buffer size. Formatting.

* Add test as unstable

* Increase default buffer size

* Apply suggestions from code review

Co-authored-by: Indic, Vladimir <Vladimir.Indic@amd.com>

* Fix typo from code review

* Update tests/thread-trace/agent.cpp

---------

Co-authored-by: Giovanni <gbaraldi@amd.com>
Co-authored-by: Indic, Vladimir <Vladimir.Indic@amd.com>
2025-07-29 22:47:40 +02:00
Indic, Vladimir 2d8936362e PCS test: cast agent name to str (#546)
* PCS test: cast agent name to str
2025-07-29 12:11:15 -07:00
Hui, Young 3954cedd25 [rocpd] Adding summary module to generate summaries from rocpd database + query submodule + rocpd command-line tools (#488)
* adding summary.py to generate tmp <category_region>_summary views

* migrating CSV summary to SDK method of writing CSVs

  - Add domain_view to summary.py
  - omit the C++ code of writing CSV because it gets revered later anyway

* Add summary subparser and write_sql_view_to_csv function

* adding all <>_summary views generation to summary.py

* add summary_per_rank feature

* add --summary-per-rank

* reconstruct generate_summary_view and create_domain_view

-introduce by_rank

* remove sqr and variance in summary views

* use RocpdImportData instead of connection

* two fixes on summary.py

--modify the generate_summary_view function to return a tuple with view name and sql code

add if_not_exits parameter to generete_summary_view

* Refactor summary.py to allow output path and filename args, and apply time_window
- clean up summary table column headers
- only generate by-rank views if that param is specified

* Add ProcessID to Hostname output and csv, so users can identify the system in the by-rank summaries

* Summary.py, just add hostname to by-rank summaries, instead of creating mapping table

* Summary - migrate csv writer to pandas, for more future flexibility

* Adding a few simple tests for summary.py

* Linting fixes

* add region_categories to summary options

  -  Automatically retrieve region categories from the database if argument is None

* add backticks for view_names

* fix tests after rebase

* Made code review changes
- fixed whitespace in CMakelists.txt
- adding query.py module & subparser in __main__.py
- refactor summary function to return query
- used query.py to output csv
- used query.py to also output summary to console
- provided new command line options to select summary output to csv or console

* Made fix to jinja template in query.py, as suggested by copilot

* Consolidated output calls to query in export_view function based on feedback
- refactored: helpers, query functions, create view functions
- extended formats to include what query supports (md, html, pdf, json)
- added json format to query, and changed orient=records
- adding jinja2 and reportlab to requirements.txt

* Add version_info for rocpd and roctx

* Add rocpd commandline tool

* Add executable permissions to source/bin/rocpd.py

* Removed rocpd2query, and cleaned up --help examples

---------

Co-authored-by: acanadas <acanadas@amd.com>
Co-authored-by: Jin Tao <jintao12@amd.com>
Co-authored-by: a-canadasruiz <Araceli.CanadasRuiz@amd.com>
Co-authored-by: Jonathan R. Madsen <Jonathan.Madsen@amd.com>
2025-07-24 16:12:06 -05:00
Madsen, Jonathan 735b5c3d4a [CMake] Fix thread trace sample ENVIRONMENT test property (#544)
Fix thread trace samples set tests properties
2025-07-24 15:23:37 -05:00
U, Srihari 3a36fd13fe [rocprofv3] rocpd doesn't generate output files for counter collection (#480)
* Fix kernel dispatch for counter collection

* Updated change log

* Fix format

* rename output csv file

* Fix warnings

* Address review comment

* Address final review comment
2025-07-24 12:11:36 +05:30
Kuricheti, Mythreya 2c7f260e62 [SDK] Fix context tracing domain bitset overflow (#536)
- Fix context tracing domain bitset overflow
- Previous behavior would enable all flags above ROCPROFILER_BUFFER_TRACING_MARKER_CORE_RANGE_API when this domain was enabled.
2025-07-23 15:52:52 -05:00
Baraldi, Giovanni e898079a13 Thread trace and Trace Decoder API tests and samples (#416)
* Adding test and samples to decoder

* Fix sample

* Formatting

* Fix multi test

* Disable sample

* Fix tests

* Format

* Version fix

* Locking the decoder

* Add atomic

* Review comments

* Format

* Adding readme

* merge conflict and adding PCS+ATT test

* Review comments

* Properly disable PCS test

* Update tests/rocprofv3/advanced-thread-trace/CMakeLists.txt

* Adding back env var test

* Name fix

* Preload sample

* Addressing review comments

* Update docs

---------

Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>
2025-07-22 20:08:12 -05:00
Kandula, Venkateshwar reddy bf0fad1d54 [SDK] Expose counter dims in rocprofiler_counter_info_v1_t and only show counters being profiled in metadata. (#325)
* expose dimensional info in rocprofiler_counter_info_v1_t.

* add counter_id in dim info.

* address review comments

* format.

* address comments.

* use array of pointers for dimensions_instaces.

* format and comments.

* address comments.

* new line.

* Update counter_defs.yaml

* Update counter_defs.yaml

* Update counter_defs.yaml

* counter_defs.

* format counter defs.

* format counter defs.

* format counter defs.

* show only counters being profiled in metadata.

* Format.

* use config for counters and fix warnings.

* add version for rocprofiler_counter_dimension_info_v1_t struct.

* rename rocprofiler_counter_record_dimension_instance_v1_info_t.

* account device id from pmc for counters metadata.

* move dim structs to counters.h.

* address comments to compare value.

* fix tests.

* Address comments. use pointer of arrays for ABI.

* rebase.

* fix build error.

* use separate metadata::init() for rocprofv3.

* also print not found counters.

* precompute all the perf counters needed to be in metadata.

* Misc.

* format

* Format.

* rocprofiler::sdk::container::c_array

* Address comments.

* source/lib/output/metadata.cpp

* lint.

* add unit test for c_array.

* add unit test and serialization support for c_array container.

* Misc.

* Clean files.

* Format.

* clang-tidy.

* add more checks to c_array.

* misc. typo

* Addr comments.

---------

Co-authored-by: Venkateshwar Reddy Kandula <vkandula@amd.com>
Co-authored-by: Jonathan R. Madsen <Jonathan.Madsen@amd.com>
2025-07-22 14:24:25 -07:00
Gill, Harkirat e948034c83 Update output file fields docs to correctly define Grid_Size (#526)
Co-authored-by: Bhardwaj, Gopesh <Gopesh.Bhardwaj@amd.com>
2025-07-22 23:16:01 +05:30
Nagaraj, Sriraksha 2447a85215 [rocprofv3-avail] - Add sample data (#514)
* Add sample data for avail and remove color code for non terminal output

* review comments

* review comments

* add documentation

* test fix
2025-07-22 08:39:59 -07:00
Indic, Vladimir 57bfd0f607 MI350 stochastic support in changelog (#530) 2025-07-22 08:39:22 -07:00
Baraldi, Giovanni be74e1b49f Adding inline callstack information to disassembly (#468)
* Adding callstack information to disassembly

* changelog

* Cleanup

* Fix snapshots.json

* Clang tidy fixes

* Fix infinite recursion

* Apply suggestions from code review

Co-authored-by: Indic, Vladimir <Vladimir.Indic@amd.com>

* Remove sibling transversal

* Added docstrings

* Apply suggestions from code review

* Update source/include/rocprofiler-sdk/cxx/codeobj/code_printing.hpp

* Review comments

* Format + comments

* Fmt

* Add class name

* Format

* Fix static linkage

* Making funcs inline

---------

Co-authored-by: Giovanni <gbaraldi@amd.com>
Co-authored-by: Indic, Vladimir <Vladimir.Indic@amd.com>
2025-07-22 15:52:42 +02:00
Indic, Vladimir de4708963e [Stochastic PC Sampling][GFX9] Increasing ROCr buffer to 4MBs. (#487)
Increasing ROCr buffer to 4MBs.
2025-07-18 12:06:17 -05:00
Madsen, Jonathan 4d6a61f5e5 [SDK] Fix null handles (#474)
* Fix null handle

- use .handle=0, not .handle=numeric_limits<>::max()

* Update lib.common.hasher

* Fix ROCPROFILER_CONTEXT_NONE

* Use context operator==

* Update CHANGELOG

* Updated null handle for scratch memory and changed allocation test so that free ops account for null agent

---------

Co-authored-by: Ian Trowbridge <Ian.Trowbridge@amd.com>
2025-07-18 12:05:52 -05:00
Nagaraj, Sriraksha fcfb5bd918 [SDK] Update UUID (rocprofiler_uuid_t) (#390)
* changing uuid abi

* fix

* review comments

* fix CI fail

* review comments

* fix

* adding static asserts

* making constructor constexpr

* fix CI fail

* upadate UUID length to 16 bytes

* fixing value64

Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>

* Update CHANGELOG.md

Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>

---------

Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>
2025-07-18 11:24:48 -05:00
Bonnell, Jason f4cce0d2d4 replace azure runners with internal (#518)
* replace azure runners with internal

* change to mi300a for debug

* revert back to mi300

* move some of the load to mi300a

* use mi300a for clang-tidy

---------

Co-authored-by: Kandula, Venkateshwar reddy <Venkateshwarreddy.Kandula@amd.com>
2025-07-17 18:09:17 -05:00
Indic, Vladimir 650d35bdaa [Host-Trap PC Sampling] Host-Trap PC sampling an introduce an arbitrary sampling skid of [0, 2] instructions (#515)
* Arbitrary host-trap sampling skid (doc)

The host-trap PC sampling might introduce a skid of [0, 2]
instructions. We documented this information and provides
some advice to application developers how to find
hot-spots in the profiles generated by host-trap sampling.
2025-07-17 17:59:46 +02:00
Wang, Huanran 5c45c77ec7 [rocprofv3] Sanitize string of command in rocpd (#467)
Sanitize string of command in rocpd

Co-authored-by: Huanran Wang <huanrwan@amd.com>
2025-07-15 13:01:14 -04:00
Tumakaev, Aleksei 4af73d078f [rocprofv3] Fix incorrect position of Allocation_Size header in memory_allocation csv (#510)
Fix incorrect position of Allocation_Size header in memory_allocation csv
2025-07-15 18:15:22 +02:00
Kandula, Venkateshwar reddy d2393c97f8 [CI] add hip api table version of 13 to enum string (#509)
add hip table version to 13, API_ID_LAST is not changed from version=12 since no new struct has been added.

Co-authored-by: Venkateshwar Reddy Kandula <vkandula@amd.com>
2025-07-11 16:22:12 -05:00
Welton, Benjamin 7e3ea0c58e [SWDEV-540753] Reduce memory allocations in device profiling (#507)
Cache packet creation in all cases to reduce the number of allocations/
destruction operations made down to KFD. There is a bug that we
encounter after a period of runtime in KFD where allocations fail to be
visable to the GPU (suspect this is a FW issue, similar to other FW
issues they have had along the same lines). This sidesteps that issue in
rocprof (and likely should be done regardless)

Co-authored-by: Benjamin Welton <bewelton@amd.com>
2025-07-11 12:46:19 -07:00
Nagaraj, Sriraksha 3aaffc42da [rocprofv3-avail] Documentation update and column formatting (#447)
* addressing issues

* doc fix

* test fix

* fix

* fix formatting issue and doc update

* fix column size

* fix

* fix formatting in output

* tests fix

* test fix

* add new line

* add new line

* fix new line

* fixing typo in using-rocprofv3-avail.rst
2025-07-10 11:41:12 -05:00
Elwazir, Ammar e5161f6e06 Fixing Docs Workflow (#505) 2025-07-09 17:19:16 -05:00
Elwazir, Ammar d68e1754d7 Fix Docs Workflow (#504)
* Update docs.yml

* Update docs.yml

* Update docs.yml
2025-07-09 12:45:49 -05:00
Elwazir, Ammar a871e3534a GPU-less runners update (#503)
* Update codeql.yml

* Update codeql.yml

* Update codeql.yml

* Update codeql.yml

* Update codeql.yml

* Update codeql.yml

* Update codeql.yml

* Update codeql.yml

* Update codeql.yml

* Update codeql.yml

* clean up

* clean up

* clean up

* Update codeql.yml

* Update codeql.yml

---------

Co-authored-by: Ammar ELWazir <aelwazir@amd.com>
2025-07-09 11:46:47 -05:00
U, Srihari 6f2a5a9646 Add perfetto support for scratch memory (#303)
* Add perfetto support for scratch memory

* Updated tests and docs.

* Update docs data

* Added underflow check

* Record all free events to 0 bytes

* Add format

* Address review comment

* updated tests for scratch memory

* update scratch-memory tests.
2025-07-09 21:05:45 +05:30
Welton, Benjamin 2c4e20b951 [SWDEV-516561][1/2] Add MARKER_RANGE_EXTENT to capture ROCTX ranges (#363)
* [SWDEV-516561][1/2] Add MARKER_RANGE_EXTENT to capture ROCTX ranges

Range extent to capture all work between roctxpush/pop operations. Entry callback takes place during roxtxpush and exit callback takes place in roctxpop. This is primarily to allow us to keep an ancestor id on the ancestor stack such that all operations that take place within the push/pop context can be annotated as being apart of this range. With the current setup (where push and pop are two separate operations that need to be combined externally), we cannot keep an ancestor id on the stack and thus cannot tie tracing events to particular ranges.

Correlation id information is inherited from the push operation. Ancestor id needs to be added in a future commit that also outputs this ancestor to CSV.

Output:

```
[ctest] {'size': 64, 'kind': 7, 'operation': 1, 'correlation_id': {'internal': 1525, 'external': 0, 'ancestor': 1524}, 'start_timestamp': 2932551479402642, 'end_timestamp': 2932551491178449, 'thread_id': 3254861}
[ctest] {'size': 64, 'kind': 8, 'operation': 2, 'correlation_id': {'internal': 1525, 'external': 0, 'ancestor': 1524}, 'start_timestamp': 2932551479405878, 'end_timestamp': 2932551491181214, 'thread_id': 3254861}
```

Note: Kind 8 = range extent op.

* Merge fix

Revert several changes

source/lib/rocprofiler-sdk/marker/range_marker.*

- separate out range marker implementation for standard marker implementation

Update public API with marker core range

Support marker core range in sdk (source/lib/rocprofiler-sdk)

Transition rocprofiler-sdk-tool and output lib to use marker core range

Misc fixes for tests

Fix logic in lib/output/generate{CSV,Stats}.cpp

Update tests/rocprofv3/tracing-hip-in-libraries (marker validation)

Fix test_otf2_data

* Test fixes

---------

Co-authored-by: Benjamin Welton <bewelton@amd.com>
2025-07-08 23:41:22 -07:00
Welton, Benjamin 2fa98c4d14 [SDK] Added retry for signal wait (#494)
Added retry for signal wait

Co-authored-by: Benjamin Welton <bewelton@amd.com>
2025-07-08 23:28:02 -07:00
Roy, Rakesh 30e239d1b7 Fix find_if build error for RHEL10 (#499)
overriding Jonathan's final approval ( as it is a long weekend in US/NA)
adding algorithm header to recognize stdlib's find_if looks fine
2025-07-04 09:20:23 -04:00
Bhardwaj, Gopesh e7616c3aad Adding OpenMP usage with rocprofv3 (#472)
* Adding openmp usage with rocprofv3

* minor changes

* Fixing missing line
2025-07-02 12:25:24 +05:30
Baraldi, Giovanni c0c08b2f08 [rocprofv3] Fix ATT library path (#476)
* Fix library path

* Update docs

* Review comments

* Update source/bin/rocprofv3.py

---------

Co-authored-by: Giovanni Baraldi <gbaraldi@amd.com>
2025-07-01 22:08:29 +02:00
Nagaraj, Sriraksha 1524ceb84d [SDK] Internal event id for AQL packet increased to 64-bit unsigned int (#380)
* event id to 64 bit size

* review comments

* review comments

* review comments

* fix

* handle exception

* fix formatting issue

* fix tests
2025-06-30 17:54:37 -05:00
Madsen, Jonathan 3590ecc10e [SDK] Fix buffer tracing stringify of stack-allocated char* buffer (#429)
* [SDK] Fix buffer tracing stringify of stack-allocated char* buffer

* Formatting

---------

Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
2025-06-30 17:51:26 -05:00
Madsen, Jonathan 730b4e0a54 [CI] Use rocprof-azure-gpuless-emu-runner-set for build-docs-from-source job (#493) 2025-06-30 17:50:43 -05:00
Trowbridge, Ian 0904b6e34d [rocprofv3] Add check for Stream Stack Pointer before use (#465)
* Added null check for stream_stack before get_stream_id is called

* Rename function and add check for stream strack before pop

* Removed empty check for stream stack and adding error log for get_stream_id in stream.cpp
2025-06-30 17:49:48 -05:00
Madsen, Jonathan 99e262ca4a [CI] Disable conversion script validation (#492)
- pytest fails when you selectively disable all the tests in the suite
2025-06-30 17:02:53 -05:00