Skip to content

[rocprofiler-compute] Add gfx arch. based pre-processor guards and runtime checks in rocflop.cpp - #2487

Merged
vedithal-amd merged 4 commits into
developfrom
users/vedithal/rocprofiler-compute/fix-rocflop
Jan 6, 2026
Merged

vedithal-amd merged 4 commits into
developfrom
users/vedithal/rocprofiler-compute/fix-rocflop

Conversation

@vedithal-amd

@vedithal-amd vedithal-amd commented Jan 5, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Add gfx arch. based pre-processor guards and runtime checks in rocflop.cpp for following support matrix:

MFMA (Matrix operation) : Only supported > gfx906 (greater than MI 50)

SMFMAC (sparse MFMA): Only supported > gfx908 (greater than MI 100)

This solves the build issue on MI 50 and MI 100 where the following intrinsics dont work respectively __builtin_amdgcn_mfma_f32* and __builtin_amdgcn_smfmac_f32*

This issue was introduced in #2418

This PR is related to #2456

Technical Details

JIRA ID

Test Plan

In tests/CMakeLists.txt set set(CMAKE_HIP_ARCHITECTURES "gfx906" CACHE STRING "GPU architectures to compile for" FORCE) to build rocprofiler-compute for MI 50 even though the GPU on the system might be different.

In tests/CMakeLists.txt set set(CMAKE_HIP_ARCHITECTURES "gfx908" CACHE STRING "GPU architectures to compile for" FORCE) to build rocprofiler-compute for MI 50 even though the GPU on the system might be different.

Test Result

Ensure build works fine in both the cases

Submission Checklist

Copilot AI review requested due to automatic review settings January 5, 2026 18:27
@vedithal-amd
vedithal-amd requested a review from a team as a code owner January 5, 2026 18:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request removes MFMA (Matrix Fused Multiply-Add) functionality from the rocflop sample to fix build issues on MI50 GPUs, which do not support the __builtin_amdgcn_mfma_f32* intrinsics. The removal is clean and comprehensive, eliminating all MFMA-related code paths.

Key Changes:

  • Removed MFMA kernel functions (matmul_fp16_throughput and matmul_fp32_throughput) that used unsupported intrinsics
  • Removed MFMA-related test infrastructure and result tracking
  • Removed command-line options for MFMA tests (--matfp16 and --matfp32)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@feizheng10 feizheng10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Technically, the code should be designed as detecting arch properly, right?

@vedithal-amd vedithal-amd changed the title [rocprofiler-compute] Remove MFMA functionality in rocflop sample since its not supported in MI50 [rocprofiler-compute] Add gfx arch. based pre-processor guards and runtime checks in rocflop.cpp Jan 5, 2026
@vedithal-amd

Copy link
Copy Markdown
Contributor Author

@benrichard-amd , this might be useful for you to expand support for MI50 and MI100

@vedithal-amd

Copy link
Copy Markdown
Contributor Author

@feizheng10 can you have a look again

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@benrichard-amd

Copy link
Copy Markdown
Contributor

@benrichard-amd , this might be useful for you to expand support for MI50 and MI100

Hi. I updated https://github.com/benrichard-amd/rocflop with improved compile time and runtime detection.

@vedithal-amd
vedithal-amd merged commit e005f84 into develop Jan 6, 2026
28 checks passed
@vedithal-amd
vedithal-amd deleted the users/vedithal/rocprofiler-compute/fix-rocflop branch January 6, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants