Skip to content

gfx1250: use hipblaslt device alpha for NVFP4 GEMM - #766

Open
matthiasdiener wants to merge 7 commits into
devfrom
mdiener/nvfp4-gfx1250-dev-alpha
Open

matthiasdiener wants to merge 7 commits into
devfrom
mdiener/nvfp4-gfx1250-dev-alpha

Conversation

@matthiasdiener

@matthiasdiener matthiasdiener commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Makes use of ROCm/rocm-libraries#13482, but falls back transparently if device alpha support is not available.

Performance results: https://github.com/AMD-ROCm-Internal/frameworks-internal/issues/389#issuecomment-6299513129

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

Please list the changes introduced in this PR:

  • Change A
  • Change B

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@matthiasdiener matthiasdiener self-assigned this Oct 16, 2026
@matthiasdiener matthiasdiener added the ci-level 1 CI test level 1 label Oct 16, 2026
@matthiasdiener matthiasdiener changed the title gfx1250: use hipblaslt device scalar alpha for NVFP4 GEMM gfx1250: use hipblaslt device alpha for NVFP4 GEMM Oct 19, 2026
@Micky774 Micky774 added the P2 Priority 2: normal label Oct 19, 2026
@matthiasdiener
matthiasdiener marked this pull request as ready for review October 20, 2026 20:47
const float fp8_max = te_fp8_fnuz() ? 240.0f : 448.0f;
const float factor_inv = 1.0f / (fp4_max * fp4_max * fp8_max * fp8_max);
// 4over6 tensors carry an E4M3 bound of 256, not 448.
const float fp8_max_A = te_fp8_fnuz() ? 240.0f : static_cast<float>(inputA.nvfp4_e4m3_max);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

NVFP4 is not supported on gfx942 so do not need to check for fnuz

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the check in 190401a.

list(APPEND transformer_engine_LINKER_LIBS hiprtc)
find_package(hipblaslt)
list(APPEND transformer_engine_LINKER_LIBS roc::hipblaslt)
# Device scalar alpha (ROCm/rocm-libraries#13482) is not tied to a hipBLASLt version.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not tied yet? If it is not part of ROCm release it only works as developer feature

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Rephrased it to saying that it is not in a hipblaslt release yet in 190401a. In this case, the code from this PR will fall back to the previous implementation.

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

Labels

ci-level 1 CI test level 1 P2 Priority 2: normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants