Skip to content

Conversation

manuelcandales
Copy link
Contributor

Summary:
Implemented GLU operator for the Vulkan backend.

Special case implementation:

  • Input tensor must be 4-dim, i.e. [N, C, H, W].
  • C must be a multiple of 8 (number of channels of output tensor must be a multiple of 4).
  • dim must be 1.

References

  • PyTorch Docs > torch.nn > GLU

Test Plan:
Added test case to /xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp

On Mac:

buck run //xplat/caffe2:pt_vulkan_api_test_binAppleMac

On Android:

buck build -c ndk.custom_libcxx=false -c pt.enable_qpl=0 //xplat/caffe2:pt_vulkan_api_test_binAndroid\#android-arm64 --show-output
adb push buck-out/gen/xplat/caffe2/pt_vulkan_api_test_binAndroid\#android-arm64 /data/local/tmp/vulkan_api_test
adb shell "/data/local/tmp/vulkan_api_test"

Differential Revision: D37625389

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Jul 5, 2022

🔗 Helpful links

✅ No Failures (0 Pending)

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

Expand to see more

💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37625389

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

This pull request was exported from Phabricator. Differential Revision: D37625389

Summary:
Pull Request resolved: pytorch#80910

Implemented GLU operator for the Vulkan backend.

Special case implementation:
- Input tensor must be 4-dim, i.e. [N, C, H, W].
- C must be a multiple of 8 (number of channels of output tensor must be a multiple of 4).
- dim must be 1.

References
- PyTorch Docs > torch.nn > [GLU](https://pytorch.org/docs/stable/generated/torch.nn.GLU.html)

Test Plan:
Added test case to `/xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp`

On Mac:
```
buck run //xplat/caffe2:pt_vulkan_api_test_binAppleMac
```
On Android:
```
buck build -c ndk.custom_libcxx=false -c pt.enable_qpl=0 //xplat/caffe2:pt_vulkan_api_test_binAndroid\#android-arm64 --show-output
adb push buck-out/gen/xplat/caffe2/pt_vulkan_api_test_binAndroid\#android-arm64 /data/local/tmp/vulkan_api_test
adb shell "/data/local/tmp/vulkan_api_test"
```

Reviewed By: SS-JIA

Differential Revision: D37625389

fbshipit-source-id: cb1c48d0538b261ee35483d1c1cdb8a5465856d7
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37625389

@SS-JIA SS-JIA self-requested a review July 7, 2022 14:20
@facebook-github-bot
Copy link
Contributor

@pytorchbot merge

(Initiating merge automatically since Phabricator Diff has merged)

@pytorchmergebot
Copy link
Collaborator

@pytorchbot successfully started a merge job. Check the current status here

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2022

Hey @manuelcandales.
You've committed this PR, but it does not have both a 'release notes: ...' and 'topics: ...' label. Please add one of each to the PR. The 'release notes: ...' label should represent the part of PyTorch that this PR changes (fx, autograd, distributed, etc) and the 'topics: ...' label should represent the kind of PR it is (not user facing, new feature, bug fix, perf improvement, etc). The list of valid labels can be found here for the 'release notes: ...' and here for the 'topics: ...'.
For changes that are 'topic: not user facing' there is no need for a release notes label.

facebook-github-bot pushed a commit that referenced this pull request Jul 7, 2022
Summary:
Pull Request resolved: #80910

Implemented GLU operator for the Vulkan backend.

Special case implementation:
- Input tensor must be 4-dim, i.e. [N, C, H, W].
- C must be a multiple of 8 (number of channels of output tensor must be a multiple of 4).
- dim must be 1.

References
- PyTorch Docs > torch.nn > [GLU](https://pytorch.org/docs/stable/generated/torch.nn.GLU.html)

Test Plan:
Added test case to `/xplat/caffe2/aten/src/ATen/test/vulkan_api_test.cpp`

On Mac:
```
buck run //xplat/caffe2:pt_vulkan_api_test_binAppleMac
```
On Android:
```
buck build -c ndk.custom_libcxx=false -c pt.enable_qpl=0 //xplat/caffe2:pt_vulkan_api_test_binAndroid\#android-arm64 --show-output
adb push buck-out/gen/xplat/caffe2/pt_vulkan_api_test_binAndroid\#android-arm64 /data/local/tmp/vulkan_api_test
adb shell "/data/local/tmp/vulkan_api_test"
```

Reviewed By: SS-JIA

Differential Revision: D37625389

fbshipit-source-id: 4d3f733abecbd6e9df53631a7f3c64ffd2cf0d10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants