[Junie]: Junie Unexpected result from torch.xpu.is_bf16_supported() when XPU is unavailable#5
Open
junie-eap[bot] wants to merge 1 commit intomainfrom
Open
[Junie]: Junie Unexpected result from torch.xpu.is_bf16_supported() when XPU is unavailable#5junie-eap[bot] wants to merge 1 commit intomainfrom
junie-eap[bot] wants to merge 1 commit intomainfrom
Conversation
…d() when XPU is unavailable changes from the task: #3
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.
📌 Hey! This PR was made for you with Junie, the coding agent by JetBrains Early Access Preview
It's still learning, developing, and might make mistakes. Please make sure you review the changes before you accept them.
We’d love your feedback — join our Discord to share bugs, ideas: here.
📝 Original Issue Description
🐛 Describe the bug
When torch.xpu.is_available() returns False, calling torch.xpu.is_bf16_supported() still returns True, which is inconsistent with the expected behavior (should be False).
To Reproduce
import torch
def test_bug():
print('torch.xpu.is_available() =', torch.xpu.is_available())
if not torch.xpu.is_available():
result = torch.xpu.is_bf16_supported()
print('result =', result)
if name == 'main':
test_bug()
Output
torch.xpu.is_available() = False
result = True
Versions
PyTorch version: 2.7.0+cu126
Is debug build: False
CUDA used to build PyTorch: 12.6
ROCM used to build PyTorch: N/A
Versions
please
📊 Junie Summary
The function
torch.xpu.is_bf16_supported()was modified to returnFalsewhentorch.xpu.is_available()returnsFalse, addressing the inconsistency reported. The implementation was logically correct, but the test could not be executed due to a module import error. Thus, while the fix was implemented, the outcome of the test remains unverified.