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

[py][vulkan] Add is_vulkan to py api, add vulkan to device type parsing #46511

Closed
wants to merge 5 commits into from

Conversation

IvanKobzarev
Copy link
Contributor

@IvanKobzarev IvanKobzarev commented Oct 17, 2020

Stack from ghstack:

Differential Revision: D24379422

Exposing Vulkan backend to python api:

  1. Adding parsing for 'vulkan' to DeviceType::Vulkan
  2. Adding is_vulkan for Tensor as alias to check tensor.device.type=='vulkan'

Testing:

t = torch.randn(1, 3, 224, 224)
t_v = t.to(device='vulkan')
print("t.is_vulkan():", t.is_vulkan)

before: did not work
after: works ok

IvanKobzarev added a commit that referenced this pull request Oct 17, 2020
ghstack-source-id: 2972848552124582854c723d2190ae6353a8ae01
Pull Request resolved: #46511
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Oct 17, 2020

💊 CI failures summary and remediations

As of commit be4442f (more details on the Dr. CI page):


  • 2/2 failures introduced in this PR---

2 failures not recognized by patterns:

Job Step Action
CircleCI pytorch_linux_xenial_cuda10_2_cudnn7_py3_gcc7_test1 Run tests 🔁 rerun
CircleCI pytorch_linux_xenial_cuda10_2_cudnn7_py3_gcc7_test2 Run tests 🔁 rerun
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 3 times.

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Oct 17, 2020
@dr-ci
Copy link

dr-ci bot commented Oct 17, 2020

💊 CI failures summary and remediations

As of commit d8aee08 (more details on the Dr. CI page):


  • 2/5 failures possibly* introduced in this PR
    • 1/2 non-CircleCI failure(s)
  • 3/5 broken upstream at merge base 187e233 since Oct 20

1 job timed out:

  • pytorch_windows_vs2019_py36_cuda10.1_test1

🚧 3 ongoing upstream failures:

These were probably caused by upstream breakages that are not fixed yet:


ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 16 times.

… type parsing"


