@@ -746,8 +746,10 @@ void test_vulkan_quantize_per_tensor_impl(
746746 at::Tensor reference_int = reference_out.to (at::kInt );
747747 at::Tensor vk_int = vk_out.to (at::kInt );
748748
749- // Tolerance is 1 to address rounding errors and fp math differences between CPU/GPU
750- const bool output_correct = at::allclose (reference_int, vk_int, /* rtol=*/ 1 , /* atol=*/ 1 );
749+ // Tolerance is 1 to address rounding errors and fp math differences between
750+ // CPU/GPU
751+ const bool output_correct =
752+ at::allclose (reference_int, vk_int, /* rtol=*/ 1 , /* atol=*/ 1 );
751753 if (!output_correct) {
752754 at::Tensor diffs = at::abs (reference_int - vk_int);
753755
@@ -1123,8 +1125,10 @@ void test_vulkan_quantize_per_token_impl(
11231125 at::Tensor reference_int = reference_out.to (at::kInt );
11241126 at::Tensor vk_int = vk_out.to (at::kInt );
11251127
1126- // Tolerance is 1 to address rounding errors and fp math differences between CPU/GPU
1127- const bool output_correct = at::allclose (reference_int, vk_int, /* rtol=*/ 1 , /* atol=*/ 1 );
1128+ // Tolerance is 1 to address rounding errors and fp math differences between
1129+ // CPU/GPU
1130+ const bool output_correct =
1131+ at::allclose (reference_int, vk_int, /* rtol=*/ 1 , /* atol=*/ 1 );
11281132 if (!output_correct) {
11291133 at::Tensor diffs = at::abs (reference_int - vk_int);
11301134
@@ -1244,9 +1248,7 @@ TEST(
12441248 at::kByte );
12451249}
12461250
1247- TEST (
1248- VulkanQuantizePerTokenTest,
1249- test_vulkan_quantize_per_token_float_to_int8) {
1251+ TEST (VulkanQuantizePerTokenTest, test_vulkan_quantize_per_token_float_to_int8) {
12501252 if (!vkcompute::api::context ()
12511253 ->adapter_ptr ()
12521254 ->has_full_int8_buffers_support ()) {
@@ -1606,8 +1608,10 @@ void test_vulkan_quantize_per_channel_impl(
16061608 at::Tensor reference_int = reference_out.to (at::kInt );
16071609 at::Tensor vk_int = vk_out.to (at::kInt );
16081610
1609- // Tolerance is 1 to address rounding errors and fp math differences between CPU/GPU
1610- const bool output_correct = at::allclose (reference_int, vk_int, /* rtol=*/ 1 , /* atol=*/ 1 );
1611+ // Tolerance is 1 to address rounding errors and fp math differences between
1612+ // CPU/GPU
1613+ const bool output_correct =
1614+ at::allclose (reference_int, vk_int, /* rtol=*/ 1 , /* atol=*/ 1 );
16111615 if (!output_correct) {
16121616 at::Tensor diffs = at::abs (reference_int - vk_int);
16131617
@@ -1717,7 +1721,9 @@ TEST(
17171721
17181722// END OF REFERENCE TESTS
17191723
1720- TEST (VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_float_to_int8_axis0) {
1724+ TEST (
1725+ VulkanQuantizePerChannelTest,
1726+ test_vulkan_quantize_per_channel_float_to_int8_axis0) {
17211727 std::vector<float > scales (9 , 0 .1f );
17221728 std::vector<int > zero_points (9 , 2 );
17231729
@@ -1777,7 +1783,9 @@ TEST(VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_float_to_int
17771783 at::kChar );
17781784}
17791785
1780- TEST (VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_float_to_int8_axis1) {
1786+ TEST (
1787+ VulkanQuantizePerChannelTest,
1788+ test_vulkan_quantize_per_channel_float_to_int8_axis1) {
17811789 std::vector<float > scales (14 , 0 .001f );
17821790 std::vector<int > zero_points (14 , -5 );
17831791
@@ -1826,7 +1834,9 @@ TEST(VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_float_to_int
18261834 at::kChar );
18271835}
18281836
1829- TEST (VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_float_to_int8_axis2) {
1837+ TEST (
1838+ VulkanQuantizePerChannelTest,
1839+ test_vulkan_quantize_per_channel_float_to_int8_axis2) {
18301840 std::vector<float > scales (11 , 0 .5f );
18311841 std::vector<int > zero_points (11 , 12 );
18321842
@@ -1864,7 +1874,9 @@ TEST(VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_float_to_int
18641874 at::kChar );
18651875}
18661876
1867- TEST (VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_float_to_int8_axis3) {
1877+ TEST (
1878+ VulkanQuantizePerChannelTest,
1879+ test_vulkan_quantize_per_channel_float_to_int8_axis3) {
18681880 std::vector<float > scales (7 , 0 .5f );
18691881 std::vector<int > zero_points (7 , 12 );
18701882
@@ -1891,7 +1903,9 @@ TEST(VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_float_to_int
18911903 at::kChar );
18921904}
18931905
1894- TEST (VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_float_to_uint8_comprehensive) {
1906+ TEST (
1907+ VulkanQuantizePerChannelTest,
1908+ test_vulkan_quantize_per_channel_float_to_uint8_comprehensive) {
18951909 std::vector<float > scales = {0.1 , 0.2 , 0.0001 , 0.5 , 0.02 };
18961910 std::vector<int > zero_points = {0 , 5 , -5 , 1 , 12 };
18971911
@@ -1951,7 +1965,9 @@ TEST(VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_float_to_uin
19511965 at::kByte );
19521966}
19531967
1954- TEST (VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_half_to_8bit) {
1968+ TEST (
1969+ VulkanQuantizePerChannelTest,
1970+ test_vulkan_quantize_per_channel_half_to_8bit) {
19551971 std::vector<float > scales = {0.1 , 0.2 , 0.01 , 0.5 , 0.02 };
19561972 std::vector<int > zero_points = {0 , 5 , 5 , 1 , 12 };
19571973
@@ -2011,7 +2027,9 @@ TEST(VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_half_to_8bit
20112027 at::kByte );
20122028}
20132029
2014- TEST (VulkanQuantizePerChannelTest, test_vulkan_quantize_per_channel_double_to_8bit) {
2030+ TEST (
2031+ VulkanQuantizePerChannelTest,
2032+ test_vulkan_quantize_per_channel_double_to_8bit) {
20152033 std::vector<float > scales = {0.1 , 0.2 , 0.01 , 0.5 , 0.02 };
20162034 std::vector<int > zero_points = {0 , 5 , 5 , 1 , 12 };
20172035
0 commit comments