Skip to content

[ROCm] Remove BF16 workaround now that Paddle framework supports HIP BF16#5082

Open
Lau-JW wants to merge 1 commit into
PaddlePaddle:developfrom
Lau-JW:fix/rocm-bf16-workaround
Open

[ROCm] Remove BF16 workaround now that Paddle framework supports HIP BF16#5082
Lau-JW wants to merge 1 commit into
PaddlePaddle:developfrom
Lau-JW:fix/rocm-bf16-workaround

Conversation

@Lau-JW

@Lau-JW Lau-JW commented Apr 13, 2026

Copy link
Copy Markdown

Description

Remove BF16 workarounds for ROCm now that Paddle framework supports HIP BF16 precision type.

Changes

  1. paddlex/inference/utils/misc.py: Add "dcu" device to is_bfloat16_available() function

  2. paddlex/inference/models/doc_vlm/modeling/paddleocr_vl/_paddleocr_vl.py: Set _keep_in_fp32_modules = None instead of ["visual", "mlp_AR"]

Motivation

Previously PaddleX had workarounds because Paddle framework did not support HIP BF16:

  • is_bfloat16_available() returned False for ROCm
  • Visual encoder forced to FP32 via _keep_in_fp32_modules

Now that Paddle framework supports HIP BF16 (PR: PaddlePaddle/Paddle#78665), these workarounds can be removed.

Related Issues

Fixes #5081

Checklist

  • Code is formatted per PaddleX coding conventions
  • Unit tests pass
  • Documentation updated if needed

- Add 'dcu' device to is_bfloat16_available()
- Remove _keep_in_fp32_modules restriction for visual/mlp_AR
- BF16 is now supported on ROCm after Paddle framework fix
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@paddle-bot

paddle-bot Bot commented Apr 13, 2026

Copy link
Copy Markdown

Thanks for your contribution!

@paddle-bot paddle-bot Bot added the contributor External developers label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants