Skip to content

instanceNormalizationPlugin: use public __half2float instead of private __internal_half2float#4819

Draft
pctablet505 wants to merge 1 commit into
NVIDIA:mainfrom
pctablet505:fix-4810-instancenorm-half2float
Draft

instanceNormalizationPlugin: use public __half2float instead of private __internal_half2float#4819
pctablet505 wants to merge 1 commit into
NVIDIA:mainfrom
pctablet505:fix-4810-instancenorm-half2float

Conversation

@pctablet505

Copy link
Copy Markdown

Fixes #4810.

Both instanceNormalizationPlugin.cu and instanceNormalizationPluginLegacy.cu convert half-precision scale/bias weights to float with __internal_half2float, a private static inline helper defined inside cuda_fp16.hpp rather than part of the public CUDA API. It compiles under nvcc, which brings the helper into scope, but fails under other CUDA-compatible compilers (e.g. clang-CUDA) with an undeclared-identifier error, and would also block a HIP/ROCm port.

This wraps the raw bits in a __half_raw and calls the public __half2float instead, which performs the same conversion (verified against all bit patterns of interest — zero, subnormal, normal, infinities). No behavior change under nvcc, just a documented public API instead of a private header internal.

…alf2float

Both instanceNormalizationPlugin.cu and instanceNormalizationPluginLegacy.cu
convert half-precision scale/bias weights to float using
__internal_half2float, a private static inline helper defined inside
cuda_fp16.hpp rather than part of the public CUDA API. This compiles under
nvcc, which brings the helper into scope, but fails under other
CUDA-compatible compilers such as clang-CUDA with an undeclared identifier
error, and would block a HIP/ROCm port.

Wrap the raw bits in a __half_raw and call the public __half2float instead.
This performs the same conversion with no change in numeric behavior, but
only relies on documented public API.

Signed-off-by: pctablet505 <pctablet505@gmail.com>
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.

instanceNormalizationPlugin: use public __half2float instead of private __internal_half2float

1 participant