Skip to content

Conversation

@vfdev-5
Copy link
Contributor

@vfdev-5 vfdev-5 commented May 5, 2023

Description:

Context: In torchvision we ensure that functional ops are torchscriptable. Recently exposed torch.backends.cpu.get_cpu_capability() in #100164 is failing in torchvision CI

RuntimeError:
Python builtin <built-in function _get_cpu_capability> is currently not supported in Torchscript:
  File "/usr/local/lib/python3.10/dist-packages/torch/backends/cpu/__init__.py", line 17
    - "AVX512"
    """
    return torch._C._get_cpu_capability()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE

Ref: pytorch/vision#7557

In this PR, torch._C._get_cpu_capability() is explicitly registered for JIT and tested.

cc @NicolasHug

@pytorch-bot pytorch-bot bot added the release notes: jit release notes category label May 5, 2023
@pytorch-bot
Copy link

pytorch-bot bot commented May 5, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/100723

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure

As of commit 19d77cb:

NEW FAILURE - The following job has failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please let me know where to put this test if it is inappropriate to put it here

@vfdev-5 vfdev-5 requested a review from albanD May 5, 2023 15:54
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Note that TorchScript is not really maintained anymore and we recommend users stop using it.
I'm happy to accept this one as it is pretty benign.

Context: In torchvision we ensure that functional ops are torchsciptable.
Recently exposed `torch.backends.cpu.get_cpu_capability()` in pytorch#100164 is failing in torchvision CI
```
RuntimeError:
Python builtin <built-in function _get_cpu_capability> is currently not supported in Torchscript:
  File "/usr/local/lib/python3.10/dist-packages/torch/backends/cpu/__init__.py", line 17
    - "AVX512"
    """
    return torch._C._get_cpu_capability()
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
```
Ref: pytorch/vision#7557

In this PR, `torch._C._get_cpu_capability()` is explicitly registered for JIT and tested.
@vfdev-5 vfdev-5 force-pushed the jit_get_cpu_capability branch from 98bd69e to 19d77cb Compare May 8, 2023 20:04
@vfdev-5
Copy link
Contributor Author

vfdev-5 commented May 8, 2023

Note that TorchScript is not really maintained anymore and we recommend users stop using it. I'm happy to accept this one as it is pretty benign.

Yes, we know that but we keep it in torchvision due to BC

@vfdev-5
Copy link
Contributor Author

vfdev-5 commented May 9, 2023

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label May 9, 2023
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@vfdev-5 vfdev-5 deleted the jit_get_cpu_capability branch May 9, 2023 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source release notes: jit release notes category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants