Skip to content

Testing New CI - #9

Closed
ammarwa wants to merge 0 commit into
amd/hsivasun/modify-workflowsfrom
aelwazir/testing_ci_change
Closed

ammarwa wants to merge 0 commit into
amd/hsivasun/modify-workflowsfrom
aelwazir/testing_ci_change

Conversation

@ammarwa

@ammarwa ammarwa commented Jul 28, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@ammarwa ammarwa closed this Jul 28, 2025
@ammarwa
ammarwa force-pushed the aelwazir/testing_ci_change branch from c7c26f5 to b2a0a97 Compare July 28, 2025 19:31
@ammarwa
ammarwa deleted the aelwazir/testing_ci_change branch July 28, 2025 19:41
systems-assistant Bot pushed a commit that referenced this pull request Aug 5, 2025
* Obey CMAKE_BUILD_TYPE

Obey CMAKE_BUILD_TYPE when it is passed on the command line. Previous
behavior remains:

Debug by default
ROCRTST_BLD_TYPE can set build type

* External CI: change trigger from amd-master to amd-mainline

* Added gfx94x and gfx11xx  IDs to enumerator (#5)

* Use idomatic approach to extending CMAKE_MODULE_PATH. (#7)

There are many reasons why there may already be a CMAKE_MODULE_PATH defined.
The idiomatic way to extend it in a project is via list(APPEND).

ROCm/rocminfo#97 submitted by @stellaraccident

Co-authored-by: Stella Laurenzo <Stella.Laurenzo@amd.com>

* Added release trigger for further releases

* Fix for typo in ISA_TO_ID table (#6)

Change-Id: Id0720988fb01079a3ca6f3287dc743d93db4fd0f

* Remove WSL checks for displaying UUID and BDFID

Signed-off-by: lyndonli <Lyndon.Li@amd.com>

* Added KWS check for amd-mainline (#9)

---------

Signed-off-by: lyndonli <Lyndon.Li@amd.com>
Co-authored-by: benrichard-amd <ben.richard@amd.com>
Co-authored-by: Su, Daniel <Daniel.Su@amd.com>
Co-authored-by: Stella Laurenzo <Stella.Laurenzo@amd.com>
Co-authored-by: Mallya, Ameya Keshava <AmeyaKeshava.Mallya@amd.com>
Co-authored-by: Yat Sin, David <David.YatSin@amd.com>
Co-authored-by: lyndonli <Lyndon.Li@amd.com>
systems-assistant Bot pushed a commit that referenced this pull request Aug 5, 2025
jayhawk-commits pushed a commit that referenced this pull request Aug 5, 2025
[ROCm/rocprofiler-register commit: 1b0ce80]
ammallya pushed a commit that referenced this pull request Aug 6, 2025
[ROCm/rocprofiler-systems commit: 5b326ee]
ammallya pushed a commit that referenced this pull request Aug 7, 2025
…#9)

* Adding Trace Period feature to rocprofv3

* Adding feature documentation

* Update source/bin/rocprofv3.py

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fixing format

* Moving to Collection Period and changing the input params

* Format Fixes

* Fixing rebasing issues

* Removing atomic include from the tool

* Adding more options for units, optimizing the code

* Fixing rocprofv3.py

* Fixing time conv & adding time controlled app

* Fixing format

* Changing to shared memory testing methodology

* use of shmem use

* Fix include headers for transpose-time-controlled.cpp

* Format upload-image-to-github.py

* Removing shmem and using only env var to dump timestamps from the tool

* Tool Fixes + Test Config

* Adding Tests

* Fixing Review comments

* Update trace period implementation

* Update trace period tests

* check between start and stop timestamps

* Merge Fix

* Update validate.py

* Improve safety of rocprofiler_stop_context after finalization

* Pass context id to collection_period_cntrl by value

* Adding 20 us error margin

* Ensure log level for collection-period test is not more than warning

---------

Co-authored-by: Ammar ELWazir <aelwazir@amd.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>

[ROCm/rocprofiler-sdk commit: a579c70]
ammallya pushed a commit that referenced this pull request Aug 7, 2025
* Adding changes to register and read symbols from the hip fat binary

* adding json output for host_functions

* added error handling

* adding json tool support

* Adding tests

* formatting changes

* Adding documentation

* refactoring as per amd-staging

* Adding intializers and changing macros

* Fix page-migration background thread on fork (#31)

* Fix page-migration background thread on fork

After falling off main in the forked child, all the children
try to join on on the parent's monitoring thread. This results
in a deadlock. Parent is waiting for the child to exit, but
the child is trying to join the parent's thread which is
signaled from the parent's static destructors.

Even with just one parent and child, due to copy-on-write
semantics, a child signalling the background thread to join
will still block (thread's updated state is not visible
in the child).

This fix creates background treads on fork per-child with a
pthread_atfork handler, ensuring that each child has its own
monitoring thread.

* Formatting fixes

* Detach page-migration background thread and update test timeout

* Attach files with ctest

* Update corr-id assert

* Tweak on-fork, simplify background thread

* Revert thread detach

* Adding --collection-period feature in rocprofv3 to match v1/v2 parity (#9)

* Adding Trace Period feature to rocprofv3

* Adding feature documentation

* Update source/bin/rocprofv3.py

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fixing format

* Moving to Collection Period and changing the input params

* Format Fixes

* Fixing rebasing issues

* Removing atomic include from the tool

* Adding more options for units, optimizing the code

* Fixing rocprofv3.py

* Fixing time conv & adding time controlled app

* Fixing format

* Changing to shared memory testing methodology

* use of shmem use

* Fix include headers for transpose-time-controlled.cpp

* Format upload-image-to-github.py

* Removing shmem and using only env var to dump timestamps from the tool

* Tool Fixes + Test Config

* Adding Tests

* Fixing Review comments

* Update trace period implementation

* Update trace period tests

* check between start and stop timestamps

* Merge Fix

* Update validate.py

* Improve safety of rocprofiler_stop_context after finalization

* Pass context id to collection_period_cntrl by value

* Adding 20 us error margin

* Ensure log level for collection-period test is not more than warning

---------

Co-authored-by: Ammar ELWazir <aelwazir@amd.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>

* Update lib/rocprofiler-sdk/code_object/hip/code_object.*

- move error code check macros to implementation
- fix macros which check error code
- use constexpr values instead of #define

* Update lib/rocprofiler-sdk/code_object/hip/code_object.*

- debugging for error that cannot be locally reproduced

* Update lib/rocprofiler-sdk/code_object/hip/code_object.*

- improve error handling and logging

* Update lib/rocprofiler-sdk/code_object/hip/code_object.*

- tweak to non-fatal logging messages

* Update lib/rocprofiler-sdk/code_object/hip/code_object.*

- cleanup of logging messages

* Update host kernel symbol register data fields

* Update source/lib/rocprofiler-sdk/code_object/hip/code_object.hpp

---------

Co-authored-by: Madsen, Jonathan <Jonathan.Madsen@amd.com>
Co-authored-by: Kuricheti, Mythreya <Mythreya.Kuricheti@amd.com>
Co-authored-by: Elwazir, Ammar <Ammar.Elwazir@amd.com>
Co-authored-by: Ammar ELWazir <aelwazir@amd.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>

[ROCm/rocprofiler-sdk commit: 78d8f4b]
jayhawk-commits pushed a commit that referenced this pull request Aug 8, 2025
[ROCm/rocm_smi_lib commit: dcdaf73]
systems-assistant Bot pushed a commit that referenced this pull request Aug 10, 2025
* Add palamida.yml - removing url
jayhawk-commits pushed a commit that referenced this pull request Aug 11, 2025
jayhawk-commits pushed a commit that referenced this pull request Aug 11, 2025
* Obey CMAKE_BUILD_TYPE

Obey CMAKE_BUILD_TYPE when it is passed on the command line. Previous
behavior remains:

Debug by default
ROCRTST_BLD_TYPE can set build type

* External CI: change trigger from amd-master to amd-mainline

* Added gfx94x and gfx11xx  IDs to enumerator (#5)

* Use idomatic approach to extending CMAKE_MODULE_PATH. (#7)

There are many reasons why there may already be a CMAKE_MODULE_PATH defined.
The idiomatic way to extend it in a project is via list(APPEND).

ROCm/rocminfo#97 submitted by @stellaraccident

Co-authored-by: Stella Laurenzo <Stella.Laurenzo@amd.com>

* Added release trigger for further releases

* Fix for typo in ISA_TO_ID table (#6)

Change-Id: Id0720988fb01079a3ca6f3287dc743d93db4fd0f

* Remove WSL checks for displaying UUID and BDFID

Signed-off-by: lyndonli <Lyndon.Li@amd.com>

* Added KWS check for amd-mainline (#9)

---------

Signed-off-by: lyndonli <Lyndon.Li@amd.com>
Co-authored-by: benrichard-amd <ben.richard@amd.com>
Co-authored-by: Su, Daniel <Daniel.Su@amd.com>
Co-authored-by: Stella Laurenzo <Stella.Laurenzo@amd.com>
Co-authored-by: Mallya, Ameya Keshava <AmeyaKeshava.Mallya@amd.com>
Co-authored-by: Yat Sin, David <David.YatSin@amd.com>
Co-authored-by: lyndonli <Lyndon.Li@amd.com>

[ROCm/rocminfo commit: aec5d6f]
jayhawk-commits pushed a commit that referenced this pull request Aug 11, 2025
* Add Contributing documentation as per template, updated Readme documentation and Update codeowners
* Moving Readme.txt to Readme.md format 
* Update Review Comments - CMAKE commands Updated, removed library dump and added API usage
* Update Review Comments - Enhanced Text descriptions, prerequisites/install prefix descriptions
* Update Review Comments - Added RPM Package Samples also and Enhanced Descriptions

[ROCm/rocm-core commit: d11f5c2]
jayhawk-commits pushed a commit that referenced this pull request Aug 18, 2025
* Add palamida.yml - removing url

[ROCm/hipother commit: e0ff75f]
stellaraccident added a commit that referenced this pull request Feb 26, 2026
## Summary

- Implements ROCm-stack-compatible "Any" semantics for ISA feature flags
in the kpack runtime loader. When the HSA agent reports
`gfx942:sramecc+:xnack-`, the loader now probes all compatible archive
names: `gfx942:sramecc+:xnack-`, `gfx942:sramecc+`, `gfx942:xnack-`,
`gfx942` (power set, most specific first).
- Adds `for_each_compatible_target()` callback-based utility with 30
unit tests covering consumer cards, datacenter GPUs, ASAN (xnack+),
generic ISA, early termination, and edge cases.
- Fixes 7 pre-existing test failures where `test_loader_api.cpp` still
referenced `.kpm` manifests removed in 870d162.

## Context

The kpack splitter preserves the compiler's target string in archive
names and TOC keys. Release builds produce bare `gfx942`, ASAN builds
produce `gfx942:xnack+`. The runtime receives the agent's full ISA from
HSA (e.g., `gfx942:sramecc+:xnack-`). Without feature-flag matching, the
loader would fail to find archives compiled with fewer features.

This matches the semantics used throughout ROCm:
- LLVM: `isCompatibleTargetID()` (clang/lib/Basic/TargetID.cpp)
- comgr: `isCompatibleIsaName()` (comgr-metadata.cpp)
- HSA: `Isa::IsCompatible()` (isa.cpp)
- CLR: `Isa::isCompatible()` (device.cpp)

## Test plan

- [x] 30 new ISA target match unit tests (StripTargetPrefix,
ParseTargetId, IsaTargetMatch)
- [x] 100/100 CTest pass (including fixed loader integration tests)
- [ ] CI integration test with gfx942 artifacts (structural verification
done, needs hardware)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
jeffqjiangNew added a commit that referenced this pull request Mar 13, 2026
## Motivation

This PR adds entry and exit logs for core functions.

## Technical Details

- Info level (3) logs are added at core function entry and exit points.
- Monotonic clock stamp, process id, thread id, and file name are added
to the logs.
- The logs now have similar format to HIP logs for better viewing when
both are present.
- Direct error or warning logs to std::cerr. Other logs still go to
std::cout.

## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

Set env variable ROCDEC_LOG_LEVEL to control log output.

All CTests and conformance tests must pass. Example summary of the test
results:
- CTests:

      Start  1: video_decodeRaw-HEVC
 1/15 Test  #1: video_decodeRaw-HEVC .............   Passed    2.05 sec
      Start  2: video_decodeRaw-AVC
 2/15 Test  #2: video_decodeRaw-AVC ..............   Passed    1.89 sec
      Start  3: video_decodeRaw-AV1
 3/15 Test  #3: video_decodeRaw-AV1 ..............   Passed    2.31 sec
      Start  4: video_decodeRaw-VP9
 4/15 Test  #4: video_decodeRaw-VP9 ..............   Passed    2.04 sec
      Start  5: rocdec_Decode-HEVC
 5/15 Test  #5: rocdec_Decode-HEVC ...............   Passed    0.92 sec
      Start  6: rocDecode_Negative_API_Tests
 6/15 Test  #6: rocDecode_Negative_API_Tests .....   Passed    0.78 sec
      Start  7: video_decode-HEVC
 7/15 Test  #7: video_decode-HEVC ................   Passed    2.74 sec
      Start  8: video_decode-AVC
 8/15 Test  #8: video_decode-AVC .................   Passed    2.64 sec
      Start  9: video_decode-AV1
 9/15 Test  #9: video_decode-AV1 .................   Passed    2.74 sec
      Start 10: video_decode-VP9
10/15 Test #10: video_decode-VP9 .................   Passed    2.78 sec
      Start 11: video_decodePerf-HEVC
11/15 Test #11: video_decodePerf-HEVC ............   Passed    2.92 sec
      Start 12: video_decodeBatch
12/15 Test #12: video_decodeBatch ................   Passed    4.34 sec
      Start 13: video_decodeRGB-HEVC
13/15 Test #13: video_decodeRGB-HEVC .............   Passed   33.51 sec
      Start 14: video_decodeMem-HEVC
14/15 Test #14: video_decodeMem-HEVC .............   Passed    2.09 sec
      Start 15: video_decodeRGB-Resize
15/15 Test #15: video_decodeRGB-Resize ...........   Passed   33.94 sec

100% tests passed, 0 tests failed out of 15

- AVC conformance test:
Conformance test completed on the 127 streams:
     - The number of passing streams is 127
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- HEVC conformance test:
Conformance test completed on the 135 streams:
     - The number of passing streams is 135
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- AV1 conformance test:
Conformance test completed on the 162 streams:
     - The number of passing streams is 162
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- VP9 conformance test:
Conformance test completed on the 108 streams:
     - The number of passing streams is 108
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

## Test Result

Function entry/exit logs should show up when ROCDEC_LOG_LEVEL >= 3.

All conformance tests should pass.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
Nikhil-Nunna pushed a commit that referenced this pull request Mar 13, 2026
## Motivation

This PR adds entry and exit logs for core functions.

## Technical Details

- Info level (3) logs are added at core function entry and exit points.
- Monotonic clock stamp, process id, thread id, and file name are added
to the logs.
- The logs now have similar format to HIP logs for better viewing when
both are present.
- Direct error or warning logs to std::cerr. Other logs still go to
std::cout.

## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

Set env variable ROCDEC_LOG_LEVEL to control log output.

All CTests and conformance tests must pass. Example summary of the test
results:
- CTests:

      Start  1: video_decodeRaw-HEVC
 1/15 Test  #1: video_decodeRaw-HEVC .............   Passed    2.05 sec
      Start  2: video_decodeRaw-AVC
 2/15 Test  #2: video_decodeRaw-AVC ..............   Passed    1.89 sec
      Start  3: video_decodeRaw-AV1
 3/15 Test  #3: video_decodeRaw-AV1 ..............   Passed    2.31 sec
      Start  4: video_decodeRaw-VP9
 4/15 Test  #4: video_decodeRaw-VP9 ..............   Passed    2.04 sec
      Start  5: rocdec_Decode-HEVC
 5/15 Test  #5: rocdec_Decode-HEVC ...............   Passed    0.92 sec
      Start  6: rocDecode_Negative_API_Tests
 6/15 Test  #6: rocDecode_Negative_API_Tests .....   Passed    0.78 sec
      Start  7: video_decode-HEVC
 7/15 Test  #7: video_decode-HEVC ................   Passed    2.74 sec
      Start  8: video_decode-AVC
 8/15 Test  #8: video_decode-AVC .................   Passed    2.64 sec
      Start  9: video_decode-AV1
 9/15 Test  #9: video_decode-AV1 .................   Passed    2.74 sec
      Start 10: video_decode-VP9
10/15 Test #10: video_decode-VP9 .................   Passed    2.78 sec
      Start 11: video_decodePerf-HEVC
11/15 Test #11: video_decodePerf-HEVC ............   Passed    2.92 sec
      Start 12: video_decodeBatch
12/15 Test #12: video_decodeBatch ................   Passed    4.34 sec
      Start 13: video_decodeRGB-HEVC
13/15 Test #13: video_decodeRGB-HEVC .............   Passed   33.51 sec
      Start 14: video_decodeMem-HEVC
14/15 Test #14: video_decodeMem-HEVC .............   Passed    2.09 sec
      Start 15: video_decodeRGB-Resize
15/15 Test #15: video_decodeRGB-Resize ...........   Passed   33.94 sec

100% tests passed, 0 tests failed out of 15

- AVC conformance test:
Conformance test completed on the 127 streams:
     - The number of passing streams is 127
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- HEVC conformance test:
Conformance test completed on the 135 streams:
     - The number of passing streams is 135
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- AV1 conformance test:
Conformance test completed on the 162 streams:
     - The number of passing streams is 162
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

- VP9 conformance test:
Conformance test completed on the 108 streams:
     - The number of passing streams is 108
     - The number of failing streams is 0
     - The number of streams that did not finish decoding is 0

## Test Result

Function entry/exit logs should show up when ROCDEC_LOG_LEVEL >= 3.

All conformance tests should pass.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
jeffqjiangNew added a commit that referenced this pull request Apr 2, 2026
…4229)

## Motivation

This PR adds a new rocDecode feature: support for user specified output
surface format.

## Technical Details

In certain use cases, the user requests a decoded image format that is
not the native format based on the stream content. For example, 8-bit
output is needed on a 10-bit stream. This PR enables the output format
selection as long as it is supported by the VA-API driver.
- Added a special output format define to indicate if the output format
is user set or native.
- VA-API decoder now sets the surface format either native or by user
override.
- Added the output format command option to rocdecdecode sample for
feature verification.
## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

- Run CTests and decode conformance tests to catch any regressions. 
- Run rocdecdecode samples to verify user set output.
## Test Result

All CTests and conformance tests pass. Example summary of the test
results:

CTests:
      Start  1: video_decodeRaw-HEVC
1/15 Test #1:
video_decodeRaw-HEVC ............. Passed 2.05 sec
      Start  2: video_decodeRaw-AVC
2/15 Test #2:
video_decodeRaw-AVC .............. Passed 1.89 sec
      Start  3: video_decodeRaw-AV1
3/15 Test #3:
video_decodeRaw-AV1 .............. Passed 2.31 sec
      Start  4: video_decodeRaw-VP9
4/15 Test #4:
video_decodeRaw-VP9 .............. Passed 2.04 sec
      Start  5: rocdec_Decode-HEVC
5/15 Test #5:
rocdec_Decode-HEVC ............... Passed 0.92 sec
      Start  6: rocDecode_Negative_API_Tests
6/15 Test #6:
rocDecode_Negative_API_Tests ..... Passed 0.78 sec
      Start  7: video_decode-HEVC
7/15 Test #7: video_decode-HEVC
................ Passed 2.74 sec
      Start  8: video_decode-AVC
8/15 Test #8: video_decode-AVC
................. Passed 2.64 sec
      Start  9: video_decode-AV1
9/15 Test #9: video_decode-AV1
................. Passed 2.74 sec
      Start 10: video_decode-VP9
10/15 Test #10:
video_decode-VP9 ................. Passed 2.78 sec
      Start 11: video_decodePerf-HEVC
11/15 Test #11:
video_decodePerf-HEVC ............ Passed 2.92 sec
      Start 12: video_decodeBatch
12/15 Test #12:
video_decodeBatch ................ Passed 4.34 sec
      Start 13: video_decodeRGB-HEVC
13/15 Test #13:
video_decodeRGB-HEVC ............. Passed 33.51 sec
      Start 14: video_decodeMem-HEVC
14/15 Test #14:
video_decodeMem-HEVC ............. Passed 2.09 sec
      Start 15: video_decodeRGB-Resize
15/15 Test #15:
video_decodeRGB-Resize ........... Passed 33.94 sec

100% tests passed, 0 tests failed out of 15

AVC conformance test:
Conformance test completed on the 127 streams:

The number of passing streams is 127
The number of failing streams is 0
The number of streams that did not finish decoding is 0
HEVC conformance test:
Conformance test completed on the 135 streams:

The number of passing streams is 135
The number of failing streams is 0
The number of streams that did not finish decoding is 0
AV1 conformance test:
Conformance test completed on the 162 streams:

The number of passing streams is 162
The number of failing streams is 0
The number of streams that did not finish decoding is 0
VP9 conformance test:
Conformance test completed on the 108 streams:

The number of passing streams is 108
The number of failing streams is 0
The number of streams that did not finish decoding is 0
<!-- Briefly summarize test outcomes. -->

rocdecdecode sample dumps the clean output YUV clips of the specified
format (NV12 or P016).

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
gandryey pushed a commit that referenced this pull request Apr 6, 2026
…4229)

## Motivation

This PR adds a new rocDecode feature: support for user specified output
surface format.

## Technical Details

In certain use cases, the user requests a decoded image format that is
not the native format based on the stream content. For example, 8-bit
output is needed on a 10-bit stream. This PR enables the output format
selection as long as it is supported by the VA-API driver.
- Added a special output format define to indicate if the output format
is user set or native.
- VA-API decoder now sets the surface format either native or by user
override.
- Added the output format command option to rocdecdecode sample for
feature verification.
## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

- Run CTests and decode conformance tests to catch any regressions. 
- Run rocdecdecode samples to verify user set output.
## Test Result

All CTests and conformance tests pass. Example summary of the test
results:

CTests:
      Start  1: video_decodeRaw-HEVC
1/15 Test #1:
video_decodeRaw-HEVC ............. Passed 2.05 sec
      Start  2: video_decodeRaw-AVC
2/15 Test #2:
video_decodeRaw-AVC .............. Passed 1.89 sec
      Start  3: video_decodeRaw-AV1
3/15 Test #3:
video_decodeRaw-AV1 .............. Passed 2.31 sec
      Start  4: video_decodeRaw-VP9
4/15 Test #4:
video_decodeRaw-VP9 .............. Passed 2.04 sec
      Start  5: rocdec_Decode-HEVC
5/15 Test #5:
rocdec_Decode-HEVC ............... Passed 0.92 sec
      Start  6: rocDecode_Negative_API_Tests
6/15 Test #6:
rocDecode_Negative_API_Tests ..... Passed 0.78 sec
      Start  7: video_decode-HEVC
7/15 Test #7: video_decode-HEVC
................ Passed 2.74 sec
      Start  8: video_decode-AVC
8/15 Test #8: video_decode-AVC
................. Passed 2.64 sec
      Start  9: video_decode-AV1
9/15 Test #9: video_decode-AV1
................. Passed 2.74 sec
      Start 10: video_decode-VP9
10/15 Test #10:
video_decode-VP9 ................. Passed 2.78 sec
      Start 11: video_decodePerf-HEVC
11/15 Test #11:
video_decodePerf-HEVC ............ Passed 2.92 sec
      Start 12: video_decodeBatch
12/15 Test #12:
video_decodeBatch ................ Passed 4.34 sec
      Start 13: video_decodeRGB-HEVC
13/15 Test #13:
video_decodeRGB-HEVC ............. Passed 33.51 sec
      Start 14: video_decodeMem-HEVC
14/15 Test #14:
video_decodeMem-HEVC ............. Passed 2.09 sec
      Start 15: video_decodeRGB-Resize
15/15 Test #15:
video_decodeRGB-Resize ........... Passed 33.94 sec

100% tests passed, 0 tests failed out of 15

AVC conformance test:
Conformance test completed on the 127 streams:

The number of passing streams is 127
The number of failing streams is 0
The number of streams that did not finish decoding is 0
HEVC conformance test:
Conformance test completed on the 135 streams:

The number of passing streams is 135
The number of failing streams is 0
The number of streams that did not finish decoding is 0
AV1 conformance test:
Conformance test completed on the 162 streams:

The number of passing streams is 162
The number of failing streams is 0
The number of streams that did not finish decoding is 0
VP9 conformance test:
Conformance test completed on the 108 streams:

The number of passing streams is 108
The number of failing streams is 0
The number of streams that did not finish decoding is 0
<!-- Briefly summarize test outcomes. -->

rocdecdecode sample dumps the clean output YUV clips of the specified
format (NV12 or P016).

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.
ammallya pushed a commit that referenced this pull request Apr 9, 2026
* Move hoff_t definition to a new shared/hipfile-types.h file
* Use hoff_t everywhere in rocFile (except sys equivalents)
* Add hipfile-types.h to the list of installed files
ammallya pushed a commit that referenced this pull request Apr 9, 2026
* Move hoff_t definition to a new shared/hipfile-types.h file
* Use hoff_t everywhere in rocFile (except sys equivalents)
* Add hipfile-types.h to the list of installed files

[ROCm/hipFile commit: 62ef48d]
ammarwa added a commit that referenced this pull request Apr 19, 2026
…ride path, skip subdirs in config copy

Finding #5: Add smoke_test field to _Dep; opencode registry gets smoke_test=["--version"]. check_tool_available binary branch now runs the smoke command — OSError, non-zero exit, or timeout each return (False, detail).

Finding #6: PERFXPERT_OPENCODE_PATH pointing to a nonexistent file now raises FileNotFoundError immediately instead of silently falling back to bundled/PATH lookup.

Finding #9: _prepare_runtime_config_dir guards `if not f.is_file(): continue` before read_bytes() to avoid crashing on subdirectories.

Finding #17: opencode_launcher module docstring clarifies opencode is a system dependency (Phase 8 deliverable), not bundled in this release.

Tests: new smoke-test OSError/non-zero/timeout tests in test_tooldep; test_resolve_binary_raises_when_override_missing replaces the old fallback test; test_prepare_runtime_config_dir_skips_subdirectories added.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ammarwa added a commit that referenced this pull request Apr 23, 2026
… polish + contributing docs (#5174)

## Summary

Proven-optimizations catalog, nightly benchmark harness, contributing
guides + RFC process + architecture refresh, `perfxpert doctor` polish,
Phase 7.1 `ai_analysis/` module deletion, and the convergence-review
fixes that establish real legacy-vs-agentic parity. This is the last PR
in the original retirement series; subsequent PRs (#5179, #5180) add the
bundled opencode fork and the docs-audit toolchain.

Stacks on #5173. Next in stack: #5179.

## What lands

### Phase 7.1 — `perfxpert/ai_analysis/` module removed
Commit `cb03e82c36` deletes the entire `ai_analysis/` module — **21
files, ~11.7 KLOC**. All execution now routes through
`perfxpert/agents/`; the dispatcher and the `PERFXPERT_LEGACY` env
toggle are gone. This completes the retirement started in #5173: there
is no longer a "legacy path" to opt back into.

### Proven-optimizations catalog (10 canonical case studies)
- `knowledge/proven_optimizations.yaml`: vgpr_reduction, lds_tiling,
mfma_enablement, memory_coalescing, fast_math, hip_stream_overlap,
kernel_fusion, device_sync_removal, warp_primitives, cache_blocking
- Dual-schema fixture integration: synthetic `duration_ns` + real
rocprofv3 UUID-suffixed `(end_ns - start_ns)` tables
- `tests/fixtures/*.db`: 5 fixtures re-profiled with `--pmc` on real
MI300X hardware

### Nightly benchmark harness + orchestration

### Contributing guides + RFC process + architecture refresh

### `perfxpert doctor` polish (8 checks incl. opencode bundled + LLM
providers)

## Review findings addressed (29 findings, 5 fix batches)

### Batch 1 — Gate cascade fidelity (3 commits)
- `gate-2-sol-signature`: `_run_sol_gate` took wrong keyword; unit tests
mocked the function so the TypeError went undetected. Two-tier check
now: hard cap on speedup ratio (>50× rejected arch-independent) +
optional absolute FLOPS check via `sol.sanity_check`. 13 new un-mocked
integration tests (`TestRunSolGateUnmocked`).
- `gate-4-hot-kernel-key-unit`: `regression.compare_runs` returns
`per_kernel_deltas` (list of dicts with `delta_pct` as a **fraction**,
not percent), not `hot_kernels`. Old code iterated a non-existent key so
Gate 4 silently treated all regressions as OK. Fraction↔percent
conversion corrected.
- `gate-5-skip-verdict`: verdict strings no longer misleading on skip
(`candidate_binary=None` path).

### Batch 2 — Schemas, validators, framework invariants (6 findings)
- #4: Pydantic cross-field validators on `GateVerdictModel`
(status/failing_gate coupling), `CorrectnessOutput` (verdict/action),
confidence clamps `Field(..., ge=0.0, le=1.0)`, typed `Literal` for
provider
- #12: `Agent` dataclass `frozen=True`; `__post_init__` validates layer
in (0,1,2)
- #7: `_parse_headers` raises `ValueError` on malformed JSON instead of
silent `{}`
- #10, #18: tasks module logs resolved store path; stale READ_ONLY
docstrings rewritten
- #17: README clarifies opencode is system dependency; doctor warns when
PERFXPERT_TASK_ROOT unset

### Batch 3 — External tool verifier + fence alignment (6 findings)
- N28: anthropic/openai SDK imports routed through `require_tool()` with
install-hint on missing
- N29: all 8 agent fence slices aligned to actual agent tool allowlists
- #5, #6, #9, #17: smoke-test opencode binary (not just presence),
hard-fail on bad `PERFXPERT_OPENCODE_PATH` override, skip subdirs in
config copy
- `tooldep`: user-home path search +
`PERFXPERT_ROCPROF_TRACE_DECODER_PATH` env support

### Batch 4 — Classifier + data-provenance fidelity (2 findings)
- **#1**: classifier no longer swallows DB errors silently (was
returning empty metrics → `data_insufficient`; now logs + propagates
error markers)
- **#26 (priority user-flagged)**: confidence now weighted by
`evidence_strength × match_ratio` instead of raw rule-count
normalization — partial-PMC classifications no longer over-confident.
New `test_partial_pmc_confidence` covers trace-only vs full-PMC paths.

### Batch 5 — Tests coverage gaps (9 findings)
- #20: gate cascade short-circuit coverage (Gates 2/3/4)
- #21: `_TraceAnalysisAdapter` shim delegation tests
- #22: trace-only `memcpy_pct` path in `classify_from_metrics`
- #23: `anthropic.APITimeoutError` normalization path
- #24: Root agent lambda stub guard
(`test_root.py::test_lambda_stubs_never_invoked`)
- #25: MCP tool coverage across 5 representative tools
- #27: flaky `time.sleep` → `proc.wait(timeout=5)`
- #14, #15, #16: stale comments + docstring rewrites (api.py,
__main__.py, recommendation.py)

## Parity story

**Problem found during review**: parity test wiring was toggling a dead
flag (`PERFXPERT_USE_AGENTS`) after the retirement PR flipped the
default — both legs were running the agentic path. "Parity" passed
vacuously.

**Fixes applied (Decision A+C):**
- **A**: Parity runner now toggles the operative legacy opt-out so
legacy and agentic paths are genuinely distinct; Tier-1 trace-only
fixtures `xfail`ed until re-profiled with `--pmc`.
- **C**: Re-profiled all 5 fixtures (`baseline`, `memory_bound`,
`compute_bound`, `latency_bound`, `regressed`) on real MI300X with
`rocprofv3 --pmc`:
- `compute_bound`: VALU-bound kernel (not MFMA, to legitimately match
Compute-Bound classification)
  - `memory_bound` / `baseline`: 128 MB H2D+D2H loop
  - `latency_bound` / `regressed`: 6,000 tiny kernels
- `_build_analysis_result` returns `api_overhead` (not `latency`) for
`overhead_pct > 25%` (legacy heuristic fix)
- E2E + dashboard tests updated for evidence-weighted classification

**Result**: `parity_snapshots/_aggregate.json` → **100% agreement on PMC
fixtures** (10/10 bottleneck + rec_technique signals). `rec_type` signal
skipped where the agentic path can't populate without an LLM (documented
asymmetric None).

## Convergence review round (2026-04-18)

- **Brand scrub**: zero-tolerance removal of the prior codename across
code, tests, patches, env-var names, and documentation.
- **CLI flag plumbing**: all 10 CLI flags (`--prompt`, `--llm`,
`--llm-model`, `--att-dir`, `--pc-sampling`, `--source-dir`, `--format`,
`-d/-o`) now wired end-to-end via an `analysis_options` side-channel on
`Context`.
- **PMC shard UNION** across multiple `.db` files uses
column-intersection and emits a `RuntimeWarning` listing dropped
columns.
- **FallbackProvider** has a typed exception taxonomy
(`LLMRateLimitError`, `LLMAuthenticationError`, `LLMTransientError`,
`LLMFatalError`). Auth/fatal errors surface immediately; only transient
+ rate-limit cascade. The provider is wired into `build_session`;
`PERFXPERT_LLM_FALLBACK_CHAIN` now has runtime effect.

## Test plan

- [x] 1036 pass / 3 skip / 0 fail from `experimental/python/perfxpert/`
- [x] Core suites — 100% pass: `tests/test_agents + test_providers +
test_runtime + test_tools`
- [x] Parity ship-gate — 100%: `tests/test_parity/` (12 passed, 5
rec_type skips documented)
- [x] Gate cascade — 100%: 28 tests including 13 new un-mocked SOL
integration tests (Batch 1 recovery)
- [x] E2E brain: `perfxpert-code run -m openai/gpt-4o-mini "..."` → MCP
→ Python → `81.7 TFLOPS` + AMD footer
- [x] `perfxpert doctor`: all 8 checks green (34 MCP tools at this PR
boundary; 43 after #5179+#5180; opencode 1.4.11 bundled; 3/5 LLM
providers configured)
- [x] No legacy opt-out path remains (Phase 7.1 removed the dispatcher
and the `PERFXPERT_LEGACY` toggle)
- [ ] Live MI300X nightly run (requires hardware; nightly workflow will
refresh baseline)
- [ ] Full interactive TUI (requires TTY; E2E can only prove
banner-emitted)

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
yalmusaf added a commit that referenced this pull request Apr 27, 2026
- Guard sentinel values before mW-to-W arithmetic to prevent overflow
- Add offsetof static_asserts for layout compatibility checks
- Replace GTEST_SKIP with continue in device loop
- Document mW vs W distinction in APU power section comments
- Reorder APU macros in rocm_smi.h to match amdsmi.h
- Complete CHANGELOG sentinel docs for all field types
accauble added a commit that referenced this pull request May 11, 2026
Required recognizing and adding implicit operands to the
amdisa library. In order to avoid using magic numbers (126 and 127)
for certain operand types, a workaround had to be introduced to
the amdisa parser (see bug #9 at the top of the file). This
workaround adds missing enums to the OPR_SREG and OPR_SREG_NOVCC
operand types.

Added tests to check that the flag gets set for a variety of
instruction types that should set (or shouldn't set) the flag.
abouteiller added a commit that referenced this pull request Jun 26, 2026
## Motivation

On certain test systems we do not have a shared filesystem, the
deadlock_analysis script harness would depend on a shared filesystem to
collect traces and artifacts. Remove that limitation.

## Technical Details

Use MPI stdout redirection to coalesce the trace artifacts to the
headnode in a headnode local output directory, perform analysis on the
headnode.

Prior filesystem based mode remains available and default. 

## JIRA ID


## Test Plan

Intentionally added a deadlock to a functional test, compiled with
Debug.
Run mpiexec_deadlock_attach script and observe artifacts.

## Test Result

```
 ROCSHMEM_DEBUG_LEVEL=trace:stats ~/ompi/bin/mpirun -n 2 tests/functional_tests/rocshmem_functional_tests -n 1 -a 26  & (sleep 2; /home/abouteil/rocm-systems/projects/rocshmem/scripts/debug/mpiexec_deadlock_analysis.sh  rocshmem_functional_tests --stats --color --no-shared-fs )
### Creating Test:      Blocking WG level Puts  B=ipc PE=2 W=1 Z=64 ###
Deploying deadlock analysis...
Executable:       rocshmem_functional_tests
Output directory: ./rocshmem_deadlock_analysis_20260530_013437
Filesystem mode:  no shared fs (--output-filename)
Stats:            yes
Color:            --color

Found 4 process(es) matching 'rocshmem_functional_tests': 717472 717473 751554 751555
Output directory: /tmp/rocshmem_deadlock_20260530_013437
Per-process timeout: 120s

Analyzing PID 717472 (PE 0) ... OK
Analyzing PID 717473 (PE 1) ... OK (no GPU threads)
Analyzing PID 751554 (PE 0) ... OK
Analyzing PID 751555 (PE 1) ... OK (no GPU threads)

=== Attach and Analyze Summary ===
Processes analyzed: 4 / 4

  PE 0     PID 751554    groups=1    \033[1;31m1\033[0m wf(s) in rocSHMEM; \033[1;36mWaiting for remote PE memory update (barrier/sync or user rocshmem_wait_until). Check if the remote PE is alive and making progress. (at: #0  0x0000792efa5af3c8 in rocshmem::Context::wait_until<long> (this=0x792eed407000, ivars=0x792efac04008, cmp=0, val=1) at src/context_tmpl_device.hpp:224)\033[0m
  PE 1     PID 751555    groups=?    (no GPU threads found)
=== BEGIN FILE: pe0_pid_717472.txt ===
[New LWP 717493]
[New LWP 717490]
[New LWP 717488]
[New LWP 717485]
[New LWP 717481]
[New LWP 717480]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x000077a09e06695f in ?? () from /opt/rocm-7.2.1/lib/libhsa-runtime64.so.1
=== rocSHMEM Deadlock Analysis ===
Process(es): 717472
Total GPU wavefronts analyzed: 1
Unique backtrace groups: 1

--- Group 1 (1 wavefront(s)) ---
  WFs: (0,0,0)/0
  Backtrace:
    #0  0x0000776005fafce0 in rocshmem::uncached_load<long volatile> (src=0x776006604008) at src/assembly.hpp:125
    #1  rocshmem::Context::test<long> (this=0x775ff8e07000, ivars=0x776006604008, cmp=0, val=1) at src/context_tmpl_device.hpp:432
    #2  rocshmem::Context::wait_until<long> (this=0x775ff8e07000, ivars=0x776006604008, cmp=0, val=1) at src/context_tmpl_device.hpp:224
    #3  rocshmem::IPCContext::internal_direct_barrier (this=0x775ff8e07000, pe=0, PE_start=0, stride=1, n_pes=2, pSync=0x776006604000) at build/src/ipc/context_ipc_device_coll.cpp:44
    #4  0x0000776005fb7c24 in rocshmem::IPCContext::internal_sync_wg (this=0x775ff8e07000, pe=0, PE_start=0, stride=1, PE_size=2, pSync=0x776006604000) at build/src/ipc/context_ipc_device_coll.cpp:115
    #5  0x000077600603d018 in rocshmem::IPCContext::sync_all_wg (this=0x775ff8e07000) at build/src/ipc/context_ipc_device_coll.cpp:168
    #6  0x000077600603d558 in rocshmem::IPCContext::barrier_all_wg (this=0x775ff8e07000) at build/src/ipc/context_ipc_device_coll.cpp:187
    #7  0x000077600603dedc in rocshmem::Context::barrier_all_wg (this=0x775ff8e07000) at build/src/context_device.cpp:151
    #8  0x000077600603e33c in rocshmem::rocshmem_barrier_all_wg () at build/src/rocshmem_gpu.cpp:885
    #9  0x00007760060437cc in WorkGroupPrimitiveTest (loop=1, skip=10, start_time=0x775ff8e31000, end_time=0x775ff8e32000, source=0x776013c00480 "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr"..., dest=0x776013d00500 "1", size=1, type=WGPutTestType, ctx_type=4) at /home/abouteil/rocm-systems/projects/rocshmem/tests/functional_tests/workgroup_primitives.cpp:72
  [HINT] Waiting for remote PE memory update (barrier/sync or user rocshmem_wait_until). Check if the remote PE is alive and making progress. (at: #2  rocshmem::Context::wait_until<long> (this=0x775ff8e07000, ivars=0x776006604008, cmp=0, val=1) at src/context_tmpl_device.hpp:224)
...
=== END FILE: pe1_pid_751555.txt ===

Reconstructing per-PE output files from mpiexec output...
Reconstructed output from 1 rank file(s).

Running cross-rank coalescing pass...

=== Cross-Rank Deadlock Analysis ===
Directory: ./rocshmem_deadlock_analysis_20260530_013437
Ranks with analysis files: 2  (0, 1)
Unique backtrace patterns: 2

--- Pattern 1 [UNIQUE: rank 0] ---
  Ranks: 0
  Total wavefronts: 1
  Backtrace:
    #0  0x0000776005fafce0 in rocshmem::uncached_load<long volatile> (src=0x776006604008) at src/assembly.hpp:125
    #1  rocshmem::Context::test<long> (this=0x775ff8e07000, ivars=0x776006604008, cmp=0, val=1) at src/context_tmpl_device.hpp:432
    #2  rocshmem::Context::wait_until<long> (this=0x775ff8e07000, ivars=0x776006604008, cmp=0, val=1) at src/context_tmpl_device.hpp:224
    #3  rocshmem::IPCContext::internal_direct_barrier (this=0x775ff8e07000, pe=0, PE_start=0, stride=1, n_pes=2, pSync=0x776006604000) at build/src/ipc/context_ipc_device_coll.cpp:44
    #4  0x0000776005fb7c24 in rocshmem::IPCContext::internal_sync_wg (this=0x775ff8e07000, pe=0, PE_start=0, stride=1, PE_size=2, pSync=0x776006604000) at build/src/ipc/context_ipc_device_coll.cpp:115
    #5  0x000077600603d018 in rocshmem::IPCContext::sync_all_wg (this=0x775ff8e07000) at build/src/ipc/context_ipc_device_coll.cpp:168
    #6  0x000077600603d558 in rocshmem::IPCContext::barrier_all_wg (this=0x775ff8e07000) at build/src/ipc/context_ipc_device_coll.cpp:187
    #7  0x000077600603dedc in rocshmem::Context::barrier_all_wg (this=0x775ff8e07000) at build/src/context_device.cpp:151
    #8  0x000077600603e33c in rocshmem::rocshmem_barrier_all_wg () at build/src/rocshmem_gpu.cpp:885
    #9  0x00007760060437cc in WorkGroupPrimitiveTest (loop=1, skip=10, start_time=0x775ff8e31000, end_time=0x775ff8e32000, source=0x776013c00480 "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr"..., dest=0x776013d00500 "1", size=1, type=WGPutTestType, ctx_type=4) at /home/abouteil/rocm-systems/projects/rocshmem/tests/functional_tests/workgroup_primitives.cpp:72
  [HINT] Waiting for remote PE memory update (barrier/sync or user rocshmem_wait_until). Check if the remote PE is alive and making progress. (at: #2  rocshmem::Context::wait_until<long> (this=0x775ff8e07000, ivars=0x776006604008, cmp=0, val=1) at src/context_tmpl_device.hpp:224)

=== Per-Rank rocSHMEM Wavefront Count ===
  Rank 0: 2 wf(s) inside rocSHMEM
  Rank 1: 0 wf(s) inside rocSHMEM

=== Summary ===
  0 pattern(s) common to all 2 rank(s)
  1 pattern(s) present in exactly one rank
  Most common hint: Waiting for remote PE memory update (barrier/sync or user rocshmem_wait_until). Check if the remote PE is alive and making progress. (at: #2  rocshmem::Context::wait_until<long> (this=0x775ff8e07000, ivars=0x776006604008, cmp=0, val=1) at src/context_tmpl_device.hpp:224)
```
abouteiller added a commit that referenced this pull request Jun 29, 2026
… progress tracker (#6616)

## Motivation

When the program deadlocks it can be hard to know how much work was
performed thus far, for example did it deadlock after only a couple of
communication calls or after a long time, is there only 1 call of 1
type? etc.

## Technical Details

builds with PROFILE=ON can produce call statistics (slowing down
execution btw), this can be triggered from the gdb attachement to get
the stat dump.

## JIRA ID

<!-- If applicable, mention the JIRA ID resolved by this PR (Example:
Resolves SWDEV-12345). -->
<!-- Do not post any JIRA links here. -->

## Test Plan

modified a functional test to intentionally deadlock. build with Debug
and PROFILE=ON.

```
ROCSHMEM_DEBUG_LEVEL=trace:stats ~/ompi/bin/mpirun -n 2 tests/functional_tests/rocshmem_functional_tests -n 1 -a 26  & (sleep 2; ../scripts/debug/attach_deadlock_analysis.sh rocshmem_functional_tests --stats )
```

Output file
```
=== rocSHMEM Deadlock Analysis ===
Process(es): 845512
Total GPU wavefronts analyzed: 1
Unique backtrace groups: 1

--- Group 1 (1 wavefront(s)) ---
  WFs: (0,0,0)/0
  Backtrace:
    #0  0x00007ae55f5afcf0 in rocshmem::uncached_load<long volatile> (src=0x7ae55fc04008) at src/assembly.hpp:125
    #1  rocshmem::Context::test<long> (this=0x7ae552407000, ivars=0x7ae55fc04008, cmp=0, val=1) at src/context_tmpl_device.hpp:432
    #2  rocshmem::Context::wait_until<long> (this=0x7ae552407000, ivars=0x7ae55fc04008, cmp=0, val=1) at src/context_tmpl_device.hpp:224
    #3  rocshmem::IPCContext::internal_direct_barrier (this=0x7ae552407000, pe=0, PE_start=0, stride=1, n_pes=2, pSync=0x7ae55fc04000) at build/src/ipc/context_ipc_device_coll.cpp:44
    #4  0x00007ae55f5b7c24 in rocshmem::IPCContext::internal_sync_wg (this=0x7ae552407000, pe=0, PE_start=0, stride=1, PE_size=2, pSync=0x7ae55fc04000) at build/src/ipc/context_ipc_device_coll.cpp:115
    #5  0x00007ae55f63d018 in rocshmem::IPCContext::sync_all_wg (this=0x7ae552407000) at build/src/ipc/context_ipc_device_coll.cpp:168
    #6  0x00007ae55f63d558 in rocshmem::IPCContext::barrier_all_wg (this=0x7ae552407000) at build/src/ipc/context_ipc_device_coll.cpp:187
    #7  0x00007ae55f63dedc in rocshmem::Context::barrier_all_wg (this=0x7ae552407000) at build/src/context_device.cpp:151
    #8  0x00007ae55f63e33c in rocshmem::rocshmem_barrier_all_wg () at build/src/rocshmem_gpu.cpp:885
    #9  0x00007ae55f6437cc in WorkGroupPrimitiveTest (loop=1, skip=10, start_time=0x7ae552431000, end_time=0x7ae552432000, source=0x7ae56d200480 "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr"..., dest=0x7ae56d300500 "1", size=1, type=WGPutTestType, ctx_type=4) at /home/abouteil/rocm-systems/projects/rocshmem/tests/functional_tests/workgroup_primitives.cpp:72
  [HINT] Waiting for remote PE memory update (barrier/sync or user rocshmem_wait_until). Check if the remote PE is alive and making progress. (at: #2  rocshmem::Context::wait_until<long> (this=0x7ae552407000, ivars=0x7ae55fc04008, cmp=0, val=1) at src/context_tmpl_device.hpp:224)

=== rocSHMEM Stats ===
  PE 0
  (counters reflect activity since process start)
  Device:
    quiet   1
    put_wg  704
  Host: (all zero)

=== Summary ===
  1 wavefront(s) inside rocSHMEM
  0 wavefront(s) in user code / other
```
Note the == rocshmem Stats == section contains the number of put and
quiet calls.


## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

---------

Signed-off-by: Aurelien Bouteiller <aurelien.bouteiller@amd.com>
Signed-off-by: Aurelien Bouteiller <abouteil@amd.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
vedithal-amd added a commit that referenced this pull request Jul 15, 2026
…8515)

## Motivation

Enable roofline in any ctest runs in test_profile_roofline* on gfx115x
systems.

## Technical Details

`skip_unsupported_roofline_soc()` was blocking gfx115x from running
becasue it was marked as unsupported soc until we could fully validate
and enable roofline on these systems. We are confident in their passing
so we are removing the gfx115x systems from this list.

## JIRA ID

AIPROFCOMP-677

## Test Plan

```
ctest --output-on-failure -R test_profile_general
ctest --output-on-failure -R test_profile_roofline
```

## Test Result

On gfx1151 gorgon halo system:
```
    Start 28: test_roofline_calc
1/3 Test #28: test_roofline_calc ...............   Passed    2.71 sec
    Start 29: test_roofline_analyze
2/3 Test #29: test_roofline_analyze ............   Passed   28.19 sec
    Start 30: test_roofline_main
3/3 Test #30: test_roofline_main ...............   Passed    2.67 sec

    Start 8: test_profile_roofline_1
1/2 Test #8: test_profile_roofline_1 ..........   Passed  708.39 sec
    Start 9: test_profile_roofline_2
2/2 Test #9: test_profile_roofline_2 ..........   Passed  226.78 sec
```


## Submission Checklist

- [X] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

---------

Signed-off-by: Carrie Fallows <Carrie.Fallows@amd.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: vedithal-amd <Vignesh.Edithal@amd.com>
cfallows-amd added a commit that referenced this pull request Jul 24, 2026
…8515)

## Motivation

Enable roofline in any ctest runs in test_profile_roofline* on gfx115x
systems.

## Technical Details

`skip_unsupported_roofline_soc()` was blocking gfx115x from running
becasue it was marked as unsupported soc until we could fully validate
and enable roofline on these systems. We are confident in their passing
so we are removing the gfx115x systems from this list.

## JIRA ID

AIPROFCOMP-677

## Test Plan

```
ctest --output-on-failure -R test_profile_general
ctest --output-on-failure -R test_profile_roofline
```

## Test Result

On gfx1151 gorgon halo system:
```
    Start 28: test_roofline_calc
1/3 Test #28: test_roofline_calc ...............   Passed    2.71 sec
    Start 29: test_roofline_analyze
2/3 Test #29: test_roofline_analyze ............   Passed   28.19 sec
    Start 30: test_roofline_main
3/3 Test #30: test_roofline_main ...............   Passed    2.67 sec

    Start 8: test_profile_roofline_1
1/2 Test #8: test_profile_roofline_1 ..........   Passed  708.39 sec
    Start 9: test_profile_roofline_2
2/2 Test #9: test_profile_roofline_2 ..........   Passed  226.78 sec
```


## Submission Checklist

- [X] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

---------

Signed-off-by: Carrie Fallows <Carrie.Fallows@amd.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: vedithal-amd <Vignesh.Edithal@amd.com>
vedithal-amd added a commit that referenced this pull request Jul 27, 2026
…8515)

## Motivation

Enable roofline in any ctest runs in test_profile_roofline* on gfx115x
systems.

## Technical Details

`skip_unsupported_roofline_soc()` was blocking gfx115x from running
becasue it was marked as unsupported soc until we could fully validate
and enable roofline on these systems. We are confident in their passing
so we are removing the gfx115x systems from this list.

## JIRA ID

AIPROFCOMP-677

## Test Plan

```
ctest --output-on-failure -R test_profile_general
ctest --output-on-failure -R test_profile_roofline
```

## Test Result

On gfx1151 gorgon halo system:
```
    Start 28: test_roofline_calc
1/3 Test #28: test_roofline_calc ...............   Passed    2.71 sec
    Start 29: test_roofline_analyze
2/3 Test #29: test_roofline_analyze ............   Passed   28.19 sec
    Start 30: test_roofline_main
3/3 Test #30: test_roofline_main ...............   Passed    2.67 sec

    Start 8: test_profile_roofline_1
1/2 Test #8: test_profile_roofline_1 ..........   Passed  708.39 sec
    Start 9: test_profile_roofline_2
2/2 Test #9: test_profile_roofline_2 ..........   Passed  226.78 sec
```


## Submission Checklist

- [X] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

---------

Signed-off-by: Carrie Fallows <Carrie.Fallows@amd.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: vedithal-amd <Vignesh.Edithal@amd.com>
amd-josnarlo pushed a commit that referenced this pull request Jul 28, 2026
…8515)

## Motivation

Enable roofline in any ctest runs in test_profile_roofline* on gfx115x
systems.

## Technical Details

`skip_unsupported_roofline_soc()` was blocking gfx115x from running
becasue it was marked as unsupported soc until we could fully validate
and enable roofline on these systems. We are confident in their passing
so we are removing the gfx115x systems from this list.

## JIRA ID

AIPROFCOMP-677

## Test Plan

```
ctest --output-on-failure -R test_profile_general
ctest --output-on-failure -R test_profile_roofline
```

## Test Result

On gfx1151 gorgon halo system:
```
    Start 28: test_roofline_calc
1/3 Test #28: test_roofline_calc ...............   Passed    2.71 sec
    Start 29: test_roofline_analyze
2/3 Test #29: test_roofline_analyze ............   Passed   28.19 sec
    Start 30: test_roofline_main
3/3 Test #30: test_roofline_main ...............   Passed    2.67 sec

    Start 8: test_profile_roofline_1
1/2 Test #8: test_profile_roofline_1 ..........   Passed  708.39 sec
    Start 9: test_profile_roofline_2
2/2 Test #9: test_profile_roofline_2 ..........   Passed  226.78 sec
```


## Submission Checklist

- [X] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

---------

Signed-off-by: Carrie Fallows <Carrie.Fallows@amd.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: vedithal-amd <Vignesh.Edithal@amd.com>
prasanna-amd added a commit that referenced this pull request Aug 20, 2026
… real headers

- Fix double-deref in KernelCh stop: combine per-channel and
  kernel-completion ref drops into a single atomic operation under the
  coll mutex, preventing negative refcount and use-after-free (#1)

- Add mutex to ProxyOpInfo, protect step timing accumulation from
  concurrent proxy thread writes (#2)

- Lock ProxyOp before memcpy into coll->proxyOps to prevent reading
  partially-written step data (#3)

- Move all pools (coll, proxyOp, proxyStep) from process-global statics
  into per-communicator acclCommContext, eliminating cross-comm pool
  starvation (#4)

- Fix fmt_size to show fractional values (1.5M instead of 1M) (#6)

- Fix bottleneck classifier denominator to use
  launch + max(kernel, proxy) instead of exec + launch, preventing
  percentages exceeding 100% due to kernel/proxy overlap (#7)

- Add --output flag to 'single' subcommand and clean up hasattr
  guard (#8)

- Switch output file from append to write mode to avoid stale data
  from PID reuse (#9)

- Replace vendored nccl/profiler.h with accl_shim.h that provides
  minimal types and includes RCCL's real profiler_v5.h; add
  CMakeLists.txt for in-tree builds (#10)
prasanna-amd added a commit that referenced this pull request Aug 26, 2026
…ntegration

Add monotonic generation counter per pool slot to detect stale callbacks
from reclaimed collectives, resolving the 0==0 race in pool reclaim and
all callback-lifetime concerns (threads #4, #6, #8, #9).

Add atomic ref-count to acclCommContext so acclPluginFinalize defers free()
until all outstanding callbacks have drained (thread #2).

Wire accl plugin into the parent RCCL CMake build (thread #20), add
CXX_VISIBILITY_PRESET/VISIBILITY_INLINES_HIDDEN (thread #1), and bump
ACCL_MAX_CHANNELS from 64 to 256 (thread #11).

Fix acclShouldFinalize: nChannels==0 collectives (onerank path) finalize
immediately on coll stop; guard channelId against nChannels (thread #10, #12).
Free leaked ProxyOp when coll's proxyOpIndices is full (thread #13).
Rename firstCpuStart to firstKernelCpuStartUs for clarity (thread #14).

Fix warmup off-by-one (sn <= warmup → sn < warmup, thread #7), use
try/finally for output file handle (thread #15), fix test fixtures to
start at coll_sn=0 (thread #16), remove stale ACCL_PROFILER_WARMUP_ITERS
docs (thread #17), sync bottleneck categories with classify() (thread #18),
add NVIDIA Apache-2.0 header to accl_shim.h (thread #19).

Add tests: ProxyStep lifecycle, channel bounds, kernel timing assertions
(threads #3, #12, #21).
mch added a commit that referenced this pull request Aug 26, 2026
Add Test #3 -- when the network reports an in-progress put done,
ncclRmaProxyPollNonPersistCompletion returns the credit
(inflightRequests--), nulls the request, publishes opSeq into doneSeq,
dequeues the descriptor, and destroys it. Adds the PushInProgressPutSignal
fixture helper the completion-side tests (#4/#8/#9) build on.

Co-authored-by: Pi Agent
bwelton added a commit that referenced this pull request Aug 27, 2026
bwelton added a commit that referenced this pull request Aug 31, 2026
bwelton added a commit that referenced this pull request Aug 31, 2026
bwelton added a commit that referenced this pull request Sep 1, 2026
bwelton added a commit that referenced this pull request Sep 1, 2026
venkat1361 pushed a commit that referenced this pull request Sep 1, 2026
…10809)

## Summary
Addresses a 15-point static re-review of the KFD dispatch-log
signal-less path (on top of `review-fixes`). Each finding was evaluated
against the code and the prior design history; this PR **fixes the
genuine correctness/safety/resource issues** (potential misattribution,
UAF on terminal teardown, unbounded pairer-map growth, plus
FATAL-handling, env-race, and robustness items) and **documents the ones
intentionally left as accepted residuals or pre-existing**, with
rationale. `+365 / −49` across 9 files.

## Fixed

- **#4 (misattribution) — validate identity before claiming an
unknown-START EOP.** The unknown-START path in
`dispatch_hub.hpp::record_kernel_end` took the sole first-owner entry
with no timestamp check, and terminal-time validation ran only *after*
the entry was consumed/retired — so a stale EOP could claim a newer
dispatch's entry. Now rejects an EOP whose `end_ticks <= window.t_open`
(a kernel cannot end at/before its window opened; same GPU-tick domain
the known-START path already uses) **before** taking the entry, so a
rejected EOP consumes/retires nothing. Fail-first verified.
- **#3 + #2 (UAF) — the terminal fences are now truly terminal
(fail-closed).** `signal_less_fence_completions()` previously quiesced
visible work but did not stop the reader on success, so a still-PENDING
kernel could complete after the client's callback/buffer state
(detach/finalize, F23) or the HSA runtime (final `hsa_shut_down`, F24)
was freed. A new `signal_less_terminal_stop()` (factored from teardown)
latches disable → stops+joins the reader/processor → drains+ledgers
PENDING, and is called from the F23/F24 sites. Verified deadlock-free
(never joins its own task group, holds no lock across the join, joined
threads never block on the joiner) and 5/5 clean under a shutdown
watchdog. The existing `get_fini_status()` re-entry guard (the earlier
crash fix) is preserved.
- **#11 (unbounded growth) — hard size cap on the pairer START map.**
`pair_state::pending_starts` was bounded only by a 30-minute age timer.
Added `ROCPROFILER_KFD_DISPATCH_LOG_MAX_PENDING_STARTS` (default 2M,
shared reject-and-default parser) with oldest-first eviction (recurring
key exempted so the `ambiguous` latch is preserved).
- **#7 (coverage) + #10 (liveness) — FATAL handling.** FATAL now latches
admission and waits for the processor to consume the already-published
pipe **before** draining the hub (so a fatal session's final EOP and
healthy-GPU EOPs behind it aren't dropped), and the FATAL status is
re-probed while the empty-wake backstop is tripped (so a fatal stream
that produces no records is still detected).
- **#5 (robustness) — master switch is a strict fail-closed opt-in.**
`ROCPROFILER_KFD_DISPATCH_LOG_SIGNAL_LESS` now accepts only explicit
true values; anything else is disabled with a one-time warning (no throw
on malformed input).
- **#9 (arg-order) — deterministic GC-gate operand ordering.**
`gc_gate_open`'s two operands are read into named locals in the intended
order rather than relying on unspecified argument-evaluation order.
- **#12 (race) — env knobs primed at serialized init.** The
age/cap/quiesce/switch env reads are populated during reader start-up
rather than lazily on a worker thread.
- **#14(b) — fork child no longer hangs in `interposition_fini()`.** A
normal (non-exec) child now short-circuits `interposition_fini()` under
the existing `fork_stale()` guard, avoiding a wlock on a registry a
vanished parent thread may hold.

## Intentionally not changed (accepted residuals / design decisions /
pre-existing)

- **#1 — teardown coverage loss** (a kernel in flight at exit may emit
no record): the accepted D8/F1 coverage residual. The *UAF* variant of
this concern is #3, which is fixed.
- **#8 — equal-tick START/EOP**: the accepted D1 residual. The code
emits a **no-timing / zero-duration drop**, not a fabricated 1 ns; no
misattribution.
- **#9-main — GC gate "race"**: the copied-but-still-in-ring window is
the accepted **R10** residual (an EOP still in the ring is intentionally
not gated), and cap-eviction's bypass of the in-flight gate is D9's
documented coverage-loss residual. The operand-ordering nit is fixed
(#9-arg above); the residual is by design (coverage loss, never
misattribution).
- **#13 — cross-batch inversion**: the explicitly-accepted D1 residual
(coverage loss under queue churn, never misattribution). A cross-batch
reorder buffer is a larger design change weighed against measured
coverage impact, which the benchmarks do not show hitting.
- **#6 — completion-callback self-deadlock**: a **pre-existing**
reentrancy defect on the generic signal path (a client callback that
calls its own finalize). The new terminal-stop path was specifically
designed **not** to add another instance of it.
- **#14(a) — session mid-construction skipped by a concurrent fork**: a
child-lifetime resource leak (not a hang); the parent is unaffected and
the child drops it at exit. The "fix" would introduce a formal data race
on an `smap` pointer a vanished thread was mid-write on, to reclaim
memory about to be freed — not worth it. Left as-is.
- **#15 — eager arming on a registered (vs active) context**: an
efficiency consideration, not a correctness issue; arming stays gated on
a registered kernel-dispatch context.

## Known residuals in the fixes (documented)
- #4 adds no upper time bound (an implausibly-future EOP is still taken
and rejected by the finalizer as no-timing, never misattributed).
- #10 restores FATAL *detection* under the backstop; a *persistently
failing* status ioctl still isn't fail-closed (separate follow-up).
- #11 eviction is O(live) per over-cap insert (same tradeoff as the D9
cap; only reached under pathological EOP loss).

## Testing (MI350, host ROCm 7.2.1, build `fd06e1407c`)
- Build clean at the project warning level — **0 new warnings**.
- `ctest -L kfd-dlog` — **90/90 pass** (incl. 2 new tests: pairer-map
cap, strict opt-in).
- ThreadSanitizer, all 8 kfd-dlog suites — **90/90, zero reports**
(covers the terminal-stop join, FATAL drain-wait, GC-gate ordering).
- Shutdown crash/hang reproducer (1040), **5 runs under a watchdog — 5/5
clean, no hang, no crash** (the decisive check for the terminal-stop
rework).
- 1041-d (20k kernels ×3), 1031, 1041-a, 1041-c — all pass, no
attribution regression.
- graph-perf — **−44.21%** overhead reduction,
`register-refused=0`/block (no throughput regression).

## Tracking
JIRA ID: AIPROFSDK-1012 AIPROFSDK-1040 AIPROFSDK-1041
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant