Skip to content

[Common] Move NVFP4 scale traits to a separate header - #3

Closed
kainzhong wants to merge 1 commit into
timmoon10:nvfp4-ue5m3-prototypefrom
kainzhong:nvfp4-ue5m3-prototype-fix
Closed

[Common] Move NVFP4 scale traits to a separate header#3
kainzhong wants to merge 1 commit into
timmoon10:nvfp4-ue5m3-prototypefrom
kainzhong:nvfp4-ue5m3-prototype-fix

Conversation

@kainzhong

@kainzhong kainzhong commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

TODO: hum maybe should use NVIDIA#3392 instead

Description

Fix the CI compilation failure. The failure is because when we compile
transformer_engine/common/gemm/cublaslt_grouped_gemm.cu it includes
--> transformer_engine/common/cast/nvfp4/core_nvfp4.cuh which includes
--> transformer_engine/common/util/ptx.cuh
where ptx.cuh hits this assertion on CI

#35 50.63   /opt/transformerengine/transformer_engine/common/gemm/../cast/nvfp4/../../util/ptx.cuh(55): error: static assertion failed with "Compiled for the generic architecture, while utilizing family-specific features. Please compile for smXXXf architecture instead of smXXX architecture."
#35 50.63           static_assert(FamilySpecific == CurrentArch,
#35 50.63           ^
#35 50.63   /opt/transformerengine/transformer_engine/common/gemm/../cast/nvfp4/../../util/ptx.cuh(55): note #3453-D: the final comparison was 0 == 1000
#35 50.63           static_assert(FamilySpecific == CurrentArch,
#35 50.63                                        ^
#35 50.63             detected during:

because gemm/cublaslt_grouped_gemm.cu is listed under transformer_engine_cuda_sources so it's not compiled by "f" suffix (those should be listed under transformer_engine_cuda_arch_specific_sources)

This PR moves the newly added chage to a separate file which doesn't include ptx.cuh to avoid this compile time assertion.

TODO: or I should split ptx.cuh to ptx.cuh and ptx_arch_spec.cuh instead

Fixes # (issue)

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

  • Moved NVFP4 scale trait to a separate file

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

@kainzhong kainzhong changed the title [Common] Move NVFP4 scale traits to a seperate header [Common] Move NVFP4 scale traits to a separate header Aug 13, 2026
Signed-off-by: Kaining Zhong <kainingz@nvidia.com>
@kainzhong
kainzhong force-pushed the nvfp4-ue5m3-prototype-fix branch from fd2f10a to c2d9c99 Compare August 13, 2026 23:46
@kainzhong kainzhong closed this Aug 18, 2026
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