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

[E2E] Yolo3 will failed with pytorch pinned torchbench for XPU lost #1229

Open
mengfei25 opened this issue Dec 28, 2024 · 1 comment
Open

Comments

@mengfei25
Copy link
Contributor

🐛 Describe the bug

python benchmarks/dynamo/torchbench.py --accuracy --bfloat16 -d xpu -n10 --training --only yolov3 --backend=inductor

Traceback (most recent call last):
File "/home/sdp/actions-runner/_work/torch-xpu-ops/pytorch/benchmarks/dynamo/common.py", line 4886, in run
) = runner.load_model(
File "/home/sdp/actions-runner/_work/torch-xpu-ops/pytorch/benchmarks/dynamo/torchbench.py", line 312, in load_model
benchmark = benchmark_cls(
File "/home/sdp/actions-runner/_work/torch-xpu-ops/benchmark/torchbenchmark/util/model.py", line 24, in call
obj = type.call(cls, *args, **kwargs)
File "/home/sdp/actions-runner/_work/torch-xpu-ops/benchmark/torchbenchmark/models/yolov3/init.py", line 58, in init
self.training_loop, self.model, self.example_inputs = prepare_training_loop(
File "/home/sdp/actions-runner/_work/torch-xpu-ops/benchmark/torchbenchmark/models/yolov3/yolo_train.py", line 630, in prepare_training_loop
device = torch_utils.select_device(
File "/home/sdp/actions-runner/_work/torch-xpu-ops/benchmark/torchbenchmark/models/yolov3/yolo_utils/torch_utils.py", line 31, in select_device
assert torch.cuda.is_available(), 'CUDA unavailable, invalid device %s requested' % device # check availablity
AssertionError: CUDA unavailable, invalid device xpu requested

https://github.com/pytorch/benchmark/blob/766a5e3a189384659fd35a68c3b17b88c761aaac/torchbenchmark/models/yolov3/yolo_utils/torch_utils.py#L28-L31

def select_device(device='', apex=False, batch_size=None):
    # device = 'cpu' or '0' or '0,1,2,3'
    cpu_request = device.lower() == 'cpu'
    if device and not cpu_request:  # if device requested other than 'cpu'
        os.environ['CUDA_VISIBLE_DEVICES'] = device  # set environment variable
        assert torch.cuda.is_available(), 'CUDA unavailable, invalid device %s requested' % device  # check availablity

Versions

Torchbench: 766a5e3a189384659fd35a68c3b17b88c761aaac

@mengfei25
Copy link
Contributor Author

Skipped in CI & Nightly test #1230

github-merge-queue bot pushed a commit that referenced this issue Dec 31, 2024
Temporary WA for #1229
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant