Skip to content

Commit

Permalink
Merge branch 'master' into col2im_cpu
Browse files Browse the repository at this point in the history
  • Loading branch information
p-wysocki authored Jul 2, 2024
2 parents f5fec06 + 626966b commit c9c229a
Show file tree
Hide file tree
Showing 14 changed files with 231 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/dockerfiles/docker_tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pr-25130
pr-25303
23 changes: 23 additions & 0 deletions .github/dockerfiles/ov_build/fedora_33/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM openvinogithubactions.azurecr.io/dockerio/library/fedora:33

USER root

RUN yum update -y && yum install -y git

# Install build dependencies
ADD install_build_dependencies.sh /install_build_dependencies.sh
RUN chmod +x /install_build_dependencies.sh && \
/install_build_dependencies.sh && \
rm -rf /var/lib/apt/lists/*

# Install sscache
ARG SCCACHE_VERSION="v0.7.5"
ENV SCCACHE_HOME="/opt/sccache" \
SCCACHE_PATH="/opt/sccache/sccache"

RUN mkdir ${SCCACHE_HOME} && cd ${SCCACHE_HOME} && \
SCCACHE_ARCHIVE="sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" && \
curl -SLO https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/${SCCACHE_ARCHIVE} && \
tar -xzf ${SCCACHE_ARCHIVE} --strip-components=1 && rm ${SCCACHE_ARCHIVE}

ENV PATH="$SCCACHE_HOME:$PATH"
33 changes: 33 additions & 0 deletions .github/dockerfiles/ov_build/webassembly/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM openvinogithubactions.azurecr.io/dockerio/emscripten/emsdk:3.1.61

USER root

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf && \
echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf

ENV DEBIAN_FRONTEND="noninteractive" \
TZ="Europe/London"

RUN apt-get update && \
apt-get install software-properties-common && \
add-apt-repository --yes --no-update ppa:git-core/ppa && \
apt-get update && \
apt-get install \
git \
ca-certificates && \
rm -rf /var/lib/apt/lists/*

# Install sscache
ARG SCCACHE_VERSION="v0.7.5"
ENV SCCACHE_HOME="/opt/sccache" \
SCCACHE_PATH="/opt/sccache/sccache"

RUN mkdir ${SCCACHE_HOME} && cd ${SCCACHE_HOME} && \
SCCACHE_ARCHIVE="sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" && \
curl -SLO https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/${SCCACHE_ARCHIVE} && \
tar -xzf ${SCCACHE_ARCHIVE} --strip-components=1 && rm ${SCCACHE_ARCHIVE}

ENV PATH="$SCCACHE_HOME:$PATH"
49 changes: 33 additions & 16 deletions .github/workflows/fedora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}"
steps:
- name: checkout action
Expand All @@ -40,15 +41,42 @@ jobs:
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'

Build:
- name: Show affected components
run: |
echo "${{ toJSON(steps.smart_ci.outputs.affected_components) }}"
shell: bash

Docker:
needs: Smart_CI
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
volumes:
- /mount:/mount
outputs:
images: "${{ steps.handle_docker.outputs.images }}"
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- uses: ./.github/actions/handle_docker
id: handle_docker
with:
images: |
ov_build/fedora_33
registry: 'openvinogithubactions.azurecr.io'
dockerfiles_root_dir: '.github/dockerfiles'
changed_components: ${{ needs.smart_ci.outputs.changed_components }}

Build:
needs: [Docker, Smart_CI]
timeout-minutes: 150
defaults:
run:
shell: bash
runs-on: aks-linux-16-cores-32gb
container:
image: fedora:33
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.fedora_33 }}
volumes:
- /mount:/mount
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
Expand All @@ -69,9 +97,6 @@ jobs:
SCCACHE_AZURE_KEY_PREFIX: fedora33_x86_64_Release
if: "!needs.smart_ci.outputs.skip_workflow"
steps:
- name: Install git
run: yum update -y && yum install -y git

- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
Expand All @@ -89,14 +114,6 @@ jobs:
# Dependencies
#

- name: Install build dependencies
run: bash ${OPENVINO_REPO}/install_build_dependencies.sh

- name: Install sccache
uses: mozilla-actions/sccache-action@89e9040de88b577a072e3760aaf59f585da083af # v0.0.5
with:
version: "v0.7.5"

- name: Install python dependencies
run: |
python3 -m pip install -U pip
Expand Down Expand Up @@ -204,14 +221,14 @@ jobs:
if-no-files-found: 'error'

RPM_Packages:
needs: Build
needs: [Docker, Build]
timeout-minutes: 10
defaults:
run:
shell: bash
runs-on: ubuntu-20.04
runs-on: aks-linux-4-cores-16gb
container:
image: fedora:33
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.fedora_33 }}
env:
RPM_PACKAGES_DIR: /__w/openvino/packages/

Expand Down
40 changes: 30 additions & 10 deletions .github/workflows/webassembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}"
steps:
- name: checkout action
Expand All @@ -40,14 +41,41 @@ jobs:
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'

Build:
- name: Show affected components
run: |
echo "${{ toJSON(steps.smart_ci.outputs.affected_components) }}"
shell: bash

Docker:
needs: Smart_CI
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
volumes:
- /mount:/mount
outputs:
images: "${{ steps.handle_docker.outputs.images }}"
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- uses: ./.github/actions/handle_docker
id: handle_docker
with:
images: |
ov_build/webassembly
registry: 'openvinogithubactions.azurecr.io'
dockerfiles_root_dir: '.github/dockerfiles'
changed_components: ${{ needs.smart_ci.outputs.changed_components }}

Build:
needs: [Docker, Smart_CI]
defaults:
run:
shell: bash
runs-on: aks-linux-16-cores-32gb
container:
image: emscripten/emsdk
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.webassembly }}
volumes:
- /mount:/mount
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
Expand All @@ -62,20 +90,12 @@ jobs:
SCCACHE_AZURE_KEY_PREFIX: webassembly_Release
if: "!needs.smart_ci.outputs.skip_workflow"
steps:
- name: Install git
run: apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates

- name: Clone OpenVINO
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
path: 'openvino'
submodules: 'true'

- name: Install sccache
uses: mozilla-actions/sccache-action@89e9040de88b577a072e3760aaf59f585da083af # v0.0.5
with:
version: "v0.7.5"

- name: emcmake cmake - configure
run: |
emcmake cmake \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class LoopManager {
bool set_default_handlers = true,
bool is_work_amount_const = false) {
const auto normalized_increment = utils::is_dynamic_value(work_amount) || work_amount == 0 ? increment : std::min(increment, work_amount);
const auto handlers = set_default_handlers
const auto& handlers = set_default_handlers
? SpecificIterationHandlers(work_amount, normalized_increment)
: SpecificIterationHandlers();
const auto loop_info = std::make_shared<UnifiedLoopInfo>(work_amount, normalized_increment, entries, exits, handlers, is_work_amount_const);
Expand Down
8 changes: 4 additions & 4 deletions src/common/snippets/src/lowered/loop_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ std::pair<LinearIR::constExprIt, LinearIR::constExprIt> LoopManager::get_loop_bo
}

LoopPort LoopManager::get_loop_port_by_expr_port(const ExpressionPort& expr_port, const size_t loop_id) {
auto get_loop_port = [&](const std::vector<LoopPort>& ports) {
auto get_loop_port = [&](const std::vector<LoopPort>& ports) -> const LoopPort& {
auto it = std::find_if(ports.cbegin(), ports.cend(), [&](const LoopPort& p) { return *p.expr_port == expr_port; });
if (it == ports.cend())
OPENVINO_THROW("Expression has not been found among loop ports. Loop id: " + std::to_string(loop_id));
Expand Down Expand Up @@ -272,7 +272,7 @@ void LoopManager::fuse_loops(LinearIR::constExprIt loop_begin_target, LinearIR::
auto input_ports_upper = loop_info_upper->get_input_ports();
auto output_ports_upper = loop_info_upper->get_output_ports();
auto input_ports_lower = loop_info_lower->get_input_ports();
auto output_ports_lower = loop_info_lower->get_output_ports();
const auto& output_ports_lower = loop_info_lower->get_output_ports();
fuse_loop_ports(output_ports_upper, input_ports_lower, loop_id_upper);

const auto& from = fuse_into_upper ? loop_id_lower : loop_id_upper;
Expand All @@ -285,9 +285,9 @@ void LoopManager::fuse_loops(LinearIR::constExprIt loop_begin_target, LinearIR::
const auto handlers = SpecificIterationHandlers::merge_handlers(loop_info_upper->get_handlers(), loop_info_lower->get_handlers());
const auto is_work_amount_const = loop_info_upper->is_work_amount_const() || loop_info_lower->is_work_amount_const();

auto new_entries = input_ports_upper;
auto new_entries = std::move(input_ports_upper);
new_entries.insert(new_entries.end(), input_ports_lower.begin(), input_ports_lower.end());
auto new_exits = output_ports_upper;
auto new_exits = std::move(output_ports_upper);
new_exits.insert(new_exits.end(), output_ports_lower.begin(), output_ports_lower.end());

m_map[to] = std::make_shared<UnifiedLoopInfo>(work_amount, increment, new_entries, new_exits, handlers, is_work_amount_const);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ void ValidateExpandedLoops::validate_loop_information(const LinearIR& linear_ir)
const auto& expanded_loop_info = ov::as_type_ptr<ExpandedLoopInfo>(p.second);
INFORMATIVE_ASSERT(expanded_loop_info, "expects only ExpandedLoopInfo in LoopManager");

if (expanded_loop_info->get_unified_loop_info() != current_unified_loop_info) {
const auto& unified_loop_info = expanded_loop_info->get_unified_loop_info();
INFORMATIVE_ASSERT(unified_loop_info, "expects non nullptr UnifiedLoopInfo in ExpandedLoopInfo");

if (unified_loop_info != current_unified_loop_info) {
// If there is `current_unified_loop_info` - the previos loop is finished and need to validate total information
if (current_unified_loop_info) {
INFORMATIVE_ASSERT(current_work_amount == current_unified_loop_info->get_work_amount(),
Expand All @@ -61,7 +64,7 @@ void ValidateExpandedLoops::validate_loop_information(const LinearIR& linear_ir)
"total finalization offsets are not equal to finalization offsets of undefined loop");
}

current_unified_loop_info = expanded_loop_info->get_unified_loop_info();
current_unified_loop_info = unified_loop_info;

INFORMATIVE_ASSERT(current_unified_loop_info->get_input_count() == expanded_loop_info->get_input_count() &&
current_unified_loop_info->get_output_count() == expanded_loop_info->get_output_count(),
Expand All @@ -74,6 +77,7 @@ void ValidateExpandedLoops::validate_loop_information(const LinearIR& linear_ir)
}

current_work_amount = utils::dynamic_safe_add(current_work_amount, expanded_loop_info->get_work_amount());
INFORMATIVE_ASSERT(current_unified_loop_info, "expects non nullptr current UnifiedLoopInfo");
INFORMATIVE_ASSERT(current_unified_loop_info->get_ptr_increments() == expanded_loop_info->get_ptr_increments(),
"incompatible pointer increments with UnifiedLoopInfo");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,24 @@

#include <type_traits>
#include "buffer.hpp"
#include "helpers.hpp"
#include "kernel_selector_common.h"
#include "intel_gpu/runtime/kernel_args.hpp"


namespace cldnn {

template <typename BufferType>
class Serializer<BufferType, kernel_selector::clKernelData, typename std::enable_if<std::is_base_of<OutputBuffer<BufferType>, BufferType>::value>::type> {
public:
static void save(BufferType& buffer, const kernel_selector::clKernelData& data) {
const auto& params = data.params;
buffer(params.workGroups.global, params.workGroups.local);
buffer << params.arguments.size();
for (const auto& arg : params.arguments) {
buffer << make_data(&arg.t, sizeof(argument_desc::Types)) << arg.index;
}
buffer << params.scalars.size();
for (const auto& scalar : params.scalars) {
buffer << make_data(&scalar.t, sizeof(scalar_desc::Types)) << make_data(&scalar.v, sizeof(scalar_desc::ValueT));
}
buffer << params.layerID;
data.save(buffer);
}
};

template <typename BufferType>
class Serializer<BufferType, kernel_selector::clKernelData, typename std::enable_if<std::is_base_of<InputBuffer<BufferType>, BufferType>::value>::type> {
public:
static void load(BufferType& buffer, kernel_selector::clKernelData& data) {
auto& params = data.params;
buffer(params.workGroups.global, params.workGroups.local);

typename arguments_desc::size_type arguments_desc_size = 0UL;
buffer >> arguments_desc_size;
params.arguments.resize(arguments_desc_size);
for (auto& arg : params.arguments) {
buffer >> make_data(&arg.t, sizeof(argument_desc::Types)) >> arg.index;
}

typename scalars_desc::size_type scalars_desc_size = 0UL;
buffer >> scalars_desc_size;
params.scalars.resize(scalars_desc_size);
for (auto& scalar : params.scalars) {
buffer >> make_data(&scalar.t, sizeof(scalar_desc::Types)) >> make_data(&scalar.v, sizeof(scalar_desc::ValueT));
}

buffer >> params.layerID;
data.load(buffer);
}
};

Expand Down
Loading

0 comments on commit c9c229a

Please sign in to comment.