Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_is_bf16_available judgment supports npu #5193

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Conversation

Ricardo-L-C
Copy link
Contributor

What does this PR do?

transformers.utils.is_torch_bf16_gpu_available currently only supports checking for GPU/CUDA availability, and transformers do not provide a similar interface for NPU. This results in llama-factory incorrectly determining that the device does not support NPU (such as Ascend 910B) when using NPU for inference. That is, when inferencing without specifying infer_dtype, it will automatically fall back to fp16 instead of bf16.

Before submitting

@hiyouga hiyouga self-requested a review August 19, 2024 15:32
Copy link
Owner

@hiyouga hiyouga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hiyouga hiyouga merged commit 5d5bfc8 into hiyouga:main Aug 19, 2024
1 check passed
@hiyouga hiyouga added the solved This problem has been already solved label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants