Skip to content

Commit 82ba3f0

Browse files
refactor
1 parent 3320606 commit 82ba3f0

6 files changed

Lines changed: 7 additions & 430 deletions

File tree

dpbench/benchmarks/deformable_convolution/deformable_convolution_initialize.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,16 @@ def initialize(
3333
default_rng.random((batch, in_channels, in_height, in_width)).astype(
3434
dtype
3535
),
36-
# np.ones((batch, in_channels, in_height, in_width)).astype(dtype),
3736
np.zeros((batch, out_channels, out_height, out_width)).astype(dtype),
38-
# np.zeros((kernel_height, kernel_width, 2, out_height, out_width)).astype(dtype),
3937
2
4038
* default_rng.random(
4139
(kernel_height, kernel_width, 2, out_height, out_width)
4240
).astype(dtype)
4341
- 1,
44-
# default_rng.random((out_channels, in_channels, kernel_height, kernel_width)).astype(dtype),
4542
np.ones(
4643
(out_channels, in_channels, kernel_height, kernel_width)
4744
).astype(dtype),
4845
default_rng.random(out_channels).astype(dtype),
49-
# np.ones((out_channels,)).astype(dtype),
5046
np.zeros(
5147
(in_channels, kernel_height, kernel_width, out_height, out_width)
5248
).astype(dtype),

dpbench/benchmarks/deformable_convolution/deformable_convolution_numba_npr.py

Lines changed: 0 additions & 141 deletions
This file was deleted.

dpbench/benchmarks/deformable_convolution/deformable_convolution_numpy.py

Lines changed: 0 additions & 136 deletions
This file was deleted.

dpbench/benchmarks/deformable_convolution/deformable_convolution_sycl_native_ext/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
1+
cmake_minimum_required(VERSION 3.23)
2+
13
set(py_module_name _deformable_convolution_sycl)
24
pybind11_add_module(${py_module_name}
35
MODULE
46
deformable_convolution_sycl/impl.cpp
57
)
68
find_package(MKL CONFIG REQUIRED)
79

8-
# target_include_directories(${py_module_name} PUBLIC ${Dpctl_INCLUDE_DIRS} $)
910
target_compile_options(${py_module_name} PUBLIC $<TARGET_PROPERTY:MKL::MKL,INTERFACE_COMPILE_OPTIONS>)
1011
target_include_directories(${py_module_name} PUBLIC ${Dpctl_INCLUDE_DIRS} $<TARGET_PROPERTY:MKL::MKL,INTERFACE_INCLUDE_DIRECTORIES>)
1112
target_link_libraries(${py_module_name} PUBLIC $<LINK_ONLY:MKL::MKL> ${MKL_SYCL})
1213

13-
message(STATUS "${MKL_IMPORTED_TARGETS}")
14-
message(STATUS "${INTERFACE_COMPILE_OPTIONS}")
15-
message(STATUS "${INTERFACE_INCLUDE_DIRECTORIES}")
16-
1714
file(RELATIVE_PATH py_module_dest ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
1815
install(TARGETS ${py_module_name}
1916
DESTINATION ${py_module_dest}/deformable_convolution_sycl

dpbench/benchmarks/deformable_convolution/deformable_convolution_sycl_native_ext/deformable_convolution_sycl/impl.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,11 @@ inline auto deform_input(cl::sycl::queue &queue,
119119
out_width, kh, kw, 0, h, w) +
120120
w * stride_x + (kw - k_w_m) * dilation_x -
121121
(pad_x - k_w_m);
122-
// auto offset_y = h*stride_y + (kh - k_h_m)*dilation_y - (pad_y -
123-
// k_h_m); auto offset_x = w*stride_x + (kw - k_w_m)*dilation_x - (pad_x
124-
// - k_w_m);
125122

126123
auto _input =
127124
get_ptr_3d(input, in_channels, in_height, in_width, c, 0, 0);
128125

129126
_output[w] = bilinear(_input, in_height, in_width, offset_y, offset_x);
130-
// _output[w] = offset_y;
131127
});
132128
}
133129

@@ -197,11 +193,11 @@ void deformable_convolution_b1_impl(cl::sycl::queue &queue,
197193
auto efill = output_fill_with_bias(queue, output, out_shape, bias);
198194
auto egemm = gemm(queue, transpose::N, transpose::N, /*transpose a, b*/
199195
out_c, out_h * out_w, in_c * ker_h * ker_w, /*m, n, k*/
200-
1, /*alpha*/
201-
weights, in_c * ker_h * ker_w, /*a, lda*/
202-
tmp, out_h * out_w, /*b, ldb*/
203-
1, /*beta*/
204-
output, out_h * out_w, /*c, ldc*/
196+
1, /*alpha*/
197+
weights, in_c * ker_h * ker_w, /*a, lda*/
198+
tmp, out_h * out_w, /*b, ldb*/
199+
1, /*beta*/
200+
output, out_h * out_w, /*c, ldc*/
205201
{edeform, efill} /*events*/);
206202
egemm.wait();
207203
}

0 commit comments

Comments
 (0)