[BugFix][HPU] Add paddle.compat compatibility check for HPU environment#6387
Draft
mattheliu wants to merge 3 commits intoPaddlePaddle:developfrom
Draft
[BugFix][HPU] Add paddle.compat compatibility check for HPU environment#6387mattheliu wants to merge 3 commits intoPaddlePaddle:developfrom
mattheliu wants to merge 3 commits intoPaddlePaddle:developfrom
Conversation
Some Paddle versions (e.g., PaddlePaddle 3.1.1 on Intel HPU) do not have the paddle.compat module, causing AttributeError during FastDeploy import. This fix adds a hasattr check before calling paddle.compat.enable_torch_proxy() to ensure compatibility across different Paddle versions and hardware platforms. Co-Authored-By: Claude (Claude Opus 4.5) <noreply@anthropic.com>
|
Thanks for your contribution! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6387 +/- ##
==========================================
Coverage ? 68.23%
==========================================
Files ? 391
Lines ? 52242
Branches ? 8147
==========================================
Hits ? 35649
Misses ? 13986
Partials ? 2607
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ibility Add hasattr check before calling paddle.compat.enable_torch_proxy() in flash_attn_backend.py to fix HPU CI failure. Paddle stable versions (e.g., 3.1.1 on HPU) don't have the compat module. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Fix FastDeploy import failure on Intel HPU (Habana Gaudi) environment.
In HPU environment, PaddlePaddle 3.1.1 (stable) does not have the
paddle.compatmodule (introduced in 2025-09-05), causing anAttributeErrorduring FastDeploy import:Modifications
Add
hasattrcheck before callingpaddle.compat.enable_torch_proxy()to ensure compatibility across different Paddle versions and hardware platforms.Modified files:
Usage or Command
No special command needed. After this fix, FastDeploy can be imported normally on HPU environment.
Accuracy Tests
paddle.compatpaddle.compat, the call is skipped to avoid errorsChecklist
pre-commitbefore commit.