Differential Revision: [D24379422](https://our.internmc.facebook.com/intern/diff/D24379422)


Exposing Vulkan backend to python api:

1. Adding parsing for 'vulkan' to DeviceType::Vulkan
2. Adding is_vulkan for Tensor as alias to check tensor.device.type=='vulkan'

Testing:

```
t = torch.randn(1, 3, 224, 224)
t_v = t.to(device='vulkan')
print("t.is_vulkan():", t.is_vulkan)
```
before: did not work
after: works ok


[ghstack-poisoned]
IvanKobzarev added a commit that referenced this pull request Oct 19, 2020
ghstack-source-id: 222a869ba2365619f510c7640999af051e265b15
Pull Request resolved: #46511
… type parsing"


Differential Revision: [D24379422](https://our.internmc.facebook.com/intern/diff/D24379422)


Exposing Vulkan backend to python api:

1. Adding parsing for 'vulkan' to DeviceType::Vulkan
2. Adding is_vulkan for Tensor as alias to check tensor.device.type=='vulkan'

Testing:

```
t = torch.randn(1, 3, 224, 224)
t_v = t.to(device='vulkan')
print("t.is_vulkan():", t.is_vulkan)
```
before: did not work
after: works ok


[ghstack-poisoned]
IvanKobzarev added a commit that referenced this pull request Oct 20, 2020
ghstack-source-id: 760737aa9fd514052b74565a95d422c5fd3bc687
Pull Request resolved: #46511
… type parsing"


Differential Revision: [D24379422](https://our.internmc.facebook.com/intern/diff/D24379422)


Exposing Vulkan backend to python api:

1. Adding parsing for 'vulkan' to DeviceType::Vulkan
2. Adding is_vulkan for Tensor as alias to check tensor.device.type=='vulkan'

Testing:

```
t = torch.randn(1, 3, 224, 224)
t_v = t.to(device='vulkan')
print("t.is_vulkan():", t.is_vulkan)
```
before: did not work
after: works ok


[ghstack-poisoned]
… type parsing"


Differential Revision: [D24379422](https://our.internmc.facebook.com/intern/diff/D24379422)


Exposing Vulkan backend to python api:

1. Adding parsing for 'vulkan' to DeviceType::Vulkan
2. Adding is_vulkan for Tensor as alias to check tensor.device.type=='vulkan'

Testing:

```
t = torch.randn(1, 3, 224, 224)
t_v = t.to(device='vulkan')
print("t.is_vulkan():", t.is_vulkan)
```
before: did not work
after: works ok


[ghstack-poisoned]
IvanKobzarev added a commit that referenced this pull request Oct 20, 2020
ghstack-source-id: 490ed1602039c5379f8287e14d7104ae1df71d19
Pull Request resolved: #46511
@facebook-github-bot
Copy link
Contributor

@IvanKobzarev merged this pull request in e8fbe54.

1 similar comment
@facebook-github-bot
Copy link
Contributor

@IvanKobzarev merged this pull request in e8fbe54.

@mrshenli
Copy link
Contributor

Hey @IvanKobzarev

This PR breaks the following test. I am reverting it. Could you please resubmit with a fix for the error message? Thanks!

https://app.circleci.com/pipelines/github/pytorch/pytorch/229554/workflows/606fdf7b-f455-416e-8300-8a9ad6bdbe95/jobs/8366102/steps
https://app.circleci.com/pipelines/github/pytorch/pytorch/229525/workflows/899c81db-6e66-49be-a8e8-cc634b543380/jobs/8366127/steps

Oct 21 06:57:46 Traceback (most recent call last):
Oct 21 06:57:46   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_distributed.py", line 270, in wrapper
Oct 21 06:57:46     fn()
Oct 21 06:57:46   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/common_distributed.py", line 93, in wrapper
Oct 21 06:57:46     return func(*args, **kwargs)
Oct 21 06:57:46   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/dist_utils.py", line 90, in new_test_method
Oct 21 06:57:46     return_value = old_test_method(self, *arg, **kwargs)
Oct 21 06:57:46   File "/opt/conda/lib/python3.6/site-packages/torch/testing/_internal/distributed/nn/api/remote_module_test.py", line 253, in test_invalid_devices
Oct 21 06:57:46     modes=[ModuleCreationMode.MODULE_CTOR],
Oct 21 06:57:46   File "/opt/conda/lib/python3.6/unittest/case.py", line 217, in __exit__
Oct 21 06:57:46     expected_regex.pattern, str(exc_value)))
Oct 21 06:57:46   File "/opt/conda/lib/python3.6/unittest/case.py", line 135, in _raiseFailure
Oct 21 06:57:46     raise self.test_case.failureException(msg)
Oct 21 06:57:46 AssertionError: "Expected one of cpu, cuda, mkldnn, opengl, opencl, ideep, hip, msnpu, xla device type at start of device string" does not match "On WorkerInfo(id=1, name=worker1):
Oct 21 06:57:46 RuntimeError('Expected one of cpu, cuda, mkldnn, opengl, opencl, ideep, hip, msnpu, xla, vulkan device type at start of device string: foo',)

IvanKobzarev added a commit that referenced this pull request Oct 21, 2020
…o device type parsing"


Summary:

Test Plan: Imported from OSS

Pulled By: IvanKobzarev

Differential Revision: [D24448984](https://our.internmc.facebook.com/intern/diff/D24448984)

Reland of the PR: #46511

The initial PR broke tests as they assert the error message that  was changed in PR

torch/testing/_internal/distributed/nn/api/remote_module_test.py

In this PR it is changed accordingly

[ghstack-poisoned]
IvanKobzarev added a commit that referenced this pull request Oct 22, 2020
…o device type parsing"


Summary:

Test Plan: Imported from OSS

Pulled By: IvanKobzarev

Differential Revision: [D24448984](https://our.internmc.facebook.com/intern/diff/D24448984)

Reland of the PR: #46511

The initial PR broke tests as they assert the error message that  was changed in PR

torch/testing/_internal/distributed/nn/api/remote_module_test.py

In this PR it is changed accordingly

[ghstack-poisoned]
IvanKobzarev added a commit that referenced this pull request Oct 22, 2020
…o device type parsing"


Summary:

Test Plan: Imported from OSS

Pulled By: IvanKobzarev

Differential Revision: [D24448984](https://our.internmc.facebook.com/intern/diff/D24448984)

Reland of the PR: #46511

The initial PR broke tests as they assert the error message that  was changed in PR

torch/testing/_internal/distributed/nn/api/remote_module_test.py

In this PR it is changed accordingly

[ghstack-poisoned]
@facebook-github-bot facebook-github-bot deleted the gh/ivankobzarev/9/head branch October 24, 2020 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Merged oncall: jit Add this issue/PR to JIT oncall triage queue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants