-
Notifications
You must be signed in to change notification settings - Fork 646
[ET-VK][Ops] choose_qparams ops skeleton test framework #11554
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
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11554
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 Cancelled Jobs, 1 Unrelated FailureAs of commit 7a6cbb6 with merge base 8cfa858 ( CANCELLED JOBS - The following jobs were cancelled. Please retry:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This pull request was exported from Phabricator. Differential Revision: D76436870 |
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76436870 |
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76436870 |
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76436870 |
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76436870 |
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76436870 |
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76436870 |
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76436870 |
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76436870 |
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76436870 |
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D76436870 |
1c3e74f
into
gh/ahmtox/19/base
Pull Request resolved: pytorch/executorch#11554 # Context In this diff we plan on creating the skeleton test framework for choose_qparams. This is necessary as we need a reference to test our vulkan implementation of the choose_qparams operators against an existing cpu implementation. This test framework is heavily inspired by [sdpa_test.cpp](https://github.com/pytorch/executorch/blob/main/backends/vulkan/test/op_tests/sdpa_test.cpp). We make use of the [op_choose_qparams.cpp](https://github.com/pytorch/executorch/blob/main/kernels/quantized/cpu/op_choose_qparams.cpp) cpu implementation of the `choose_qparams_tensor`, and the `choose_qparams_per_token_asymmetric` operators. An explanation for the operator is included where the actual vulkan implementation is created in a future diff along this stack. # Changes The main thing in this difference is the creation of a new test framework `choose_qparams_test.cpp`, and also including it in targets.bzl such that we can properly call the test. As this is inspired by sdpa_test.cpp, we also follow a similar format. First we have forward declarations of the functions that we wish to test against (choose_qparams_tensor, and choose_qparams_per_token_asymmetric). Then we also have wrappers for the functions without context, and finally wrappers for the ATen implementations of the same operators using the `WRAP_TO_ATEN` macro. We don't need context as this is merely for testing. We also have a utility function to test the quantize arguments that will be used when actually using the vulkan implementation. This utility function is just for a sanity check. One of the interesting things about this one is that since the wrapper macro doesn't support tuples with two pieces of data, we just return the scales. However this doesn't really impact anything in terms of evaluation. We also pass in a dummy eps value since its not using in the cpu implementation at all. ghstack-source-id: 290376490 @exported-using-ghexport Differential Revision: [D76436870](https://our.internmc.facebook.com/intern/diff/D76436870/)
Stack from ghstack (oldest at bottom):
Skeleton framework that is needed to build out the choose_qparams.tensor and choose_qparams_per_token_asymmetric.default operators based on cpu implementation
Differential Revision: D76436870