Skip to content

Commit 1fde433

Browse files
author
morelos
committed
Update on "[ET-VK][Ops] quantize_per_channel reference impl and testing"
# Context In order to properly enable dynamic quantization, we create the quantize_per_channel operator as its seemingly useful to have for the pipeline. # Changes This creates the wrapper for the cpu reference implementation, and also a dummy reference implementation I created just to test against it. Differential Revision: [D77746132](https://our.internmc.facebook.com/intern/diff/D77746132/) [ghstack-poisoned]
2 parents ee1bf00 + 5d95c3d commit 1fde433

File tree

1 file changed

+0
-54
lines changed

1 file changed

+0
-54
lines changed

backends/vulkan/test/op_tests/quantize_test.cpp

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -473,18 +473,6 @@ void test_vulkan_quantize_per_token_impl(
473473
const vkcompute::utils::StorageType in_storage,
474474
const vkcompute::utils::StorageType out_storage);
475475

476-
void test_vulkan_quantize_per_channel_impl(
477-
const std::vector<int>& input_sizes,
478-
const std::vector<float>& scales,
479-
const std::vector<int>& zero_points,
480-
int64_t axis,
481-
int64_t quant_min,
482-
int64_t quant_max,
483-
at::ScalarType in_dtype,
484-
at::ScalarType dtype,
485-
const vkcompute::utils::StorageType in_storage,
486-
const vkcompute::utils::StorageType out_storage);
487-
488476
// Wrapper function to test both buffer and texture storage types
489477
void test_vulkan_quantize_per_tensor(
490478
const std::vector<int>& input_sizes,
@@ -565,48 +553,6 @@ void test_vulkan_quantize_per_token(
565553
vkcompute::utils::kTexture3D);
566554
}
567555

568-
// Wrapper function to test both buffer and texture storage types
569-
void test_vulkan_quantize_per_channel(
570-
const std::vector<int>& input_sizes,
571-
const std::vector<float>& scales,
572-
const std::vector<int>& zero_points,
573-
int64_t axis,
574-
int64_t quant_min,
575-
int64_t quant_max,
576-
at::ScalarType in_dtype = at::kFloat,
577-
at::ScalarType dtype = at::kInt) {
578-
// Test with buffer storage
579-
test_vulkan_quantize_per_channel_impl(
580-
input_sizes,
581-
scales,
582-
zero_points,
583-
axis,
584-
quant_min,
585-
quant_max,
586-
in_dtype,
587-
dtype,
588-
vkcompute::utils::kBuffer,
589-
vkcompute::utils::kBuffer);
590-
591-
// If the in_dtype is a double, convert to float for texture implementation
592-
// since they don't support 64bit as inputs
593-
if (in_dtype == at::kDouble) {
594-
in_dtype = at::kFloat;
595-
}
596-
597-
test_vulkan_quantize_per_channel_impl(
598-
input_sizes,
599-
scales,
600-
zero_points,
601-
axis,
602-
quant_min,
603-
quant_max,
604-
in_dtype,
605-
dtype,
606-
vkcompute::utils::kTexture3D,
607-
vkcompute::utils::kTexture3D);
608-
}
609-
610556
void test_reference_quantize_per_tensor(
611557
const std::vector<int>& input_sizes,
612558
float scale,

0 commit comments

Comments
 (0)