Skip to content

Commit 733f274

Browse files
author
pytorchbot
committed
2024-12-11 nightly release (62d2e37)
1 parent 1ed556a commit 733f274

File tree

86 files changed

+1558
-236
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+1558
-236
lines changed

.ci/scripts/setup-vulkan-linux-deps.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ install_swiftshader() {
2727

2828
install_vulkan_sdk() {
2929
VULKAN_SDK_VERSION=$1
30-
_vulkan_sdk_url="https://sdk.lunarg.com/sdk/download/${VULKAN_SDK_VERSION}/linux/vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.gz"
30+
_vulkan_sdk_url="https://sdk.lunarg.com/sdk/download/${VULKAN_SDK_VERSION}/linux/vulkansdk-linux-x86_64-${VULKAN_SDK_VERSION}.tar.xz"
3131

3232
_vulkan_sdk_dir=/tmp/vulkansdk
3333
mkdir -p $_vulkan_sdk_dir
@@ -37,12 +37,12 @@ install_vulkan_sdk() {
3737
curl --silent --show-error --location --fail --retry 3 \
3838
--output "${_tmp_archive}" "${_vulkan_sdk_url}"
3939

40-
tar -C "${_vulkan_sdk_dir}" -xzf "${_tmp_archive}"
40+
tar -C "${_vulkan_sdk_dir}" -xJf "${_tmp_archive}"
4141

4242
export PATH="${PATH}:${_vulkan_sdk_dir}/${VULKAN_SDK_VERSION}/x86_64/bin/"
4343
}
4444

45-
VULKAN_SDK_VERSION="1.2.198.1"
45+
VULKAN_SDK_VERSION="1.3.296.0"
4646

4747
install_swiftshader
4848
install_vulkan_sdk "${VULKAN_SDK_VERSION}"

backends/arm/quantizer/quantization_annotation/generic_annotator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
torch.ops.aten.tile.default,
5454
torch.ops.aten.flip.default,
5555
torch.ops.aten.cat.default,
56+
torch.ops.aten.concatenate.default,
5657
torch.ops.aten.stack.default,
5758
torch.ops.aten.chunk.default,
5859
torch.ops.aten.contiguous.default,

backends/arm/test/ops/test_depthwise_conv.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,14 @@
156156
("two_dw_conv2d", two_dw_conv2d),
157157
]
158158

159-
testsuite_conv2d_u85_xfails = [
159+
testsuite_conv2d_u85 = [
160160
("2x2_1x6x4x4_gp6_st1", dw_conv2d_2x2_1x6x4x4_gp6_st1),
161161
("3x3_1x3x256x256_gp3_st1", dw_conv2d_3x3_1x3x256x256_gp3_st1),
162162
("3x3_1x4x256x256_gp4_st1", dw_conv2d_3x3_1x4x256x256_gp4_st1),
163163
("3x3_1x4x256x256_gp4_nobias", dw_conv2d_3x3_1x4x256x256_gp4_nobias),
164+
]
165+
166+
testsuite_conv2d_u85_xfails = [
164167
("3x3_2x8x198x198_gp8_st3", dw_conv2d_3x3_2x8x198x198_gp8_st3),
165168
("two_dw_conv2d", two_dw_conv2d),
166169
]
@@ -284,7 +287,7 @@ def test_dw_conv1d_u55_BI(
284287
model.get_inputs(),
285288
)
286289

287-
@parameterized.expand(testsuite_conv1d[2:])
290+
@parameterized.expand(testsuite_conv1d + testsuite_conv2d_u85)
288291
def test_dw_conv_u85_BI(
289292
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = False
290293
):
@@ -296,12 +299,8 @@ def test_dw_conv_u85_BI(
296299
model.get_inputs(),
297300
)
298301

299-
testsuite_conv2d_u85_xfails.remove(
300-
("3x3_1x3x256x256_gp3_st1", dw_conv2d_3x3_1x3x256x256_gp3_st1)
301-
) # Works
302-
303302
# All test cases except 3x3_1x3x256x256_gp3_st1 have numerical issues on FVP. MLETORCH-520
304-
@parameterized.expand(testsuite_conv2d_u85_xfails + testsuite_conv1d[:2])
303+
@parameterized.expand(testsuite_conv2d_u85_xfails)
305304
@conftest.expectedFailureOnFVP
306305
def test_dw_conv_u85_BI_xfails(
307306
self, test_name: str, model: torch.nn.Module, set_quantize_io: bool = False

backends/arm/test/ops/test_div.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,21 @@ def test_div_tosa_BI(
183183
test_data = (input_, other_)
184184
self._test_div_tosa_BI_pipeline(self.Div(), test_data)
185185

186+
@parameterized.expand(test_data_suite[:2])
187+
def test_div_u55_BI(
188+
self,
189+
test_name: str,
190+
input_: Union[torch.Tensor, torch.types.Number],
191+
other_: Union[torch.Tensor, torch.types.Number],
192+
rounding_mode: Optional[str] = None,
193+
):
194+
test_data = (input_, other_)
195+
self._test_div_ethos_BI_pipeline(
196+
self.Div(), common.get_u55_compile_spec(), test_data
197+
)
198+
186199
# Numerical issues on FVP likely due to mul op, MLETORCH-521
187-
@parameterized.expand(test_data_suite)
200+
@parameterized.expand(test_data_suite[2:])
188201
@conftest.expectedFailureOnFVP
189202
def test_div_u55_BI_xfails(
190203
self,
@@ -198,8 +211,21 @@ def test_div_u55_BI_xfails(
198211
self.Div(), common.get_u55_compile_spec(), test_data
199212
)
200213

214+
@parameterized.expand(test_data_suite[:2])
215+
def test_div_u85_BI(
216+
self,
217+
test_name: str,
218+
input_: Union[torch.Tensor, torch.types.Number],
219+
other_: Union[torch.Tensor, torch.types.Number],
220+
rounding_mode: Optional[str] = None,
221+
):
222+
test_data = (input_, other_)
223+
self._test_div_ethos_BI_pipeline(
224+
self.Div(), common.get_u85_compile_spec(), test_data
225+
)
226+
201227
# Numerical issues on FVP likely due to mul op, MLETORCH-521
202-
@parameterized.expand(test_data_suite)
228+
@parameterized.expand(test_data_suite[2:])
203229
@conftest.expectedFailureOnFVP
204230
def test_div_u85_BI_xfails(
205231
self,

backends/arm/test/ops/test_mul.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ def test_mul_tosa_BI(
152152
test_data = (input_, other_)
153153
self._test_mul_tosa_BI_pipeline(self.Mul(), test_data)
154154

155-
# Numerical issues on FVP, MLETORCH-521
156155
@parameterized.expand(test_data_sute)
157-
@conftest.expectedFailureOnFVP
158156
def test_mul_u55_BI(
159157
self,
160158
test_name: str,
@@ -166,10 +164,7 @@ def test_mul_u55_BI(
166164
common.get_u55_compile_spec(), self.Mul(), test_data
167165
)
168166

169-
# Numerical issues on FVP, MLETORCH-521
170-
# test_data_sute[0] works on U85
171-
@parameterized.expand(test_data_sute[1:])
172-
@conftest.expectedFailureOnFVP
167+
@parameterized.expand(test_data_sute)
173168
def test_mul_u85_BI(
174169
self,
175170
test_name: str,

backends/arm/test/quantizer/test_generic_annotater.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,10 @@ def test_flip(self):
8686
self.check_annotation(
8787
SingleOpModel(torch.flip, (torch.randn(2, 4),), dims=(0, 1)),
8888
)
89+
90+
def test_concat(self):
91+
self.check_annotation(
92+
SingleOpModel(
93+
torch.concatenate, ((torch.randn(2, 3), torch.randn(2, 3)),), dim=0
94+
),
95+
)

backends/cadence/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ include(${EXECUTORCH_ROOT}/build/Utils.cmake)
2323

2424
# Let files say "include <executorch/path/to/header.h>".
2525
set(_common_include_directories ${EXECUTORCH_ROOT}/..)
26-
set(TARGET_DIR reference)
2726

2827
if(EXECUTORCH_CADENCE_CPU_RUNNER)
2928
include(${EXECUTORCH_ROOT}/build/Codegen.cmake)
@@ -61,6 +60,9 @@ if(EXECUTORCH_CADENCE_CPU_RUNNER)
6160
${_common_include_directories}
6261
)
6362

63+
set(TARGET_DIR reference)
64+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${TARGET_DIR}/kernels)
65+
6466
target_link_libraries(
6567
cadence_runner
6668
executorch

backends/cadence/aot/functions.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,41 @@
142142
- arg_meta: null
143143
kernel_name: torch::executor::where_out
144144

145+
- op: transpose_copy.int_out
146+
kernels:
147+
- arg_meta: null
148+
kernel_name: torch::executor::transpose_copy_int_out
149+
150+
- op: eq.Scalar_out
151+
kernels:
152+
- arg_meta: null
153+
kernel_name: torch::executor::eq_scalar_out
154+
155+
- op: logical_not.out
156+
kernels:
157+
- arg_meta: null
158+
kernel_name: torch::executor::logical_not_out
159+
160+
- op: any.out
161+
kernels:
162+
- arg_meta: null
163+
kernel_name: torch::executor::any_out
164+
165+
- op: native_group_norm.out
166+
kernels:
167+
- arg_meta: null
168+
kernel_name: torch::executor::native_group_norm_out
169+
170+
- op: sum.IntList_out
171+
kernels:
172+
- arg_meta: null
173+
kernel_name: torch::executor::sum_dim_out
174+
175+
- op: select_copy.int_out
176+
kernels:
177+
- arg_meta: null
178+
kernel_name: torch::executor::select_copy_int_out
179+
145180
# custom ops
146181
- func: cadence::quantize_per_tensor.out(Tensor input, float scale, int zero_point, int quant_min, int quant_max, ScalarType dtype, *, Tensor(a!) out) -> Tensor(a!)
147182
variants: function
@@ -183,3 +218,18 @@
183218
kernels:
184219
- arg_meta: null
185220
kernel_name: impl::reference::quantized_matmul_out
221+
222+
- func: cadence::quantized_linear.per_tensor_out(Tensor src, Tensor weight, Tensor bias, SymInt src_zero_point, SymInt weight_zero_point, SymInt out_multiplier, SymInt out_shift, SymInt out_zero_point, Tensor? offset, *, Tensor(a!) out) -> Tensor(a!)
223+
kernels:
224+
- arg_meta: null
225+
kernel_name: impl::reference::quantized_linear_per_tensor_out
226+
227+
- func: cadence::im2row.out(Tensor input, int[2] kernel_size, int[2] dilation, int[2] padding, int[2] stride, Tensor in_zero_point, bool channel_last=False, *, Tensor(a!) out) -> Tensor(a!)
228+
kernels:
229+
- arg_meta: null
230+
kernel_name: impl::reference::im2row_out
231+
232+
- func: cadence::quantized_conv.per_tensor_out(Tensor input, Tensor weight, Tensor bias, int[] stride, SymInt[] padding, int[] dilation, int groups, int input_zero_point, int weight_zero_point, float bias_scale, float out_scale, int out_zero_point, int out_multiplier, int out_shift, bool channel_last=False, *, Tensor(a!) out) -> Tensor(a!)
233+
kernels:
234+
- arg_meta: null
235+
kernel_name: impl::reference::quantized_conv_per_tensor_out

backends/cadence/aot/remove_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ def call_operator(
110110

111111
# Otherwise, we replace args[0] with cat_inputs.
112112
new_args = list(args)
113-
new_args[0] = cat_inputs
113+
# pyre error introduced after D66937105
114+
new_args[0] = cat_inputs # pyre-ignore[6]
114115
return super().call_operator(op, tuple(new_args), kwargs, meta)
115116

116117

backends/cadence/fusion_g3/operators/op_quantize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ Tensor& quantize_per_tensor_out(
570570
err == torch::executor::Error::Ok,
571571
"Failed to resize out Tensor in quantize_per_tensor_out");
572572

573-
check_quantize_per_tensor_args(input, quant_min, quant_max, dtype, out);
573+
// check_quantize_per_tensor_args(input, quant_min, quant_max, dtype, out);
574574

575575
float scale_data = (float)scale;
576576
int zero_point_data = (int)zero_point;
@@ -696,7 +696,7 @@ Tensor& quantize_per_channel_out(
696696
zero_point.numel(),
697697
input.size(axis));
698698

699-
check_quantize_per_tensor_args(input, quant_min, quant_max, dtype, out);
699+
// check_quantize_per_tensor_args(input, quant_min, quant_max, dtype, out);
700700

701701
const double* scale_dt = scale.const_data_ptr<double>();
702702
const int64_t* zero_point_dt = zero_point.const_data_ptr<int64_t>();

0 commit comments

Comments
 (0)