-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Use torch.accelerator API in Fast Neural Style example #1327
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
Conversation
✅ Deploy Preview for pytorch-examples-preview canceled.
|
Cool! Although looks like you're not using the right pytorch version quite yet, you can be explicit see how we use requirements.txt in the repo within given folders |
I think I might need help with the requirements part of the story. Here is a snapshot of what was executed by ci (https://github.com/pytorch/examples/actions/runs/14539355819/job/40795679639?pr=1327):
I think that CI attempted to test the latest nightly, at least this implies that:
Then, test shell script downgraded already installed nightly torch to version 2.5.0. My guess is due to pinned version of torchvision in some of the requirements.txt files: examples/dcgan/requirements.txt Line 2 in 8393ceb
Also note:
|
Filed #1329 to discuss further. |
`torch.accelerator` API allows to abstract some of the accelerator specifics in the user scripts. This commit modifies Fast Neural Style example with the mentioned API. Things to note: * Commit modifies example command line by replacing accelerator specific flags (`--cuda`, `--mps`, `--xpu`) with the --accel * `torch.accelerator` API appeared in pytorch 2.6, so commit binds example to this torch version * Commit introduces `USE_ACCEL` flag for the test `*.sh` script. At the moment this flag is just an alias for `USE_CUDA`. In the future it should replace `USE_CUDA` once all examples will be converted to use `torch.accelerator` API. Signed-off-by: Dmitry Rogozhkin <[email protected]>
@msaroufim : I've rebased this PR on top of Friday's changes. Note that I suggest to change |
torch.accelerator API allows to abstract some of the accelerator specifics in the user scripts. This commit modifies Fast Neural Style example with the mentioned API.
Things to note:
--cuda
,--mps
,--xpu
) with the--accel
.torch.accelerator
API appeared in pytorch 2.6, so commit binds example to this torch versionUSE_ACCEL
flag for the test*.sh
script. At the moment this flag is just an alias forUSE_CUDA
. In the future it should replaceUSE_CUDA
once all examples will be converted to usetorch.accelerator
API.CC: @malfet, @atalman