Add SYCL support#284
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #284 +/- ##
===========================================
- Coverage 84.69% 66.13% -18.57%
===========================================
Files 61 61
Lines 3744 4665 +921
Branches 2218 2560 +342
===========================================
- Hits 3171 3085 -86
- Misses 285 331 +46
- Partials 288 1249 +961
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aobolensk
left a comment
There was a problem hiding this comment.
Please, simplify the scripts. They are overcomplicated for what they are aiming to do
| run: | | ||
| clang-tidy app/**/*.cpp src/**/*.cpp -format-style=file -header-filter="($PWD/include/.*|$PWD/src/.*|$PWD/app/.*)" -p build | ||
| mapfile -t files < <(find app src -name '*.cpp' ! -path 'app/SYCL/*' | sort) | ||
| clang-tidy "${files[@]}" -format-style=file -header-filter="($PWD/include/.*|$PWD/src/.*|$PWD/app/.*)" -p build |
There was a problem hiding this comment.
Use .clang-tidy file in app/SYCL instead
There was a problem hiding this comment.
It seems this comment was not addressed
| target_compile_definitions(run_test PRIVATE _CRT_SECURE_NO_WARNINGS) | ||
|
|
| option(ITLABAI_ENABLE_OPENMP "Enable OpenMP parallel support" ON) | ||
| option(ITLABAI_ENABLE_OPENCV_APPS "Build OpenCV-dependent apps" ON) | ||
| option(ITLABAI_BUILD_TESTS "Build unit tests" ON) | ||
| set(ITLABAI_OPENCV_DIR "" CACHE PATH | ||
| "Path to a prebuilt OpenCV package directory containing OpenCVConfig.cmake") | ||
| set(ITLABAI_TBB_DIR "" CACHE PATH | ||
| "Path to a prebuilt oneTBB package root containing lib/cmake/tbb/TBBConfig.cmake") | ||
| set(ITLABAI_SYCL_TARGETS "" CACHE STRING | ||
| "Optional SYCL targets passed to -fsycl-targets") |
There was a problem hiding this comment.
Can we also not include this to this PR?
| env: | ||
| INTEL_LLVM_TAG: v6.3.0 | ||
| OPENCV_TAG: 4.13.0 | ||
| TBB_TAG: v2022.3.0 |
There was a problem hiding this comment.
Is it possible to reuse our TBB?
|
|
||
| env: | ||
| INTEL_LLVM_TAG: v6.3.0 | ||
| OPENCV_TAG: 4.13.0 |
| target_compile_options(SYCL_Example PRIVATE | ||
| $<$<COMPILE_LANG_AND_ID:CXX,Clang>:-Wno-unused-parameter> | ||
| ) | ||
| set_property(SOURCE sycl_example.cpp APPEND PROPERTY COMPILE_OPTIONS | ||
| $<$<COMPILE_LANG_AND_ID:CXX,Clang>:-Wno-deprecated-declarations> | ||
| ) | ||
| set_property(SOURCE sycl_example.cpp APPEND PROPERTY COMPILE_DEFINITIONS | ||
| SYCL_DISABLE_FSYCL_SYCLHPP_WARNING=1 | ||
| ) |
There was a problem hiding this comment.
Not needed. -Wno-error for the app would be even better
| $<TARGET_PROPERTY:itlabai_sycl,INTERFACE_COMPILE_OPTIONS> | ||
| $<$<COMPILE_LANG_AND_ID:CXX,Clang>:-Wno-unused-parameter> | ||
| $<$<AND:$<COMPILE_LANG_AND_ID:CXX,Clang>,$<PLATFORM_ID:Linux>,$<CONFIG:Debug>>:-O2> | ||
| $<$<AND:$<COMPILE_LANG_AND_ID:CXX,Clang>,$<PLATFORM_ID:Linux>,$<CONFIG:Debug>>:-g0> |
There was a problem hiding this comment.
Is this complication justified?
| void rethrow_async_exceptions(sycl::exception_list exceptions) { | ||
| for (const std::exception_ptr& exception : exceptions) { | ||
| std::rethrow_exception(exception); | ||
| } | ||
| } |
| // returns time in seconds | ||
| template <class Function, typename... Args> | ||
| double elapsed_time_omp(Function&& func, Args&&... args) { | ||
| #if defined(HAS_OPENMP) |
| const Options& opt) { | ||
| static_cast<void>(opt); |
There was a problem hiding this comment.
Use maybe_unused attribute here
| @@ -1,12 +1,14 @@ | |||
| #pragma once | |||
| // clang-format off | |||
| } | ||
|
|
||
| #ifdef HAS_OPENMP | ||
| #ifdef _OPENMP |
| namespace parallel { | ||
|
|
||
| enum class Backend : std::uint8_t { | ||
| enum class Backend : uint8_t { |
There was a problem hiding this comment.
Please, remove all unnecessary changes (since we don't have checks for all platforms). Ideally, that should be one very simple script with < 100 LoC
| @@ -1,4 +1,5 @@ | |||
| #include <cstdint> | |||
| #include <stdint.h> | |||
There was a problem hiding this comment.
Same and everywhere else. Why?
| - name: Run clang-tidy | ||
| run: | | ||
| clang-tidy app/**/*.cpp src/**/*.cpp -format-style=file -header-filter="($PWD/include/.*|$PWD/src/.*|$PWD/app/.*)" -p build | ||
| python3 - <<'PY' |
There was a problem hiding this comment.
There should be no changes. app/SYCL can contain exclusions
| - name: Run clang-tidy | ||
| run: | | ||
| clang-tidy app/**/*.cpp src/**/*.cpp -format-style=file -header-filter="($PWD/include/.*|$PWD/src/.*|$PWD/app/.*)" -p build | ||
| mapfile -t sources < <(find app src -path 'app/SYCL' -prune -o -name '*.cpp' -print) |
| concat_connections[layer_name].push_back(base_input_name); | ||
| } | ||
| } | ||
| auto concat_layer = LayerFactory::createConcatLayer(axis, options); |
| #include "layers/Tensor.hpp" | ||
| #include "layers/TransposeLayer.hpp" | ||
| #include "layers_oneDNN/BinaryOpLayer.hpp" | ||
| #include "layers_oneDNN/ConcatLayer.hpp" |
| @@ -1,30 +1,216 @@ | |||
| include(ExternalProject) | |||
There was a problem hiding this comment.
These changes also should've not been popped out
| @@ -1,5 +1,5 @@ | |||
| #pragma once | |||
| #include <cstdint> | |||
| #include <stdint.h> | |||
8aae86a to
218b148
Compare
dce1126 to
883f1ba
Compare
|
@aobolensk please review |
No description provided.