Skip to content

Commit a253b4d

Browse files
author
morelos
committed
Update on "[ET-VK][Ops] dequantize_per_channel reference impl and testing"
# Context In order to properly enable dynamic quantization, we create the dequantize_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: [D77746138](https://our.internmc.facebook.com/intern/diff/D77746138/) [ghstack-poisoned]
2 parents 01361a4 + b2fbb21 commit a253b4d

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

backends/vulkan/test/op_tests/dequantize_test.cpp

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -557,18 +557,6 @@ void test_vulkan_dequantize_per_token_impl(
557557
const vkcompute::utils::StorageType in_storage,
558558
const vkcompute::utils::StorageType out_storage);
559559

560-
void test_vulkan_dequantize_per_channel_impl(
561-
const std::vector<int>& input_sizes,
562-
const std::vector<float>& scales,
563-
const std::vector<int>& zero_points,
564-
int64_t axis,
565-
int64_t quant_min,
566-
int64_t quant_max,
567-
at::ScalarType dtype,
568-
at::ScalarType out_dtype,
569-
const vkcompute::utils::StorageType in_storage,
570-
const vkcompute::utils::StorageType out_storage);
571-
572560
// Wrapper function to test both buffer and texture storage types
573561
void test_vulkan_dequantize_per_tensor(
574562
const std::vector<int>& input_sizes,
@@ -649,49 +637,6 @@ void test_vulkan_dequantize_per_token(
649637
vkcompute::utils::kTexture3D);
650638
}
651639

652-
// Wrapper function to test both buffer and texture storage types
653-
void test_vulkan_dequantize_per_channel(
654-
const std::vector<int>& input_sizes,
655-
const std::vector<float>& scales,
656-
const std::vector<int>& zero_points,
657-
int64_t axis,
658-
int64_t quant_min,
659-
int64_t quant_max,
660-
at::ScalarType dtype,
661-
at::ScalarType out_dtype) {
662-
// Test with buffer storage
663-
test_vulkan_dequantize_per_channel_impl(
664-
input_sizes,
665-
scales,
666-
zero_points,
667-
axis,
668-
quant_min,
669-
quant_max,
670-
dtype,
671-
out_dtype,
672-
vkcompute::utils::kBuffer,
673-
vkcompute::utils::kBuffer);
674-
675-
// Telling the system to expect a float instead of a double
676-
// since the shader can only return 32bit anyways
677-
if (out_dtype == at::kDouble) {
678-
out_dtype = at::kFloat;
679-
}
680-
681-
// Test with texture storage
682-
test_vulkan_dequantize_per_channel_impl(
683-
input_sizes,
684-
scales,
685-
zero_points,
686-
axis,
687-
quant_min,
688-
quant_max,
689-
dtype,
690-
out_dtype,
691-
vkcompute::utils::kTexture3D,
692-
vkcompute::utils::kTexture3D);
693-
}
694-
695640
void test_reference_dequantize_per_tensor(
696641
const std::vector<int>& input_sizes,
697642
float scale,

0 commit comments

Comments
 (0)