intel / intel/torch-xpu-ops

[upstream_ut] test_grad_scaler_deprecated_warning_xpu: wrong deprecation message (cpu instead of xpu)

Open Beginner friendly
#5,308 1 comment 0 reactions 0 assignees View on GitHub
test: ut
Dominant language
Python
Stars
113
Forks
128
Avg merge
5d 9h
Merged PRs (30d)
112

Description

## Description
`test_grad_scaler_deprecated_warning_xpu` expects a `torch.xpu.amp.GradScaler` deprecation warning but the emitted warning refers to `torch.cpu.amp.GradScaler`.

## Error log
```
AssertionError: "`torch.xpu.amp.GradScaler\(args...\)` is deprecated." does not match "`torch.cpu.amp.GradScaler(args...)` is deprecated. Please use `torch.amp.GradScaler('cpu', args...)` instead."
```

## Reproduce
Using pytorch/pytorch#196421 on a PVC machine:
```
python test/test_torch.py TestTorchDeviceTypeXPU.test_grad_scaler_deprecated_warning_xpu
```

## Expected
torch.xpu.amp.GradScaler emits an xpu-specific deprecation message referencing torch.amp.GradScaler('xpu', ...).

_Filed with AI assistance; reproduced per the details above._

Contributor guide

Open the contributing guide

Research direction

Run test/test_torch.py with TestTorchDeviceTypeXPU.test_grad_scaler_deprecated_warning_xpu to reproduce the mismatch. Trace the deprecation warning for torch.xpu.amp.GradScaler and update it so the message references torch.amp.GradScaler('xpu', ...), then rerun the named test to confirm the expected wording.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.