Skip to content

[ROCm] Add CINN HIP BF16 codegen support#54

Open
austin1997 wants to merge 1 commit into
ROCm:paddle_hackthonfrom
austin1997:rocm-bf16-cinn-hip-codegen
Open

[ROCm] Add CINN HIP BF16 codegen support#54
austin1997 wants to merge 1 commit into
ROCm:paddle_hackthonfrom
austin1997:rocm-bf16-cinn-hip-codegen

Conversation

@austin1997

Copy link
Copy Markdown

PR Category

Custom Device

PR Types

Bug fixes

Description

Add BF16 type support to CINN HIP device code generation.

This PR:

  • Includes bfloat16.h in the HIP device source header and exports CINN bfloat16 vector aliases.
  • Adds a CINN_WITH_HIP branch in cinn/common/bfloat16.h that uses ROCm hip_bfloat16 for device-side float/BF16 conversion when HIP_VERSION >= 60100000.
  • Adds a ROCm-guarded header coverage check in the CINN compilation task test source.

Verification:

  • cmake .
  • env TARGET=SKYLAKEX ninja -j 160 paddle_python
  • HIPCC compile test for CINN_WITH_HIP bfloat16 construction, conversion, and to_hip_bfloat16 on gfx942
  • prek run --files paddle/cinn/backends/hip/codegen_hip_dev.cc paddle/cinn/common/bfloat16.h test/cpp/pir/cinn/compilation_task_test.cc
  • git diff --check

Note: the current local build configuration does not generate test_compilation_task in CTest (ctest -N -R test_compilation_task reports 0 tests), so the added gtest is covered when CINN tests are enabled.

是否引起精度变化

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