Merge branch 'master' into dependabot/pip/tests/pyyaml-6.0.1

This commit is contained in:
Ilya Lavrenov 2024-06-03 00:52:11 +04:00 committed by GitHub
commit b001a34e05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
307 changed files with 8462 additions and 4423 deletions

View File

@ -33258,7 +33258,7 @@ async function save() {
// remote cache directory may not be created yet
if (!(await checkFileExists(cacheRemotePath))) {
await fs.mkdir(cacheRemotePath);
await fs.mkdir(cacheRemotePath, { recursive: true });
}
core.info('Copying cache...');

View File

@ -33258,7 +33258,7 @@ async function save() {
// remote cache directory may not be created yet
if (!(await checkFileExists(cacheRemotePath))) {
await fs.mkdir(cacheRemotePath);
await fs.mkdir(cacheRemotePath, { recursive: true });
}
core.info('Copying cache...');

View File

@ -50,7 +50,7 @@ async function save() {
// remote cache directory may not be created yet
if (!(await checkFileExists(cacheRemotePath))) {
await fs.mkdir(cacheRemotePath);
await fs.mkdir(cacheRemotePath, { recursive: true });
}
core.info('Copying cache...');

View File

@ -23,7 +23,19 @@ runs:
using: 'composite'
steps:
- if: ${{ runner.os == 'Linux' && inputs.self-hosted-runner == 'true' }}
- name: Check if Python is already installed (Linux)
if: ${{ runner.os == 'Linux' }}
shell: bash
id: check_python
run: |
PYTHON_INSTALLED=$(python${{ inputs.version }} -V) || true
if [[ $PYTHON_INSTALLED ]]; then
echo "installed=true" >> $GITHUB_OUTPUT
else
echo "installed=false" >> $GITHUB_OUTPUT
fi
- if: ${{ runner.os == 'Linux' && inputs.self-hosted-runner == 'true' && steps.check_python.outputs.installed == 'false' }}
name: Install 'actions/setup-python@v4' dependencies
shell: bash
run: apt-get update && apt-get install -y ca-certificates software-properties-common gpg-agent tzdata
@ -31,18 +43,18 @@ runs:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
TZ: "Europe/London" # to prevent tzdata from waiting user input
- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }}
- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' && steps.check_python.outputs.installed == 'false' }}
name: Setup sudo and python3
shell: bash
run: apt-get update && apt-get install -y sudo python3 # Needed for the deadsnakes action
- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' }}
- if: ${{ runner.os == 'Linux' && runner.arch == 'ARM64' && steps.check_python.outputs.installed == 'false' }}
name: Setup Python ${{ inputs.version }}
uses: akashchi/deadsnakes-action@92417281055a5878a0450f240a5b95883eb2d7e2
with:
python-version: ${{ inputs.version }}
- if: ${{ runner.os == 'macOS' || runner.os == 'Windows' || (runner.os == 'Linux' && runner.arch != 'ARM64') }}
- if: ${{ runner.os == 'macOS' || runner.os == 'Windows' || (runner.os == 'Linux' && runner.arch != 'ARM64' && steps.check_python.outputs.installed == 'false' ) }}
name: Setup Python ${{ inputs.version }}
uses: actions/setup-python@v5
with:

View File

@ -1 +1 @@
pr-24689
pr-24742

View File

@ -0,0 +1,89 @@
FROM openvinogithubactions.azurecr.io/dockerhub/nvidia/cuda:11.8.0-runtime-ubuntu20.04
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 && \
add-apt-repository --yes --no-update ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install \
curl \
wget \
git \
ca-certificates \
gpg-agent \
tzdata \
# Pythons
python3.8-dev \
python3.8-venv \
python3.8-distutils \
python3.11-dev \
python3.11-venv \
python3.11-distutils \
# For Java API
default-jdk \
# Compiler \
gcc-10 \
g++-10 \
&& \
rm -rf /var/lib/apt/lists/*
# 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/*
# Set gcc-10 as a default compiler
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 30 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 30
# 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}
# Install CUDA
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin && \
mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600 && \
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && \
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
RUN apt update && apt install -y \
libcudnn8=8.9.4.*-1+cuda11.8 \
libcudnn8-dev=8.9.4.*-1+cuda11.8 \
libcudnn8-samples=8.9.4.*-1+cuda11.8 \
cuda-runtime-11-8 \
cuda-11-8 \
libcutensor1=1.6.1.5-1 \
libcutensor-dev=1.6.1.5-1 \
cuda-drivers=520.61.05-1 && \
rm -rf /var/lib/apt/lists/*
# Setup pip
ENV PIP_VERSION="24.0"
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.8 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
python3.11 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
rm -f get-pip.py
# Use Python 3.11 as default instead of Python 3.8
# Using venv here 'cause other methods to switch the default Python on Ubuntu 20 break both system and wheels build
RUN python3.11 -m venv venv
ENV PATH="/venv/bin:$SCCACHE_HOME:$PATH"
ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}

View File

@ -48,3 +48,4 @@ RUN python3.11 -m venv venv
ENV PATH="/venv/bin:$PATH"
ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}
ENV PIP_INSTALL_PATH=/venv/lib/python3.11/site-packages

View File

@ -0,0 +1,52 @@
FROM openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04
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 && \
add-apt-repository --yes --no-update ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install \
curl \
git \
ca-certificates \
gpg-agent \
tzdata \
# Python
python3.11-dev \
python3.11-venv \
python3.11-distutils \
libhdf5-dev \
&& \
rm -rf /var/lib/apt/lists/*
# 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/*
# Setup pip
ENV PIP_VERSION="24.0"
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.8 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
python3.11 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
rm -f get-pip.py
# Use Python 3.11 as default instead of Python 3.8
# Using venv here 'cause other methods to switch the default Python on Ubuntu 20 break both system and wheels build
RUN python3.11 -m venv venv
ENV PATH="/venv/bin:$SCCACHE_HOME:$PATH"
ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}
ENV PIP_INSTALL_PATH=/venv/lib/python3.11/site-packages

View File

@ -0,0 +1,52 @@
FROM openvinogithubactions.azurecr.io/dockerhub/ubuntu:22.04
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 && \
add-apt-repository --yes --no-update ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install \
curl \
git \
ca-certificates \
gpg-agent \
tzdata \
# Python
python3.11-dev \
python3.11-venv \
python3.11-distutils \
libhdf5-dev \
&& \
rm -rf /var/lib/apt/lists/*
# 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/*
# Setup pip
ENV PIP_VERSION="24.0"
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
python3.11 get-pip.py --no-cache-dir pip==${PIP_VERSION} && \
rm -f get-pip.py
# Use Python 3.11 as default
# Using venv here 'cause other methods to switch the default Python on Ubuntu 20 break both system and wheels build
RUN python3.11 -m venv venv
ENV PATH="/venv/bin:$SCCACHE_HOME:$PATH"
ENV PIP_CACHE_DIR=/mount/caches/pip/linux/${PIP_VERSION}
ENV PIP_INSTALL_PATH=/venv/lib/python3.11/site-packages

View File

@ -50,5 +50,9 @@
{
"error_text": "The requested URL returned error: 500",
"ticket": 139384
},
{
"error_text": "Unable to fetch some archives",
"ticket": 130965
}
]

View File

@ -30,10 +30,6 @@ jobs:
PARALLEL_TEST_SCRIPT: ${{ github.workspace }}/install/tests/functional_test_utils/layer_tests_summary/run_parallel.py
PARALLEL_TEST_CACHE: ${{ github.workspace }}/install/tests/test_cache.lst
steps:
- name: Set apt retries
if: runner.os == 'Linux'
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
@ -64,10 +60,6 @@ jobs:
tar -xzf openvino_tests.tar.gz -C $INSTALL_DIR
popd
- name: Install OpenVINO dependencies (Linux)
if: runner.os == 'Linux'
run: $INSTALL_DIR/install_dependencies/install_openvino_dependencies.sh -c=core -c=dev -c=gpu -y
- name: Fetch setup_python action
uses: actions/checkout@v4
with:

View File

@ -32,10 +32,6 @@ jobs:
INSTALL_DIR: ${{ github.workspace }}/install
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
steps:
- name: Set apt retries
if: runner.os == 'Linux'
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
@ -63,10 +59,6 @@ jobs:
tar -xzf openvino_tests.tar.gz -C $INSTALL_DIR
popd
- name: Install OpenVINO dependencies (Linux)
if: runner.os == 'Linux'
run: $INSTALL_DIR/install_dependencies/install_openvino_dependencies.sh -c=core -c=dev -c=gpu -y
#
# Tests
#

View File

@ -35,10 +35,6 @@ jobs:
ONNX_MODEL_ZOO_SHA: "5faef4c33eba0395177850e1e31c4a6a9e634c82"
if: ${{ github.event_name != 'merge_group' }}
steps:
- name: Set apt retries
if: runner.os == 'Linux'
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
@ -70,27 +66,14 @@ jobs:
tar -xzf openvino_tests.tar.gz -C ${INSTALL_DIR}
popd
- name: Fetch setup_python action and model_zoo_preprocess script
- name: Fetch model_zoo_preprocess script
uses: actions/checkout@v4
with:
sparse-checkout: |
.github/actions/setup_python/action.yml
src/frontends/onnx/tests/tests_python/model_zoo_preprocess.sh
sparse-checkout-cone-mode: false
path: 'openvino'
- name: Install dependencies
run: |
# install git (required to build pip deps from the sources)
apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates git-lfs
- name: Setup Python 3.11
uses: ./openvino/.github/actions/setup_python
with:
version: '3.11'
should-setup-pip-paths: 'false'
self-hosted-runner: ${{ contains(inputs.runner, 'aks') }}
- name: Update Models
run: bash ${OPENVINO_REPO}/src/frontends/onnx/tests/tests_python/model_zoo_preprocess.sh -d ${MODELS_SHARE_PATH} -o -s "${{ env.ONNX_MODEL_ZOO_SHA }}"

View File

@ -37,9 +37,6 @@ jobs:
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
LAYER_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/layer_tests
steps:
- name: Set apt retries
if: runner.os == 'Linux'
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
- name: Download OpenVINO package
uses: actions/download-artifact@v4
@ -70,10 +67,6 @@ jobs:
tar -xzf openvino_tests.tar.gz -C $INSTALL_DIR
popd
- name: Install OpenVINO dependencies (Linux)
if: runner.os == 'Linux'
run: $INSTALL_DIR/install_dependencies/install_openvino_dependencies.sh -c=core -c=dev -y -c=gpu
- name: Fetch setup_python action
uses: actions/checkout@v4
with:

View File

@ -140,11 +140,22 @@ jobs:
USE_SYSTEM_CACHE: False
OP_REPORT_FILE: ${{ env.INSTALL_TEST_DIR }}/TEST-torch_unsupported_ops.log
- name: PagedAttention Test
if: always()
run: |
export PYTHONPATH=${MODEL_HUB_TESTS_INSTALL_DIR}:$PYTHONPATH
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch/test_pa_transformation.py -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_pagedattention_tests.html --self-contained-html -v --tb=short
env:
TYPE: ${{ inputs.event == 'schedule' && 'nightly' || 'precommit'}}
TEST_DEVICE: CPU
USE_SYSTEM_CACHE: False
OP_REPORT_FILE: ${{ env.INSTALL_TEST_DIR }}/TEST-torch_unsupported_ops.log
- name: Reformat unsupported ops file
if: '!cancelled()'
run: |
python3 ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch/scripts/process_op_report.py ${INSTALL_TEST_DIR}/TEST-torch_unsupported_ops.log
- name: Available storage after tests
run: |
echo "Available storage:"

View File

@ -31,10 +31,6 @@ jobs:
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
BUILD_DIR: ${{ github.workspace }}/build
steps:
- name: Set apt retries
if: runner.os == 'Linux'
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
@ -63,10 +59,6 @@ jobs:
tar -xzf openvino_tests.tar.gz -C $INSTALL_DIR
popd
- name: Install OpenVINO dependencies (Linux)
if: runner.os == 'Linux'
run: $INSTALL_DIR/install_dependencies/install_openvino_dependencies.sh -c=core -c=dev -y
- name: Install OpenVINO dependencies (mac)
if: runner.os == 'macOS'
run: brew install coreutils
@ -84,7 +76,6 @@ jobs:
with:
version: '3.11'
should-setup-pip-paths: 'false'
self-hosted-runner: ${{ runner.os == 'Linux' }}
- name: Build cpp samples - GCC
run: $INSTALL_DIR/samples/cpp/build_samples.sh -i $INSTALL_DIR -b $BUILD_DIR/cpp_samples
@ -94,7 +85,7 @@ jobs:
- name: Build cpp samples - Clang
if: runner.os == 'Linux'
run: |
apt-get install -y clang
apt-get update && apt-get install -y clang
$INSTALL_DIR/samples/cpp/build_samples.sh -i $INSTALL_DIR -b $BUILD_DIR/cpp_samples_clang
env:
CMAKE_COMPILE_WARNING_AS_ERROR: 'ON'

View File

@ -41,10 +41,6 @@ jobs:
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
LAYER_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/layer_tests
steps:
- name: Set apt retries
if: runner.os == 'Linux'
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
@ -92,10 +88,6 @@ jobs:
Expand-Archive openvino_tests.zip -DestinationPath ${{ env.INSTALL_DIR }}
popd
- name: Install OpenVINO dependencies (Linux)
if: runner.os == 'Linux'
run: $INSTALL_DIR/install_dependencies/install_openvino_dependencies.sh -c=core -c=dev -y -c=gpu
- name: Fetch setup_python action
uses: actions/checkout@v4
with:

View File

@ -34,19 +34,6 @@ jobs:
MODEL_HUB_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/model_hub_tests
NUMBER_OF_REPLICAS: 2
steps:
- name: Check sudo
if: ${{ runner.os == 'Linux' }}
run: if [ "$(id -u)" -eq 0 ]; then apt update && apt --assume-yes install sudo; fi
- name: Set apt retries
if: runner.os == 'Linux'
run: |
if [ "$(id -u)" -eq 0 ]; then
echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
else
sudo sh -c "echo 'Acquire::Retries \"10\";' >> /etc/apt/apt.conf.d/80-retries"
fi
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
@ -95,12 +82,6 @@ jobs:
sparse-checkout-cone-mode: false
path: 'openvino'
- name: Install dependencies
if: ${{ runner.os == 'Linux' }}
run: |
# install git (required to build pip deps from the sources)
sudo apt-get install --assume-yes --no-install-recommends g++ git ca-certificates wget
- name: Setup Python 3.11
uses: ./openvino/.github/actions/setup_python
with:

View File

@ -56,7 +56,6 @@ jobs:
install_build_dependencies.sh
- name: Setup Python ${{ env.PYTHON_VERSION }}
if: ${{ runner.os != 'Linux' }} # We do not need to install Python on Linux as we use Docker with it installed
uses: ./.github/actions/setup_python
with:
version: ${{ env.PYTHON_VERSION }}

View File

@ -69,6 +69,8 @@ jobs:
with:
images: |
ov_build/ubuntu_20_04_x64
ov_build/ubuntu_20_04_x64_nvidia
ov_test/ubuntu_20_04_x64
registry: 'openvinogithubactions.azurecr.io'
dockerfiles_root_dir: '.github/dockerfiles'
changed_components: ${{ needs.smart_ci.outputs.changed_components }}
@ -308,22 +310,22 @@ jobs:
image: 'openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04'
Samples:
needs: [ Build, Smart_CI ]
needs: [ Docker, Build, Smart_CI ]
if: fromJSON(needs.smart_ci.outputs.affected_components).samples
uses: ./.github/workflows/job_samples_tests.yml
with:
runner: 'aks-linux-4-cores-16gb'
image: 'openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04'
image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_20_04_x64 }}
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
JS_API:
name: OpenVINO JS API
needs: [ Build, Smart_CI ]
needs: [ Docker, Build, Smart_CI ]
if: fromJSON(needs.smart_ci.outputs.affected_components).JS_API
uses: ./.github/workflows/job_openvino_js.yml
with:
runner: 'aks-linux-4-cores-16gb'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04"}'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_20_04_x64 }}"}'
Conformance:
needs: [ Build, Smart_CI ]
@ -470,79 +472,79 @@ jobs:
name: ONNX Models Tests
if: fromJSON(needs.smart_ci.outputs.affected_components).Python_API.test ||
fromJSON(needs.smart_ci.outputs.affected_components).ONNX_FE.test
needs: [ Build, Smart_CI ]
needs: [ Docker, Build, Smart_CI ]
uses: ./.github/workflows/job_onnx_models_tests.yml
with:
runner: 'aks-linux-16-cores-32gb'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04", "volumes": ["/mount:/mount"]}'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_20_04_x64 }}", "volumes": ["/mount:/mount"]}'
CXX_Unit_Tests:
name: C++ unit tests
needs: [ Build, Smart_CI ]
needs: [ Docker, Build, Smart_CI ]
uses: ./.github/workflows/job_cxx_unit_tests.yml
with:
runner: 'aks-linux-4-cores-16gb'
image: 'openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04'
image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_20_04_x64 }}
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
Python_Unit_Tests:
name: Python unit tests
needs: [ Build, Smart_CI ]
needs: [ Docker, Build, Smart_CI ]
uses: ./.github/workflows/job_python_unit_tests.yml
with:
runner: 'aks-linux-4-cores-16gb'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04", "volumes": ["/mount:/mount"]}'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_20_04_x64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
needs: [ Build, Smart_CI, Openvino_tokenizers ]
needs: [ Docker, Build, Smart_CI, Openvino_tokenizers ]
uses: ./.github/workflows/job_tensorflow_layer_tests.yml
with:
runner: 'aks-linux-4-cores-16gb'
shell: bash
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04", "volumes": ["/mount:/mount"]}'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_20_04_x64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
CPU_Functional_Tests:
name: CPU functional tests
if: fromJSON(needs.smart_ci.outputs.affected_components).CPU.test
needs: [ Build, Smart_CI ]
needs: [ Docker, Build, Smart_CI ]
uses: ./.github/workflows/job_cpu_functional_tests.yml
with:
runner: 'aks-linux-8-cores-32gb'
image: 'openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04'
image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_20_04_x64 }}
TensorFlow_Models_Tests_Precommit:
name: TensorFlow Models tests
if: fromJSON(needs.smart_ci.outputs.affected_components).TF_FE.test ||
fromJSON(needs.smart_ci.outputs.affected_components).TFL_FE.test
needs: [ Build, Smart_CI, Openvino_tokenizers ]
needs: [ Docker, Build, Smart_CI, Openvino_tokenizers ]
uses: ./.github/workflows/job_tensorflow_models_tests.yml
with:
runner: 'aks-linux-8-cores-16gb'
model_scope: 'precommit'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04", "volumes": ["/mount:/mount"]}'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_20_04_x64 }}", "volumes": ["/mount:/mount"]}'
TensorFlow_Models_Tests_Nightly_TF_HUB:
name: TensorFlow TF Hub Models tests
if: ${{ github.event_name == 'schedule' }}
needs: [ Build, Smart_CI, Openvino_tokenizers ]
needs: [ Docker, Build, Smart_CI, Openvino_tokenizers ]
uses: ./.github/workflows/job_tensorflow_models_tests.yml
with:
runner: 'aks-linux-8-cores-32gb'
model_scope: 'nightly_tf_hub'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04", "volumes": ["/mount:/mount"]}'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_20_04_x64 }}", "volumes": ["/mount:/mount"]}'
TensorFlow_Models_Tests_Nightly_HF:
name: TensorFlow Hugging Face Models tests
if: ${{ github.event_name == 'schedule' }}
needs: [ Build, Smart_CI, Openvino_tokenizers ]
needs: [ Docker, Build, Smart_CI, Openvino_tokenizers ]
uses: ./.github/workflows/job_tensorflow_models_tests.yml
with:
runner: 'aks-linux-8-cores-32gb'
model_scope: 'nightly_hf'
container: '{"image": "openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04", "volumes": ["/mount:/mount"]}'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_20_04_x64 }}", "volumes": ["/mount:/mount"]}'
# TODO: Switch back to self-hosted runners
# container:
@ -560,14 +562,14 @@ jobs:
NVIDIA_Plugin:
name: NVIDIA plugin
needs: [ Build, Smart_CI ]
needs: [ Docker, Build, Smart_CI ]
timeout-minutes: 15
defaults:
run:
shell: bash
runs-on: aks-linux-16-cores-32gb
container:
image: openvinogithubactions.azurecr.io/dockerhub/nvidia/cuda:11.8.0-runtime-ubuntu20.04
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_20_04_x64_nvidia }}
volumes:
- /mount:/mount
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
@ -591,20 +593,6 @@ jobs:
if: fromJSON(needs.smart_ci.outputs.affected_components).NVIDIA
steps:
- name: Set apt retries
run: echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80-retries
- name: Fetch install_build_dependencies.sh
uses: actions/checkout@v4
with:
sparse-checkout: |
install_build_dependencies.sh
sparse-checkout-cone-mode: false
path: ${{ env.OPENVINO_REPO }}
- name: Install Prerequisites
run: apt update && apt install -y git ca-certificates
- name: Download OpenVINO package
uses: actions/download-artifact@v4
with:
@ -634,38 +622,6 @@ jobs:
path: ${{ env.OPENVINO_CONTRIB_REPO }}
ref: 'master'
#
# Dependencies
#
- name: Install build dependencies
run: |
${OPENVINO_REPO}/install_build_dependencies.sh
apt -y --no-install-recommends install software-properties-common curl
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.4
with:
version: "v0.7.5"
- name: Install CUDA
run: |
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
apt update
apt install -y \
libcudnn8=8.9.4.*-1+cuda11.8 \
libcudnn8-dev=8.9.4.*-1+cuda11.8 \
libcudnn8-samples=8.9.4.*-1+cuda11.8 \
cuda-runtime-11-8 \
cuda-11-8 \
libcutensor1=1.6.1.5-1 \
libcutensor-dev=1.6.1.5-1 \
cuda-drivers=520.61.05-1
#
# Build
#

View File

@ -66,6 +66,7 @@ jobs:
with:
images: |
ov_build/ubuntu_22_04_x64_cc
ov_test/ubuntu_22_04_x64
registry: 'openvinogithubactions.azurecr.io'
dockerfiles_root_dir: '.github/dockerfiles'
changed_components: ${{ needs.smart_ci.outputs.changed_components }}
@ -333,11 +334,11 @@ jobs:
CPU_Functional_Tests:
name: CPU functional tests
if: fromJSON(needs.smart_ci.outputs.affected_components).CPU.test
needs: [ Build, Smart_CI ]
needs: [ Docker, Build, Smart_CI ]
uses: ./.github/workflows/job_cpu_functional_tests.yml
with:
runner: 'aks-linux-8-cores-32gb'
image: 'openvinogithubactions.azurecr.io/dockerhub/ubuntu:22.04'
image: ${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64 }}
Overall_Status:
name: ci/gha_overall_status_linux_cc

View File

@ -401,7 +401,7 @@ jobs:
--gtest_output=xml:${INSTALL_TEST_DIR}/TEST-OpImplTests.xml
- name: AUTO unit tests
if: ${{ 'false' }} # Ticket: 134423
if: always()
run: |
source ${INSTALL_DIR}/setupvars.sh
${INSTALL_TEST_DIR}/ov_auto_unit_tests --gtest_print_time=1 \

View File

@ -50,7 +50,7 @@ jobs:
defaults:
run:
shell: pwsh
runs-on: aks-win-8-cores-64gb
runs-on: aks-win-32-cores-128gb
env:
CMAKE_BUILD_TYPE: 'Release'
CMAKE_GENERATOR: 'Ninja Multi-Config'
@ -262,7 +262,7 @@ jobs:
defaults:
run:
shell: pwsh
runs-on: aks-win-8-cores-64gb
runs-on: aks-win-32-cores-128gb
env:
CMAKE_BUILD_TYPE: 'Release'
OPENVINO_REPO: "${{ github.workspace }}\\openvino"

View File

@ -6,7 +6,7 @@ Additional Resources
.. meta::
:description: Learn more about OpenVINO from benchmark results, case studies
:description: Learn more about OpenVINO from benchmark results, case studies
and lists of supported models, operations and devices.
.. toctree::
@ -14,7 +14,7 @@ Additional Resources
:hidden:
additional-resources/glossary
additional-resources/legal-information
Legal and Responsible AI Information <./additional-resources/legal-information>
additional-resources/telemetry
Case Studies <https://www.intel.com/openvino-success-stories>
@ -23,9 +23,9 @@ Additional Resources
:doc:`Glossary <additional-resources/glossary>` contains terms used in OpenVINO.
:doc:`Legal Information <additional-resources/legal-information>` has trademark information and other legal statements.
:doc:`Legal and Responsible AI Information <additional-resources/legal-information>` provides trademark information and other legal statements.
:doc:`OpenVINO™ Telemetry <additional-resources/telemetry>` has detailed information on the telemetry data collection.
:doc:`OpenVINO™ Telemetry <additional-resources/telemetry>` has detailed information on the telemetry data collection.
`Case Studies <https://www.intel.com/openvino-success-stories>`__ are articles about real-world examples of OpenVINO™ usage.

View File

@ -1,7 +1,7 @@
.. {#openvino_docs_Legal_Information}
Legal Information
=================
Legal and Responsible AI Information
=====================================
.. meta::
@ -46,4 +46,12 @@ Intel Global Human Right Principles
Intel is committed to respecting human rights and avoiding causing or contributing to adverse
impacts on human rights. See `Intel's Global Human Rights Principles <https://www.intel.com/content/dam/www/central-libraries/us/en/documents/policy-human-rights.pdf>`__.
Intel's products and software are intended only to be used in applications that do not cause or
contribute to adverse impacts on human rights.
contribute to adverse impacts on human rights.
Model Card Statement
###########################################################
We recommend that users, wherever you are sourcing the model from, should check for a model card,
consult the model card for each model you access and use, and create one if you are developing
or updating a model. A model card is a short document that provides key information to assess
performance and validation and ensure appropriate use.

View File

@ -1,5 +1,3 @@
.. {#system_requirements}
System Requirements
===================
@ -30,6 +28,7 @@ CPU
.. tab-item:: Supported Operating Systems
* Ubuntu 24.04 long-term support (LTS), 64-bit (Kernel 6.8+)
* Ubuntu 22.04 long-term support (LTS), 64-bit (Kernel 5.15+)
* Ubuntu 20.04 long-term support (LTS), 64-bit (Kernel 5.15+)
* Ubuntu 18.04 long-term support (LTS) with limitations, 64-bit (Kernel 5.4+)
@ -59,6 +58,7 @@ GPU
.. tab-item:: Supported Operating Systems
* Ubuntu 24.04 long-term support (LTS), 64-bit
* Ubuntu 22.04 long-term support (LTS), 64-bit
* Ubuntu 20.04 long-term support (LTS), 64-bit
* Windows 10, 64-bit
@ -75,7 +75,7 @@ GPU
for information about your processor.
* While this release of OpenVINO supports Ubuntu 20.04, the driver stack
for Intel discrete graphic cards does not fully support Ubuntu 20.04.
We recommend using Ubuntu 22.04 when executing on discrete graphics.
We recommend using Ubuntu 22.04 and later when executing on discrete graphics.
* The following minimum (i.e., used for old hardware) OpenCL™ driver's versions
were used during OpenVINO internal validation: 22.43 for Ubuntu 22.04, 21.48
for Ubuntu 20.04 and 21.49 for Red Hat Enterprise Linux 8 (some hardware may require
@ -88,6 +88,7 @@ Intel® Neural Processing Unit
.. tab-item:: Operating Systems for NPU
* Ubuntu 24.04 long-term support (LTS), 64-bit
* Ubuntu 22.04 long-term support (LTS), 64-bit
* Windows 11, 64-bit (22H2, 23H2)
@ -106,6 +107,7 @@ Operating systems and developer environment
.. tab-item:: Linux OS
* Ubuntu 24.04 with Linux kernel 6.8+
* Ubuntu 22.04 with Linux kernel 5.15+
* Ubuntu 20.04 with Linux kernel 5.15+
* Red Hat Enterprise Linux 8 with Linux kernel 5.4

View File

@ -16,7 +16,7 @@ GET STARTED
Install OpenVINO <get-started/install-openvino>
Additional Hardware Setup <get-started/configurations>
Troubleshooting <get-started/troubleshooting-install-config>
System Requirements <about-openvino/system-requirements>
System Requirements <./about-openvino/release-notes-openvino/system-requirements>
.. raw:: html

View File

@ -32,12 +32,16 @@ Below are the instructions on how to install the OpenCL packages on supported Li
.. tab-set::
.. tab-item:: Ubuntu 22.04 LTS
.. tab-item:: Ubuntu 22.04 LTS / Ubuntu 24.04 LTS
:sync: ubuntu-22
Download and install the `deb` packages published `here <https://github.com/intel/compute-runtime/releases/latest>`__ and install the apt package `ocl-icd-libopencl1` with the OpenCl ICD loader.
Download and install the `deb` packages published `here <https://github.com/intel/compute-runtime/releases/latest>`__
and install the apt package `ocl-icd-libopencl1` with the OpenCl ICD loader.
Alternatively, you can add the apt repository by following the `installation guide <https://dgpu-docs.intel.com/driver/installation.html#ubuntu-install-steps>`__. Then install the `ocl-icd-libopencl1`, `intel-opencl-icd`, `intel-level-zero-gpu` and `level-zero` apt packages:
Alternatively, you can add the apt repository by following the
`installation guide <https://dgpu-docs.intel.com/driver/installation.html#ubuntu-install-steps>`__.
Then install the `ocl-icd-libopencl1`, `intel-opencl-icd`, `intel-level-zero-gpu` and `level-zero`
apt packages:
.. code-block:: sh
@ -119,7 +123,7 @@ Below are the required steps to make it work with OpenVINO:
wsl --update
wsl --shutdown
- When booting Ubuntu 20.04 or Ubuntu 22.04, install the same drivers as described above in the Linux section
- When booting Ubuntu 20.04, 22.04, or 24.04 install the same drivers as described above in the Linux section
.. note::
@ -128,29 +132,6 @@ Below are the required steps to make it work with OpenVINO:
Additional Resources
####################
.. The following Intel® Graphics Driver versions were used during OpenVINO's internal validation:
.. <The table below is out of date and we do not have an updated list of drivers used for validation as of 2024.0 release date.>
.. <The table will be updated when an updated list of drivers is available>
.. +------------------+-------------------------------------------------------------------------------------------+
.. | Operation System | Driver version |
.. +==================+===========================================================================================+
.. | Ubuntu 22.04 | `22.43.24595.30 <https://github.com/intel/compute-runtime/releases/tag/22.43.24595.30>`__ |
.. +------------------+-------------------------------------------------------------------------------------------+
.. | Ubuntu 20.04 | `22.35.24055 <https://github.com/intel/compute-runtime/releases/tag/22.35.24055>`__ |
.. +------------------+-------------------------------------------------------------------------------------------+
.. | Ubuntu 18.04 | `21.38.21026 <https://github.com/intel/compute-runtime/releases/tag/21.38.21026>`__ |
.. +------------------+-------------------------------------------------------------------------------------------+
.. | CentOS 7 | `19.41.14441 <https://github.com/intel/compute-runtime/releases/tag/19.41.14441>`__ |
.. +------------------+-------------------------------------------------------------------------------------------+
.. | RHEL 8 | `22.28.23726 <https://github.com/intel/compute-runtime/releases/tag/22.28.23726>`__ |
.. +------------------+-------------------------------------------------------------------------------------------+
.. Whats Next?
.. ############
* :doc:`GPU Device <../../openvino-workflow/running-inference/inference-devices-and-modes/gpu-device>`
* :doc:`Install Intel® Distribution of OpenVINO™ toolkit from a Docker Image <../install-openvino/install-openvino-archive-linux>`
* `Docker CI framework for Intel® Distribution of OpenVINO™ toolkit <https://github.com/openvinotoolkit/docker_ci/blob/master/README.md>`__

View File

@ -4,7 +4,7 @@ Configurations for Intel® NPU with OpenVINO™
===============================================
.. meta::
:description: Learn how to provide additional configuration for Intel®
:description: Learn how to provide additional configuration for Intel®
NPU to work with the OpenVINO™ toolkit on your system.
@ -19,27 +19,27 @@ Make sure you use the most recent supported driver for your hardware setup.
The driver is maintained as open source and may be found in the following repository,
together with comprehensive information on installation and system requirements:
`github.com/intel/linux-npu-driver <https://github.com/intel/linux-npu-driver>`__
It is recommended to check for the latest version of the driver.
Make sure you use a supported OS version, as well as install make, gcc,
and Linux kernel headers. To check the NPU state, use the ``dmesg``
command in the console. A successful boot-up of the NPU should give you
a message like this one:
``[ 797.193201] [drm] Initialized intel_vpu 0.<version number> for 0000:00:0b.0 on minor 0``
The current requirement for inference on NPU is Ubuntu 22.04 with the kernel
version of 6.6 or higher.
The current requirement for inference on NPU is the minimum of Ubuntu 22.04, kernel
version of 6.6.
.. tab-item:: Windows
The Intel® NPU driver for Windows is available through Windows Update but
it may also be installed manually by downloading the
`NPU driver package <https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html>`__ and following the
it may also be installed manually by downloading the
`NPU driver package <https://www.intel.com/content/www/us/en/download/794734/intel-npu-driver-windows.html>`__ and following the
`Windows driver installation guide <https://support.microsoft.com/en-us/windows/update-drivers-manually-in-windows-ec62f46c-ff14-c91d-eead-d7126dc1f7b6>`__.
If a driver has already been installed you should be able to find
'Intel(R) NPU Accelerator' in Windows Device Manager. If you
If a driver has already been installed you should be able to find
'Intel(R) NPU Accelerator' in Windows Device Manager. If you
cannot find such a device, the NPU is most likely listed in "Other devices"
as "Multimedia Video Controller."

View File

@ -1,6 +1,4 @@
.. {#openvino_docs_install_guides_overview}
Install OpenVINO™ 2024.0
Install OpenVINO™ 2024.2
==========================
@ -36,17 +34,17 @@ Install OpenVINO™ 2024.0
.. tip::
OpenVINO 2024.0, described here, is not a Long-Term-Support version!
OpenVINO 2024.2, described here, is not a Long-Term-Support version!
All currently supported versions are:
* 2024.0 (development)
* 2024.2 (development)
* 2023.3 (LTS)
* 2022.3 (LTS)
Moreover, different OpenVINO distributions may support slightly different sets of features.
Read installation guides for particular distributions for more details.
.. dropdown:: Distribution Comparison for OpenVINO 2024.0
.. dropdown:: Distribution Comparison for OpenVINO 2024.2
=============== ========== ====== =============== ======== ============ ========== ========== ==========
Device Archives PyPI APT/YUM/ZYPPER Conda Homebrew vcpkg Conan npm
@ -56,7 +54,7 @@ Install OpenVINO™ 2024.0
NPU V\* V\* V\ * n/a n/a n/a n/a V\*
=============== ========== ====== =============== ======== ============ ========== ========== ==========
| \* **Of the Linux systems, only Ubuntu 22.04 includes drivers for NPU device.**
| \* **Of the Linux systems, versions 22.04 and 24.04 include drivers for NPU.**
| **For Windows, CPU inference on ARM64 is not supported.**
| **Build OpenVINO from source**

View File

@ -73,6 +73,13 @@ Step 1: Set Up the OpenVINO Toolkit APT Repository
.. tab-set::
.. tab-item:: Ubuntu 24
:sync: ubuntu-24
.. code-block:: sh
echo "deb https://apt.repos.intel.com/openvino/2024 ubuntu24 main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2024.list
.. tab-item:: Ubuntu 22
:sync: ubuntu-22
@ -148,7 +155,7 @@ Step 2: Install OpenVINO Runtime Using the APT Package Manager
.. code-block:: sh
sudo apt install openvino-2024.0.0
sudo apt install openvino-2024.2.0
.. note::
@ -221,7 +228,7 @@ To uninstall OpenVINO Runtime via APT, run the following command based on your n
.. code-block:: sh
sudo apt autoremove openvino-2024.0.0
sudo apt autoremove openvino-2024.2.0
What's Next?

View File

@ -1,5 +1,3 @@
.. {#openvino_docs_install_guides_installing_openvino_from_archive_linux}
Install OpenVINO™ Runtime on Linux from an Archive File
=========================================================
@ -30,6 +28,7 @@ Install OpenVINO™ Runtime on Linux from an Archive File
Ubuntu18 x86_64 V V n/a
Ubuntu20 x86_64 V V V
Ubuntu22 x86_64 V V V
Ubuntu24 x86_64 V V V
RHEL8 x86_64 V V n/a
=================== ===== ===== =====
@ -130,6 +129,16 @@ Step 1: Download and Install the OpenVINO Core Components
.. tab-set::
.. tab-item:: Ubuntu 24.04
:sync: ubuntu-24
.. code-block:: sh
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.1/linux/l_openvino_toolkit_ubuntu22_2024.1.0.15008.f4afc983258_x86_64.tgz --output openvino_2024.1.0.tgz
tar -xf openvino_2024.1.0.tgz
sudo mv l_openvino_toolkit_ubuntu24_2024.1.0.15008.f4afc983258_x86_64 /opt/intel/openvino_2024.1.0
.. tab-item:: Ubuntu 22.04
:sync: ubuntu-22

View File

@ -52,7 +52,7 @@ Installing OpenVINO Runtime with Conan Package Manager
.. code-block:: sh
[requires]
openvino/2024.1.0
openvino/2024.2.0
[generators]
CMakeDeps
CMakeToolchain

View File

@ -64,7 +64,7 @@ Installing OpenVINO Runtime with Anaconda Package Manager
.. code-block:: sh
conda install -c conda-forge openvino=2024.1.0
conda install -c conda-forge openvino=2024.2.0
Congratulations! You've just Installed OpenVINO! For some use cases you may still
need to install additional components. Check the description below, as well as the
@ -115,7 +115,7 @@ with the proper OpenVINO version number:
.. code-block:: sh
conda remove openvino=2024.1.0
conda remove openvino=2024.2.0
What's Next?
############################################################

View File

@ -128,7 +128,7 @@ Install OpenVINO Runtime
.. code-block:: sh
sudo yum install openvino-2024.0.0
sudo yum install openvino-2024.2.0
@ -199,7 +199,7 @@ To uninstall OpenVINO Runtime via YUM, run the following command based on your n
.. code-block:: sh
sudo yum autoremove openvino-2024.0.0
sudo yum autoremove openvino-2024.2.0

View File

@ -143,7 +143,7 @@ To uninstall OpenVINO Runtime via ZYPPER, run the following command based on you
.. code-block:: sh
sudo zypper remove *openvino-2024.0.0*
sudo zypper remove *openvino-2024.2.0*

View File

@ -10,14 +10,14 @@ Troubleshooting Guide for OpenVINO™ Installation & Configuration
of OpenVINO™ on your system.
| This guide provides general troubleshooting steps and solutions to possible issues that
may be encountered while installing and configuring OpenVINO™. For a comprehensive
database of support topics on OpenVINO, go to:
| This article provides general troubleshooting steps and solutions to possible issues that you
may face while installing and configuring OpenVINO™. For a comprehensive database of support
topics on OpenVINO, go to:
| `Support for OpenVINO™ toolkit <https://www.intel.com/content/www/us/en/support/products/96066/software/development-software/openvino-toolkit.html>`__
.. dropdown:: Errors with Installing via PIP for Users in China
.. dropdown:: PIP for Users in China gives errors
Users in China might encounter errors while downloading sources via PIP during OpenVINO™
installation. To resolve the issues, try adding the download source using the ``-i``
@ -34,16 +34,18 @@ Troubleshooting Guide for OpenVINO™ Installation & Configuration
pip install openvino-dev[tensorflow2] -i https://mirrors.aliyun.com/pypi/simple/
.. dropdown:: ImportError: cannot import name 'Core' from 'openvino'
.. dropdown:: Issues with Installing OpenVINO on Linux from Docker
This error may appear on systems lacking C++ components. Since it is almost exclusively a
Windows case, installing `Microsoft Visual C++ Redistributable [vc_redist.x64] <https://aka.ms/vs/17/release/vc_redist.x64.exe>`__
package may fix it. For more information on dependencies, check
:doc:`System Requirements <../about-openvino/release-notes-openvino/system-requirements>` and
:doc:`Additional Hardware Configurations <./configurations>`
.. _proxy-issues:
.. dropdown:: Proxy issues installing OpenVINO on Linux from Docker
Proxy Issues
++++++++++++
If you meet proxy issues during the installation with Docker, you need set up proxy settings
for Docker. See the `Docker guide <https://docs.docker.com/network/proxy/#set-proxy-using-the-cli>`__
If you face proxy issues during installation with Docker, you may need to set up proxy
settings for it. See the `Docker guide <https://docs.docker.com/network/proxy/#set-proxy-using-the-cli>`__
for more details.
.. dropdown:: Check the version of OpenVINO Runtime
@ -81,11 +83,11 @@ Troubleshooting Guide for OpenVINO™ Installation & Configuration
.. dropdown:: Check if environment variables are set correctly
- For Python developers, if you previously installed OpenVINO using the archive file,
* For Python developers, if you previously installed OpenVINO using the archive file,
and are now installing OpenVINO using PIP, remove all the PATH settings and the lines with
``setupvars`` from ``.bashrc``. Note that if you installed OpenVINO with PIP in a virtual
environment, you don't need to set any environment variables.
- If you have installed OpenVINO before, you probably have added ``setupvars`` to your
* If you have installed OpenVINO before, you probably have added ``setupvars`` to your
``PATH /.bashrc`` or Windows environment variables. After restarting your environment,
you should see an information similar to the following:
@ -93,10 +95,10 @@ Troubleshooting Guide for OpenVINO™ Installation & Configuration
[setupvars.sh] OpenVINO™ environment initialized
- If you don't see the information above, your PATH variables may be configured incorrectly.
* If you don't see the information above, your PATH variables may be configured incorrectly.
Check if you have typed the correct <INSTALL_DIR> or you are trying to activate in the
correct directory.
- If you added it to a ``.bashrc`` file, make sure that the command is correctly written and
* If you added it to a ``.bashrc`` file, make sure that the command is correctly written and
the file is found in the ``~/.bashrc`` folder.
.. dropdown:: Verify that OpenVINO is correctly installed

View File

@ -9,7 +9,7 @@ Bert Benchmark Python Sample
This sample demonstrates how to estimate performance of a Bert model using Asynchronous
Inference Request API. Unlike `demos <https://docs.openvino.ai/nightly/omz_demos.html>`__ this sample does not have
Inference Request API. Unlike `demos <https://docs.openvino.ai/2024/omz_demos.html>`__ this sample does not have
configurable command line arguments. Feel free to modify sample's source code to
try out different options.

View File

@ -264,7 +264,7 @@ You need a model that is specific for your inference task. You can get it from o
Convert the Model
--------------------
If Your model requires conversion, check the `article <https://docs.openvino.ai/2023.3/openvino_docs_../../get-started_../../get-started_demos.html>`__ for information how to do it.
If Your model requires conversion, check the `article <https://docs.openvino.ai/2024/learn-openvino/openvino-samples/get-started-demos.html>`__ for information how to do it.
.. _download-media:

View File

@ -211,6 +211,6 @@ Additional Resources
- :doc:`Get Started with Samples <get-started-demos>`
- :doc:`Using OpenVINO Samples <../openvino-samples>`
- :doc:`Convert a Model <../../documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api>`
- `API Reference <https://docs.openvino.ai/2023.2/api/api_reference.html>`__
- `API Reference <https://docs.openvino.ai/2024/api/api_reference.html>`__
- `Hello NV12 Input Classification C++ Sample on Github <https://github.com/openvinotoolkit/openvino/blob/master/samples/cpp/hello_nv12_input_classification/README.md>`__
- `Hello NV12 Input Classification C Sample on Github <https://github.com/openvinotoolkit/openvino/blob/master/samples/c/hello_nv12_input_classification/README.md>`__

View File

@ -11,7 +11,7 @@ Sync Benchmark Sample
This sample demonstrates how to estimate performance of a model using Synchronous
Inference Request API. It makes sense to use synchronous inference only in latency
oriented scenarios. Models with static input shapes are supported. Unlike
`demos <https://docs.openvino.ai/nightly/omz_demos.html>`__ this sample does not have other configurable command-line
`demos <https://docs.openvino.ai/2024/omz_demos.html>`__ this sample does not have other configurable command-line
arguments. Feel free to modify sample's source code to try out different options.
Before using the sample, refer to the following requirements:

View File

@ -9,7 +9,7 @@ Throughput Benchmark Sample
This sample demonstrates how to estimate performance of a model using Asynchronous
Inference Request API in throughput mode. Unlike `demos <https://docs.openvino.ai/nightly/omz_demos.html>`__ this sample
Inference Request API in throughput mode. Unlike `demos <https://docs.openvino.ai/2024/omz_demos.html>`__ this sample
does not have other configurable command-line arguments. Feel free to modify sample's
source code to try out different options.

View File

@ -1,5 +1,3 @@
.. {#openvino_deployment_guide}
Deploy Locally
==============
@ -43,11 +41,11 @@ The table below shows which distribution type can be used for what target operat
* - Distribution type
- Operating systems
* - Debian packages
- Ubuntu 18.04 long-term support (LTS), 64-bit; Ubuntu 20.04 long-term support (LTS), 64-bit
- Ubuntu 18.04, 20.04, 22.04, 24.04 (64-bit)
* - RPM packages
- Red Hat Enterprise Linux 8, 64-bit
* - Docker images
- Ubuntu 22.04 long-term support (LTS), 64-bit; Ubuntu 20.04 long-term support (LTS), 64-bit; Red Hat Enterprise Linux 8, 64-bit
- Ubuntu 20.04, 22.04, 24.04 (64-bit); Red Hat Enterprise Linux 8, 64-bit
* - PyPI (PIP package manager)
- See https://pypi.org/project/openvino
* - :doc:`Libraries for Local Distribution <deployment-locally/local-distribution-libraries>`

View File

@ -1,5 +1,3 @@
.. {#openvino_docs_OV_Converter_UG_prepare_model_convert_model_Convert_Model_From_PyTorch}
Converting a PyTorch Model
==========================
@ -30,11 +28,19 @@ Here is the simplest example of PyTorch model conversion using a model from ``to
* ``torch.jit.ScriptFunction``
* ``torch.export.ExportedProgram``
When using ``torch.nn.Module`` as an input model, ``openvino.convert_model`` often requires the ``example_input`` parameter to be specified. Internally, it triggers the model tracing during the model conversion process, using the capabilities of the ``torch.jit.trace`` function.
When using ``torch.nn.Module`` as an input model, ``openvino.convert_model`` often requires the
``example_input`` parameter to be specified. Internally, it triggers the model tracing during
the model conversion process, using the capabilities of the ``torch.jit.trace`` function.
The use of ``example_input`` can lead to a better quality OpenVINO model in terms of correctness and performance compared to converting the same original model without specifying ``example_input``. While the necessity of ``example_input`` depends on the implementation details of a specific PyTorch model, it is recommended to always set the ``example_input`` parameter when it is available.
The use of ``example_input`` can lead to a better quality OpenVINO model in terms of correctness
and performance compared to converting the same original model without specifying
``example_input``. While the necessity of ``example_input`` depends on the implementation
details of a specific PyTorch model, it is recommended to always set the ``example_input``
parameter when it is available.
The value for the ``example_input`` parameter can be easily derived from knowing the input tensor's element type and shape. While it may not be suitable for all cases, random numbers can frequently serve this purpose effectively:
The value for the ``example_input`` parameter can be easily derived from knowing the input
tensor's element type and shape. While it may not be suitable for all cases, random numbers can
frequently serve this purpose effectively:
.. code-block:: py
:force:
@ -46,7 +52,11 @@ The value for the ``example_input`` parameter can be easily derived from knowing
model = torchvision.models.resnet50(weights='DEFAULT')
ov_model = ov.convert_model(model, example_input=torch.rand(1, 3, 224, 224))
In practice, the code to evaluate or test the PyTorch model is usually provided with the model itself and can be used to generate a proper ``example_input`` value. A modified example of using ``resnet50`` model from ``torchvision`` is presented below. It demonstrates how to switch inference in the existing PyTorch application to OpenVINO and how to get value for ``example_input``:
In practice, the code to evaluate or test the PyTorch model is usually provided with the model
itself and can be used to generate a proper ``example_input`` value. A modified example of using
``resnet50`` model from ``torchvision`` is presented below. It demonstrates how to switch
inference in the existing PyTorch application to OpenVINO and how to get value for
``example_input``:
.. code-block:: py
:force:
@ -89,7 +99,9 @@ Check out more examples in :doc:`interactive Python tutorials <../../learn-openv
.. note::
In the examples above the ``openvino.save_model`` function is not used because there are no PyTorch-specific details regarding the usage of this function. In all examples, the converted OpenVINO model can be saved to IR by calling ``ov.save_model(ov_model, 'model.xml')`` as usual.
In the examples above the ``openvino.save_model`` function is not used because there are no
PyTorch-specific details regarding the usage of this function. In all examples, the converted
OpenVINO model can be saved to IR by calling ``ov.save_model(ov_model, 'model.xml')`` as usual.
Supported Input Parameter Types
###############################
@ -100,44 +112,75 @@ If the model has a single input, the following input types are supported in ``ex
* ``torch.Tensor``
* ``tuple`` or any nested combination of tuples
If a model has multiple inputs, the input values are combined in a ``list``, a ``tuple``, or a ``dict``:
If a model has multiple inputs, the input values are combined in a ``list``, a ``tuple``, or a
``dict``:
* values in a ``list`` or ``tuple`` should be passed in the same order as the original model specifies,
* values in a ``list`` or ``tuple`` should be passed in the same order as the original model
specifies,
* ``dict`` has keys from the names of the original model argument names.
Enclosing in ``list``, ``tuple`` or ``dict`` can be used for a single input as well as for multiple inputs.
Enclosing in ``list``, ``tuple`` or ``dict`` can be used for a single input as well as for
multiple inputs.
If a model has a single input parameter and the type of this input is a ``tuple``, it should be always passed enclosed into an extra ``list``, ``tuple`` or ``dict`` as in the case of multiple inputs. It is required to eliminate ambiguity between ``model((a, b))`` and ``model(a, b)`` in this case.
If a model has a single input parameter and the type of this input is a ``tuple``, it should be
always passed enclosed into an extra ``list``, ``tuple`` or ``dict`` as in the case of multiple
inputs. It is required to eliminate ambiguity between ``model((a, b))`` and ``model(a, b)`` in
this case.
Non-tensor Data Types
#####################
When a non-tensor data type, such as a ``tuple`` or ``dict``, appears in a model input or output, it is flattened. The flattening means that each element within the ``tuple`` will be represented as a separate input or output. The same is true for ``dict`` values, where the keys of the ``dict`` are used to form a model input/output name. The original non-tensor input or output is replaced by one or multiple new inputs or outputs resulting from this flattening process. This flattening procedure is applied recursively in the case of nested ``tuples``, ``lists``, and ``dicts`` until it reaches the assumption that the most nested data type is a tensor.
When a non-tensor data type, such as a ``tuple`` or ``dict``, appears in a model input or output,
it is flattened. The flattening means that each element within the ``tuple`` will be represented
as a separate input or output. The same is true for ``dict`` values, where the keys of the
``dict`` are used to form a model input/output name. The original non-tensor input or output is
replaced by one or multiple new inputs or outputs resulting from this flattening process. This
flattening procedure is applied recursively in the case of nested ``tuples``, ``lists``, and
``dicts`` until it reaches the assumption that the most nested data type is a tensor.
For example, if the original model is called with ``example_input=(a, (b, c, (d, e)))``, where ``a``, ``b``, ... ``e`` are tensors, it means that the original model has two inputs. The first is a tensor ``a``, and the second is a tuple ``(b, c, (d, e))``, containing two tensors ``b`` and ``c`` and a nested tuple ``(d, e)``. Then the resulting OpenVINO model will have signature ``(a, b, c, d, e)``, which means it will have five inputs, all of type tensor, instead of two in the original model.
For example, if the original model is called with ``example_input=(a, (b, c, (d, e)))``, where
``a``, ``b``, ... ``e`` are tensors, it means that the original model has two inputs. The first
is a tensor ``a``, and the second is a tuple ``(b, c, (d, e))``, containing two tensors ``b``
and ``c`` and a nested tuple ``(d, e)``. Then the resulting OpenVINO model will have signature
``(a, b, c, d, e)``, which means it will have five inputs, all of type tensor, instead of two in
the original model.
If your model has a ``dict`` input, such as, ``{"x": a, "y": b, "z": c}``, it will be decomposed into multiple inputs of the OpenVINO model signature: ``(a, b, c)``, where inputs assume the names of ``x``, ``y``, and ``z`` respectively.
If your model has a ``dict`` input, such as, ``{"x": a, "y": b, "z": c}``, it will be decomposed
into multiple inputs of the OpenVINO model signature: ``(a, b, c)``, where inputs assume the
names of ``x``, ``y``, and ``z`` respectively.
.. note::
An important consequence of flattening is that only ``tuple`` and ``dict`` with a fixed number of elements and key values are supported. The structure of such inputs should be fully described in the ``example_input`` parameter of ``convert_model``. The flattening on outputs should be reproduced with the given ``example_input`` and cannot be changed once the conversion is done.
An important consequence of flattening is that only ``tuple`` and ``dict`` with a fixed number
of elements and key values are supported. The structure of such inputs should be fully
described in the ``example_input`` parameter of ``convert_model``. The flattening on outputs
should be reproduced with the given ``example_input`` and cannot be changed once the
conversion is done.
Check out more examples of model conversion with non-tensor data types in the following tutorials:
* `Video Subtitle Generation using Whisper and OpenVINO™ <https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/whisper-subtitles-generation>`__
* `Visual Question Answering and Image Captioning using BLIP and OpenVINO <https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/blip-visual-language-processing>`__
* `Video Subtitle Generation using Whisper and OpenVINO™
<https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/whisper-subtitles-generation>`__
* `Visual Question Answering and Image Captioning using BLIP and OpenVINO
<https://github.com/openvinotoolkit/openvino_notebooks/tree/latest/notebooks/blip-visual-language-processing>`__
Input and output names of the model
###################################
PyTorch doesn't produce relevant names for model inputs and outputs in the TorchScript representation. OpenVINO will assign input names based on the signature of models's ``forward`` method or ``dict`` keys provided in the ``example_input``. Output names will be assigned if there is a ``dict`` at the output or when there is some internal name available in the TorchScript model representation. In general, the output name is not assigned and stays empty. It is recommended to address model outputs by the index rather then the name.
PyTorch doesn't produce relevant names for model inputs and outputs in the TorchScript
representation. OpenVINO will assign input names based on the signature of models's ``forward``
method or ``dict`` keys provided in the ``example_input``. Output names will be assigned if
there is a ``dict`` at the output or when there is some internal name available in the
TorchScript model representation. In general, the output name is not assigned and stays empty.
It is recommended to address model outputs by the index rather then the name.
Support for torch.export
########################
`torch.export <https://pytorch.org/docs/2.2/export.html>` is the current way to get a graph representation of a model (since PyTorch 2.1). It produces ``ExportedProgram`` which includes the graph representation in the FX format. Refer to
`PyTorch documentation <https://pytorch.org/docs/stable/fx.html>`__
to see why it has advantage over the TorchScript representation.
`torch.export <https://pytorch.org/docs/2.2/export.html>`__ is the current way to get a graph
representation of a model (since PyTorch 2.1). It produces ``ExportedProgram`` which includes
the graph representation in the FX format. To see why it has an advantage over the TorchScript
representation, refer to `PyTorch documentation <https://pytorch.org/docs/stable/fx.html>`__.
Here is an example of how to convert a model obtained with ``torch.export``:
@ -155,14 +198,20 @@ Here is an example of how to convert a model obtained with ``torch.export``:
.. note::
This is an experimental feature. Use it only if you know that you need to. PyTorch version 2.2 is recommended. Dynamic shapes are not supported yet.
This is an experimental feature. Use it only if you know that you need to. PyTorch version 2.2
is recommended. Dynamic shapes are not supported yet.
Exporting a PyTorch Model to ONNX Format
########################################
An alternative method of converting PyTorch models is exporting a PyTorch model to ONNX with ``torch.onnx.export`` first and then converting the resulting ``.onnx`` file to OpenVINO Model with ``openvino.convert_model``. It can be considered as a backup solution if a model cannot be converted directly from PyTorch to OpenVINO as described in the above chapters. Converting through ONNX can be more expensive in terms of code, conversion time, and allocated memory.
An alternative method of converting PyTorch models is exporting a PyTorch model to ONNX with
``torch.onnx.export`` first and then converting the resulting ``.onnx`` file to OpenVINO Model
with ``openvino.convert_model``. It can be considered as a backup solution if a model cannot be
converted directly from PyTorch to OpenVINO as described in the above chapters. Converting through
ONNX can be more expensive in terms of code, conversion time, and allocated memory.
1. Refer to the `Exporting PyTorch models to ONNX format <https://pytorch.org/docs/stable/onnx.html>`__ guide to learn how to export models from PyTorch to ONNX.
1. Refer to the `Exporting PyTorch models to ONNX format <https://pytorch.org/docs/stable/onnx.html>`__
guide to learn how to export models from PyTorch to ONNX.
2. Follow :doc:`Convert an ONNX model <convert-model-onnx>` chapter to produce OpenVINO model.
Here is an illustration of using these two steps together:
@ -182,6 +231,9 @@ Here is an illustration of using these two steps together:
.. note::
As of version 1.8.1, not all PyTorch operations can be exported to ONNX opset 9 which is used by default.
It is recommended to export models to opset 11 or higher when export to default opset 9 is not working. In that case, use ``opset_version`` option of the ``torch.onnx.export``. For more information about ONNX opset, refer to the `Operator Schemas <https://github.com/onnx/onnx/blob/master/docs/Operators.md>`__ page.
As of version 1.8.1, not all PyTorch operations can be exported to ONNX opset 9 which is
used by default. It is recommended to export models to opset 11 or higher when export to
default opset 9 is not working. In that case, use ``opset_version`` option of the
``torch.onnx.export``. For more information about ONNX opset, refer to the
`Operator Schemas <https://github.com/onnx/onnx/blob/master/docs/Operators.md>`__ page.

View File

@ -238,7 +238,7 @@ property is set for CPU plugin, then multiple streams are created for the model.
host thread, which means that incoming infer requests can be processed simultaneously. Each stream is pinned to its own group of
physical cores with respect to NUMA nodes physical memory usage to minimize overhead on data transfer between NUMA nodes.
For more details, see the :doc:`optimization guide <../optimize-inference>`.
For more details, see the :doc:`optimization guide <../optimize-inference>` and :doc:`threads scheduling introduction <cpu-device/performance-hint-and-threads-scheduling>`.
.. note::
@ -246,6 +246,11 @@ For more details, see the :doc:`optimization guide <../optimize-inference>`.
on data transfer between NUMA nodes. In that case it is better to use the ``ov::hint::PerformanceMode::LATENCY`` performance hint.
For more details see the :doc:`performance hints <../optimize-inference/high-level-performance-hints>` overview.
.. toctree::
:maxdepth: 1
:hidden:
cpu-device/performance-hint-and-threads-scheduling
Dynamic Shapes
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@ -387,70 +392,8 @@ Multi-Threading Optimization
CPU inference will infer an input or multiple inputs in parallel on multiple logical processors.
User can use the following properties to limit available CPU resource for model inference. If the platform or operating system can support this behavior, OpenVINO Runtime will perform multi-threading scheduling based on limited available CPU.
For more details, see the :doc:`threads scheduling introduction <cpu-device/performance-hint-and-threads-scheduling>`.
- ``ov::inference_num_threads`` limits number of logical processors used for CPU inference.
If the number set by the user is greater than the number of logical processors on the platform, multi-threading scheduler only uses the platform number for CPU inference.
- ``ov::hint::scheduling_core_type`` limits the type of CPU cores for CPU inference when user runs inference on a hybird platform that includes both Performance-cores (P-cores) with Efficient-cores (E-cores).
If user platform only has one type of CPU cores, this property has no effect, and CPU inference always uses this unique core type.
- ``ov::hint::enable_hyper_threading`` limits the use of one or two logical processors per CPU core when platform has CPU hyperthreading enabled.
If there is only one logical processor per CPU core, such as Efficient-cores, this property has no effect, and CPU inference uses all logical processors.
.. tab-set::
.. tab-item:: Python
:sync: py
.. doxygensnippet:: docs/articles_en/assets/snippets/multi_threading.py
:language: python
:fragment: [ov:intel_cpu:multi_threading:part0]
.. tab-item:: C++
:sync: cpp
.. doxygensnippet:: docs/articles_en/assets/snippets/multi_threading.cpp
:language: cpp
:fragment: [ov:intel_cpu:multi_threading:part0]
.. note::
``ov::hint::scheduling_core_type`` and ``ov::hint::enable_hyper_threading`` only support Intel® x86-64 CPU on Linux and Windows in current release.
In some use cases, OpenVINO Runtime will enable CPU threads pinning by default for better performance. User can also turn it on or off using property ``ov::hint::enable_cpu_pinning``. Disable threads pinning might be beneficial in complex applications with several workloads executed in parallel. The following table describes the default setting for ``ov::hint::enable_cpu_pinning`` in different use cases.
==================================================== ================================
Use Case Default Setting of CPU Pinning
==================================================== ================================
All use cases with Windows OS False
Stream contains both Pcore and Ecore with Linux OS False
Stream only contains Pcore or Ecore with Linux OS True
All use cases with Mac OS False
==================================================== ================================
.. tab-set::
.. tab-item:: Python
:sync: py
.. doxygensnippet:: docs/articles_en/assets/snippets/multi_threading.py
:language: python
:fragment: [ov:intel_cpu:multi_threading:part1]
.. tab-item:: C++
:sync: cpp
.. doxygensnippet:: docs/articles_en/assets/snippets/multi_threading.cpp
:language: cpp
:fragment: [ov:intel_cpu:multi_threading:part1]
For details on multi-stream execution check the
:doc:`optimization guide <../optimize-inference/optimizing-throughput/advanced_throughput_options>`.
.. note::
``ov::hint::enable_cpu_pinning`` is not supported on multi-socket platforms with Windows OS.
Denormals Optimization
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

View File

@ -0,0 +1,162 @@
.. {#openvino_docs_OV_UG_supported_plugins_CPU_Hints_Threading}
Performance Hints and Threads Scheduling
========================================
.. meta::
:description: The Threads Scheduling of CPU plugin in OpenVINO™ Runtime
detects CPU architecture and sets low-level properties based
on performance hints automatically.
While all supported devices in OpenVINO offer low-level performance settings, it is advisable not to widely use these settings unless targeting specific platforms and models. The recommended approach is configuring performance in OpenVINO Runtime using high-level performance hints property ``ov::hint::performance_mode``. Performance hints ensure optimal portability and scalability of the applications across various platforms and models.
To simplify the configuration of hardware devices, OpenVINO offers two performance hints: the latency hint ``ov::hint::PerformanceMode::LATENCY`` and the throughput hint ``ov::hint::PerformanceMode::THROUGHPUT``.
- ``ov::inference_num_threads`` limits number of logical processors used for CPU inference.
If the number set by the user is greater than the number of logical processors on the platform, multi-threading scheduler only uses the platform number for CPU inference.
- ``ov::num_streams`` limits number of infer requests that can be run in parallel.
If the number set by the user is greater than the number of inference threads, multi-threading scheduler only uses the number of inference threads to ensure that there is at least one thread per stream.
- ``ov::hint::scheduling_core_type`` limits the type of CPU cores for CPU inference when user runs inference on a hybird platform that includes both Performance-cores (P-cores) with Efficient-cores (E-cores).
If user platform only has one type of CPU cores, this property has no effect, and CPU inference always uses this unique core type.
- ``ov::hint::enable_hyper_threading`` limits the use of one or two logical processors per CPU core when platform has CPU hyperthreading enabled.
If there is only one logical processor per CPU core, such as Efficient-cores, this property has no effect, and CPU inference uses all logical processors.
- ``ov::hint::enable_cpu_pinning`` enable CPU pinning during CPU inference.
If user enable this property but inference scenario cannot support it, this property will be disabled during model compilation.
For additional details on the above configurations, refer to:
- `Multi-stream Execution <https://docs.openvino.ai/2024/openvino-workflow/running-inference/inference-devices-and-modes/cpu-device.html#multi-stream-execution>`__
Latency Hint
###################################
In this scenario, the default setting of ``ov::hint::scheduling_core_type`` is determined by the model precision and the ratio of P-cores and E-cores.
.. note::
P-cores is short for Performance-cores and E-cores is for Efficient-cores. These are available after 12th Gen Intel® Core™ Processor.
.. _Core Type Table of Latency Hint:
+----------------------------+---------------------+---------------------+
| | INT8 model | FP32 model |
+============================+=====================+=====================+
| E-cores / P-cores < 2 | P-cores | P-cores |
+----------------------------+---------------------+---------------------+
| 2 <= E-cores / P-cores < 4 | P-cores | P-cores and E-cores |
+----------------------------+---------------------+---------------------+
| 4 <= E-cores / P-cores | P-cores and E-cores | P-cores and E-cores |
+----------------------------+---------------------+---------------------+
.. note::
Both P-cores and E-cores may be used for any configuration starting from 14th Gen Intel® Core™ Processor on Windows.
Then the default settings of low-level performance properties on Windows and Linux are as follows:
+--------------------------------------+----------------------------------------------------------------+----------------------------------------------------------------+
| Property | Windows | Linux |
+======================================+================================================================+================================================================+
| ``ov::num_streams`` | 1 | 1 |
+--------------------------------------+----------------------------------------------------------------+----------------------------------------------------------------+
| ``ov::inference_num_threads`` | is equal to number of P-cores or P-cores+E-cores on one socket | is equal to number of P-cores or P-cores+E-cores on one socket |
+--------------------------------------+----------------------------------------------------------------+----------------------------------------------------------------+
| ``ov::hint::scheduling_core_type`` | `Core Type Table of Latency Hint`_ | `Core Type Table of Latency Hint`_ |
+--------------------------------------+----------------------------------------------------------------+----------------------------------------------------------------+
| ``ov::hint::enable_hyper_threading`` | No | No |
+--------------------------------------+----------------------------------------------------------------+----------------------------------------------------------------+
| ``ov::hint::enable_cpu_pinning`` | No / Not Supported | Yes except using P-cores and E-cores together |
+--------------------------------------+----------------------------------------------------------------+----------------------------------------------------------------+
.. note::
- ``ov::hint::scheduling_core_type`` might be adjusted for particular inferred model on particular platform based on internal heuristics to guarantee best performance.
- Both P-cores and E-cores are used for the Latency Hint on Intel® Core™ Ultra Processors on Windows, except in the case of large language models.
- In case hyper-threading is enabled, two logical processors share hardware resource of one CPU core. OpenVINO do not expect to use both logical processors in one stream for one infer request. So ``ov::hint::enable_hyper_threading`` is ``No`` in this scenario.
- ``ov::hint::enable_cpu_pinning`` is disabled by default on Windows/Mac, and enabled on Linux. Such default settings are aligned with typical workloads running in corresponding environment to guarantee better OOB performance.
Throughput Hint
######################################
In this scenario, thread scheduling first evaluates the memory pressure of the model being inferred on the current platform, and determines the number of threads per stream, as shown below.
+-----------------+-----------------------+
| Memory Pressure | Threads per stream |
+=================+=======================+
| low | 1 P-core or 2 E-cores |
+-----------------+-----------------------+
| medium | 2 |
+-----------------+-----------------------+
| high | 3 or 4 or 5 |
+-----------------+-----------------------+
Then the value of ``ov::num_streams`` is calculated as ``ov::inference_num_threads`` divided by the number of threads per stream. The default settings of low-level performance properties on Windows and Linux are as follows:
+--------------------------------------+-------------------------------+-------------------------------+
| Property | Windows | Linux |
+======================================+===============================+===============================+
| ``ov::num_streams`` | Calculate as above | Calculate as above |
+--------------------------------------+-------------------------------+-------------------------------+
| ``ov::inference_num_threads`` | Number of P-cores and E-cores | Number of P-cores and E-cores |
+--------------------------------------+-------------------------------+-------------------------------+
| ``ov::hint::scheduling_core_type`` | P-cores and E-cores | P-cores and E-cores |
+--------------------------------------+-------------------------------+-------------------------------+
| ``ov::hint::enable_hyper_threading`` | Yes / No | Yes / No |
+--------------------------------------+-------------------------------+-------------------------------+
| ``ov::hint::enable_cpu_pinning`` | No | Yes |
+--------------------------------------+-------------------------------+-------------------------------+
.. note::
- By default, different core types are not mixed within single stream in this scenario. And cores from different numa nodes are not mixed within single stream.
Multi-Threading Optimization
##############################################
User can use the following properties to limit available CPU resource for model inference. If the platform or operating system can support this behavior, OpenVINO Runtime will perform multi-threading scheduling based on limited available CPU.
- ``ov::inference_num_threads``
- ``ov::hint::scheduling_core_type``
- ``ov::hint::enable_hyper_threading``
.. tab-set::
.. tab-item:: Python
:sync: py
.. doxygensnippet:: docs/articles_en/assets/snippets/multi_threading.py
:language: python
:fragment: [ov:intel_cpu:multi_threading:part0]
.. tab-item:: C++
:sync: cpp
.. doxygensnippet:: docs/articles_en/assets/snippets/multi_threading.cpp
:language: cpp
:fragment: [ov:intel_cpu:multi_threading:part0]
.. note::
``ov::hint::scheduling_core_type`` and ``ov::hint::enable_hyper_threading`` only support Intel® x86-64 CPU on Linux and Windows in current release.
In some use cases, OpenVINO Runtime will enable CPU threads pinning by default for better performance. User can also turn it on or off using property ``ov::hint::enable_cpu_pinning``. Disable threads pinning might be beneficial in complex applications with several workloads executed in parallel.
.. tab-set::
.. tab-item:: Python
:sync: py
.. doxygensnippet:: docs/articles_en/assets/snippets/multi_threading.py
:language: python
:fragment: [ov:intel_cpu:multi_threading:part1]
.. tab-item:: C++
:sync: cpp
.. doxygensnippet:: docs/articles_en/assets/snippets/multi_threading.cpp
:language: cpp
:fragment: [ov:intel_cpu:multi_threading:part1]
For details on multi-stream execution check the
:doc:`optimization guide <../../optimize-inference/optimizing-throughput/advanced_throughput_options>`.

View File

@ -1,5 +1,3 @@
.. {#openvino_docs_OV_UG_supported_plugins_NPU}
NPU Device
==========

View File

@ -62,7 +62,7 @@ Below are example-codes for the regular and async-based approaches to compare:
The technique can be generalized to any available parallel slack. For example, you can do inference and simultaneously encode the resulting or previous frames or run further inference, like emotion detection on top of the face detection results.
Refer to the `Object Detection C++ Demo <https://docs.openvino.ai/2023.3/omz_demos_object_detection_demo_cpp.html>`__ , `Object Detection Python Demo <https://docs.openvino.ai/2023.3/omz_demos_object_detection_demo_python.html>`__ (latency-oriented Async API showcase) and :doc:`Benchmark App Sample <../../../learn-openvino/openvino-samples/benchmark-tool>` for complete examples of the Async API in action.
Refer to the `Object Detection C++ Demo <https://docs.openvino.ai/2024/omz_demos_object_detection_demo_cpp.html>`__ , `Object Detection Python Demo <https://docs.openvino.ai/2024/omz_demos_object_detection_demo_python.html>`__ (latency-oriented Async API showcase) and :doc:`Benchmark App Sample <../../../learn-openvino/openvino-samples/benchmark-tool>` for complete examples of the Async API in action.
.. note::

View File

@ -7,7 +7,7 @@ The software was validated on:
> **NOTE**: To build on CentOS 7 (64-bit), refer to [Building OpenVINO on CentOS 7 Guide](https://github.com/openvinotoolkit/openvino/wiki/Building-OpenVINO-on-CentOS-7-Guide)
## Software requirements
## Software requirements
- [CMake](https://cmake.org/download/) 3.13 or higher
- GCC 7.5 or higher to build OpenVINO Runtime
@ -37,9 +37,6 @@ The software was validated on:
2. Install build dependencies using the `install_build_dependencies.sh` script in the
project root folder.
```sh
chmod +x install_build_dependencies.sh
```
```sh
sudo ./install_build_dependencies.sh
```
@ -79,7 +76,7 @@ You can use the following additional build options:
```sh
pip install -r <openvino source tree>/src/bindings/python/wheel/requirements-dev.txt
```
3. After the build process finishes, export the newly built Python libraries to the user environment variables:
3. After the build process finishes, export the newly built Python libraries to the user environment variables:
```
export PYTHONPATH=<openvino_repo>/bin/intel64/Release/python:$PYTHONPATH
export LD_LIBRARY_PATH=<openvino_repo>/bin/intel64/Release:$LD_LIBRARY_PATH

View File

@ -36,6 +36,21 @@ git clone --recurse-submodules --single-branch --branch=master https://github.co
.. && cmake --build . --parallel
```
> **NOTE**: The build command may fail due to insufficient RAM. To fix this issue, you can increase the swap size:
1. Deactivate the current swap:
```bash
sudo dphys-swapfile swapoff
```
2. Modify the swap size by setting `CONF_SWAPSIZE=8192` in `/etc/dphys-swapfile`.
3. Recreate the swap file:
```bash
sudo dphys-swapfile setup
```
3. Start swap:
```bash
sudo dphys-swapfile swapon
```
## Additional Build Options
- To build Python API, install `libpython3-dev:armhf` and `python3-pip`

View File

@ -274,7 +274,7 @@ You can run jobs in Docker containers.
Refer to [the documentation for syntax overview](https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container).
Workflows utilize appropriate Docker images based on their jobs' needs. Learn more about the
available images and how to choose one in the [hOpenVINO Docker Image Overview](./docker_images.md).
available images and how to choose one in the [OpenVINO Docker Image Overview](./docker_images.md).
## Caches

View File

@ -38,7 +38,14 @@ OpenVINO repositories make use of the following runners:
## Available Self-hosted Runners
The self-hosted runners are dynamically spawned for each requested pipeline.
Two groups of self-hosted runners are available:
* Dynamically-spawned Linux and Windows runners with CPU-only capabilities
* Dedicated Linux runners with GPU capabilities
### Dynamically-spawned Linux and Windows Runners
These self-hosted runners are dynamically spawned for each requested pipeline.
Several configurations are available, which are identified by different group names.
The group names generally follow the pattern:
`aks-{OS}-{CORES_N}-cores-|{RAM_SIZE}gb|-|{ARCH}|`, where:
@ -65,6 +72,50 @@ The available configurations are:
* `*` - Not specified in the group name
### Dedicated GPU Runners
Eighteen runners with GPU capabilities (both integrated and discrete, iGPU and dGPU)
are available to all repositories in the OpenVINO organisation's GitHub Actions.
These runners are virtual machines with Ubuntu 22.04 and have the following specifications:
* CPU: i9-12900k
* All of them have iGPU (UHD 770 Graphics)
* Twelve of them have iGPU (UHD 770 Graphics) and dGPU (Arc A770)
These runners may be selected using labels provided in the `runs-on` field in a job configuration.
The available labels are:
* `gpu` - encapsulates all the 18 runners
* `igpu` - encapsulates all the 18 runners as all of them have iGPU
* `dgpu` - encapsulates 12 runners that have dGPU
Here is an example, a `GPU Tests` job that uses the `gpu` label and runs on any available GPU runner:
```yaml
GPU:
name: GPU Tests
needs: [ Build, Smart_CI ]
runs-on: [ self-hosted, gpu ]
container:
image: ubuntu:20.04
options: --device /dev/dri:/dev/dri --group-add 109 --group-add 44
volumes:
- /dev/dri:/dev/dri
...
```
If, for example, a job requires a dGPU, it should use the `dgpu` label, instead:
```yaml
GPU:
name: GPU Tests
needs: [ Build, Smart_CI ]
runs-on: [ self-hosted, dgpu ]
...
```
**NOTE**: as these are persistent runners, Docker should be used for the jobs that utilise the GPU runners.
Learn more about the
available images and how to choose one in the [OpenVINO Docker Image Overview](./docker_images.md).
## How to Choose a Runner
The configuration of a runner required for a job (building, testing, other tasks) depends on the

View File

@ -2,7 +2,7 @@
OpenVINO components provides different debug capabilities, to get more information please read:
* [OpenVINO Model Debug Capabilities](https://docs.openvino.ai/2024/openvino_docs_OV_UG_Model_Representation.html#model-debugging-capabilities)
* [OpenVINO Model Debug Capabilities](https://docs.openvino.ai/2024/openvino-workflow/running-inference/integrate-openvino-with-your-application/model-representation.html#model-debugging-capabilities)
* [OpenVINO Pass Manager Debug Capabilities](#todo)
## See also

View File

@ -119,10 +119,10 @@ For example, to install and configure the components for working with TensorFlow
**In addition, the openvino-dev package installs the following components by default:**
| Component | Console Script | Description |
| Component | Console Script | Description |
|------------------|---------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Legacy Model conversion API](https://docs.openvino.ai/nightly/openvino_docs_MO_DG_Deep_Learning_Model_Optimizer_DevGuide.html) | `mo` |**Model conversion API** imports, converts, and optimizes models that were trained in popular frameworks to a format usable by OpenVINO components. <br>Supported frameworks include Caffe\*, TensorFlow\*, MXNet\*, PaddlePaddle\*, and ONNX\*. | |
| [Model Downloader and other Open Model Zoo tools](https://docs.openvino.ai/nightly/omz_tools_downloader.html)| `omz_downloader` <br> `omz_converter` <br> `omz_quantizer` <br> `omz_info_dumper`| **Model Downloader** is a tool for getting access to the collection of high-quality and extremely fast pre-trained deep learning [public](@ref omz_models_group_public) and [Intel](@ref omz_models_group_intel)-trained models. These free pre-trained models can be used to speed up the development and production deployment process without training your own models. The tool downloads model files from online sources and, if necessary, patches them to make them more usable with model conversion API. A number of additional tools are also provided to automate the process of working with downloaded models:<br> **Model Converter** is a tool for converting Open Model Zoo models that are stored in an original deep learning framework format into the OpenVINO Intermediate Representation (IR) using model conversion API. <br> **Model Quantizer** is a tool for automatic quantization of full-precision models in the IR format into low-precision versions using the Post-Training Optimization Tool. <br> **Model Information Dumper** is a helper utility for dumping information about the models to a stable, machine-readable format. |
| [Legacy Model conversion API](https://docs.openvino.ai/2024/documentation/legacy-features/transition-legacy-conversion-api/legacy-conversion-api.html) | `mo` |**Model conversion API** imports, converts, and optimizes models that were trained in popular frameworks to a format usable by OpenVINO components. <br>Supported frameworks include Caffe\*, TensorFlow\*, MXNet\*, PaddlePaddle\*, and ONNX\*. | |
| [Model Downloader and other Open Model Zoo tools](https://docs.openvino.ai/2024/omz_tools_downloader.html)| `omz_downloader` <br> `omz_converter` <br> `omz_quantizer` <br> `omz_info_dumper`| **Model Downloader** is a tool for getting access to the collection of high-quality and extremely fast pre-trained deep learning [public](@ref omz_models_group_public) and [Intel](@ref omz_models_group_intel)-trained models. These free pre-trained models can be used to speed up the development and production deployment process without training your own models. The tool downloads model files from online sources and, if necessary, patches them to make them more usable with model conversion API. A number of additional tools are also provided to automate the process of working with downloaded models:<br> **Model Converter** is a tool for converting Open Model Zoo models that are stored in an original deep learning framework format into the OpenVINO Intermediate Representation (IR) using model conversion API. <br> **Model Quantizer** is a tool for automatic quantization of full-precision models in the IR format into low-precision versions using the Post-Training Optimization Tool. <br> **Model Information Dumper** is a helper utility for dumping information about the models to a stable, machine-readable format. |
## Troubleshooting

View File

@ -1,5 +1,5 @@
============================
OpenVINO 2024.1
OpenVINO 2024.2
============================
.. meta::

View File

@ -423,11 +423,28 @@ div.highlight {
.hidden-banner {
display: none!important;
}
/* Header */
.bd-header label.primary-toggle {
color: white;
}
.bd-header label.secondary-toggle {
visibility: hidden;
}
/* Responsiveness */
/* =================================================== */
@media (max-width: 720px) {
.container,
.container-lg,
.container-md,
.container-sm,
.container-xl {
max-width: 1850px;
}
.transition-banner {
margin-top: 2rem;
}
@ -439,7 +456,7 @@ div.highlight {
.container-md,
.container-sm,
.container-xl {
max-width: 1800px;
max-width: 1900px;
}
}

View File

@ -0,0 +1,132 @@
<style>
body {
margin: 0;
}
.container {
padding-right: 30px;
padding-left: 30px;
margin-right: auto;
margin-left: auto;
background-color: rgb(240, 240, 240);
}
.footer-link-list a {
float: left;
margin-right: 30px;
text-decoration: none;
background-color: transparent;
}
.footer-link-list a:nth-child(1) {
margin-right: 50px;
}
.footer-link-list a:nth-child(2) {
clear: both;
}
.footer-contents {
border-top: 1px solid lightgray;
font-size: 14px;
box-sizing: border-box;
font-family: sans-serif;
padding-top: 10px;
margin-top: 0;
margin-bottom: 0;
line-height: 1.65;
margin-left: 0px;
margin-right: 0px;
}
.footer-contents p {
margin-top: 0;
margin-bottom: 0;
line-height: 1.65;
}
.footer-contents .footer-link-list a {
color: #0054AE;
}
.newsletter-btn,
.newsletter-btn:active {
background-color: #0054AE;
border: 1px solid #0054AE;
border-radius: none;
color: white;
margin-top: 5px;
cursor: pointer;
display: inline-block;
font-weight: 400;
font-size: .8rem;
line-height: 2.0;
padding: .2rem .5rem;
text-align: center;
text-decoration: none;
transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
vertical-align: middle;
align-self: flex-start;
}
ul {
margin-bottom: 0px;
}
.no-bullets {
list-style-type: none;
}
.newsletter-btn:hover {
background-color: rgb(240, 240, 240);
color: hsl(211, 100%, 34%);
}
.footer-list {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.footer-link-list {
display: flex;
flex-direction: row;
}
/* cookie wap requirement */
li#wap_dns {
display: none;
}
.reference:hover {
text-decoration: underline;
}
</style>
<div class="container footer-contents">
<div class="footer-item">
<div class="footer-list">
<div class="footer-link-list">
<a href="https://www.intel.com/content/www/us/en/homepage.html" alt="Intel" style="color: #000;"
target="" _blank>©2024 Intel Corporation</a>
<ul class="no-bullets">
<li ><a class="reference" href="https://www.intel.com/content/www/us/en/legal/terms-of-use.html" alt="terms of use" target="_blank">Terms of Use</a></li>
<li><a class="reference" href="https://www.intel.com/content/www/us/en/privacy/intel-cookie-notice.html" alt="cookies policy" target="_blank" data-cookie-notice="true" >Cookies</a></li>
<li><a class="reference" href="https://www.intel.com/content/www/us/en/privacy/intel-privacy-notice.html" alt="privacy" target="_blank">Privacy</a></li>
</ul>
<ul class="no-bullets">
<li><a class="reference" href="https://www.intel.com/content/www/us/en/privacy/intel-privacy-notice.html" alt="legal and responsible ai information" target="_blank">Legal and Responsible AI Information</a></li>
<li><a class="reference" href="https://www.intel.com/content/www/us/en/artificial-intelligence/responsible-ai.html" alt="responsible ai" target="_blank">Responsible AI</a></li>
<li data-wap_ref="dns" id="wap_dns"><a class="reference" href="https://www.intel.com/content/www/us/en/privacy/intel-cookienotice.html" alt="terms of use" target="_parent">Do Not Share My Personal Information</a></li>
</ul>
</div>
<a id="newsletterTrigger" class="newsletter-btn" href="#" alt="Newsletter"
onclick="return false;">Newsletter</a>
</div>
<p style="font-size: 0.9em">Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or
its subsidiaries. Other names and brands may be claimed as the property of others.</p>
</div>
</div>

View File

@ -57,7 +57,7 @@ Check out the `OpenVINO Cheat Sheet. <https://docs.openvino.ai/2024/_static/down
|
|
.. image:: ./_static/images/openvino-overview-diagram.jpg
.. image:: ./assets/images/openvino-overview-diagram.jpg
:align: center
:alt: openvino diagram
@ -70,7 +70,7 @@ Places to Begin
:class-container: ov-homepage-higlight-grid
.. grid-item-card:: Installation
:img-top: ./_static/images/home_begin_tile_01.png
:img-top: ./assets/images/home_begin_tile_01.png
:class-card: homepage_begin_tile
:shadow: none
@ -83,7 +83,7 @@ Places to Begin
Get Started
.. grid-item-card:: Performance Benchmarks
:img-top: ./_static/images/home_begin_tile_02.png
:img-top: ./assets/images/home_begin_tile_02.png
:class-card: homepage_begin_tile
:shadow: none
@ -96,7 +96,7 @@ Places to Begin
View data
.. grid-item-card:: Framework Compatibility
:img-top: ./_static/images/home_begin_tile_03.png
:img-top: ./assets/images/home_begin_tile_03.png
:class-card: homepage_begin_tile
:shadow: none
@ -109,7 +109,7 @@ Places to Begin
Load your model
.. grid-item-card:: Easy Deployment
:img-top: ./_static/images/home_begin_tile_04.png
:img-top: ./assets/images/home_begin_tile_04.png
:class-card: homepage_begin_tile
:shadow: none
@ -122,7 +122,7 @@ Places to Begin
Run Inference
.. grid-item-card:: Serving at scale
:img-top: ./_static/images/home_begin_tile_05.png
:img-top: ./assets/images/home_begin_tile_05.png
:class-card: homepage_begin_tile
:shadow: none
@ -135,7 +135,7 @@ Places to Begin
Try it out
.. grid-item-card:: Model Compression
:img-top: ./_static/images/home_begin_tile_06.png
:img-top: ./assets/images/home_begin_tile_06.png
:class-card: homepage_begin_tile
:shadow: none
@ -157,28 +157,28 @@ Key Features
:class-container: homepage_begin_container
.. grid-item-card:: Model Compression
:img-top: ./_static/images/home_key_feature_01.png
:img-top: ./assets/images/home_key_feature_01.png
:class-card: homepage_begin_key
:shadow: none
You can either link directly with OpenVINO Runtime to run inference locally or use OpenVINO Model Server to serve model inference from a separate server or within Kubernetes environment.
.. grid-item-card:: Fast & Scalable Deployment
:img-top: ./_static/images/home_key_feature_02.png
:img-top: ./assets/images/home_key_feature_02.png
:class-card: homepage_begin_key
:shadow: none
Write an application once, deploy it anywhere, achieving maximum performance from hardware. Automatic device discovery allows for superior deployment flexibility. OpenVINO Runtime supports Linux, Windows and MacOS and provides Python, C++ and C API. Use your preferred language and OS.
.. grid-item-card:: Lighter Deployment
:img-top: ./_static/images/home_key_feature_03.png
:img-top: ./assets/images/home_key_feature_03.png
:class-card: homepage_begin_key
:shadow: none
Designed with minimal external dependencies reduces the application footprint, simplifying installation and dependency management. Popular package managers enable application dependencies to be easily installed and upgraded. Custom compilation for your specific model(s) further reduces final binary size.
.. grid-item-card:: Enhanced App Start-Up Time
:img-top: ./_static/images/home_key_feature_04.png
:img-top: ./assets/images/home_key_feature_04.png
:class-card: homepage_begin_key
:shadow: none

View File

@ -8,14 +8,12 @@ For more detailed information on how this sample works, check the dedicated [art
| Options | Values |
| -------------------------------| -------------------------------------------------------------------------------------------------------------------------|
| Validated Models | [alexnet](https://docs.openvino.ai/nightly/omz_models_model_alexnet.html), |
| | [googlenet-v1](https://docs.openvino.ai/nightly/omz_models_model_googlenet_v1.html), |
| | [yolo-v3-tf](https://docs.openvino.ai/nightly/omz_models_model_yolo_v3_tf.html), |
| | [face-detection-0200](https://docs.openvino.ai/nightly/omz_models_model_face_detection_0200.html) |
| Validated Models | [yolo-v3-tf](https://docs.openvino.ai/2024/omz_models_model_yolo_v3_tf.html), |
| | [face-detection-0200](https://docs.openvino.ai/2024/omz_models_model_face_detection_0200.html) |
| Model Format | OpenVINO™ toolkit Intermediate Representation |
| | (\*.xml + \*.bin), ONNX (\*.onnx) |
| Supported devices | [All](https://docs.openvino.ai/2024/about-openvino/compatibility-and-support/supported-devices.html) |
| Other language realization | [Python](https://docs.openvino.ai/2024/learn-openvino/openvino-samples/sync-benchmark.html) |
| Supported devices | [All](https://docs.openvino.ai/2024/about-openvino/compatibility-and-support/supported-devices.html) |
| Other language realization | [Python](https://docs.openvino.ai/2024/learn-openvino/openvino-samples/sync-benchmark.html) |
The following C++ API is used in the application:

View File

@ -10,14 +10,12 @@ For more detailed information on how this sample works, check the dedicated [art
| Options | Values |
| ----------------------------| -------------------------------------------------------------------------------------------------------------------------------|
| Validated Models | [alexnet](https://docs.openvino.ai/nightly/omz_models_model_alexnet.html), |
| | [googlenet-v1](https://docs.openvino.ai/nightly/omz_models_model_googlenet_v1.html), |
| | [yolo-v3-tf](https://docs.openvino.ai/nightly/omz_models_model_yolo_v3_tf.html), |
| | [face-detection-](https://docs.openvino.ai/nightly/omz_models_model_face_detection_0200.html) |
| Validated Models | [yolo-v3-tf](https://docs.openvino.ai/2024/omz_models_model_yolo_v3_tf.html), |
| | [face-detection-](https://docs.openvino.ai/2024/omz_models_model_face_detection_0200.html) |
| Model Format | OpenVINO™ toolkit Intermediate Representation |
| | (\*.xml + \*.bin), ONNX (\*.onnx) |
| Supported devices | [All](https://docs.openvino.ai/2024/about-openvino/compatibility-and-support/supported-devices.html) |
| Other language realization | [Python](https://docs.openvino.ai/2024/learn-openvino/openvino-samples/throughput-benchmark.html) |
| Supported devices | [All](https://docs.openvino.ai/2024/about-openvino/compatibility-and-support/supported-devices.html) |
| Other language realization | [Python](https://docs.openvino.ai/2024/learn-openvino/openvino-samples/throughput-benchmark.html) |
The following C++ API is used in the application:

View File

@ -9,10 +9,10 @@ For more detailed information on how this sample works, check the dedicated [art
| Options | Values |
| ----------------------------| -----------------------------------------------------------------------------------------------------------------------------------------|
| Validated Models | [person-detection-retail-0013](https://docs.openvino.ai/nightly/omz_models_model_person_detection_retail_0013.html) |
| Validated Models | [person-detection-retail-0013](https://docs.openvino.ai/2024/omz_models_model_person_detection_retail_0013.html) |
| Model Format | OpenVINO™ toolkit Intermediate Representation (\*.xml + \*.bin), ONNX (\*.onnx) |
| Supported devices | [All](https://docs.openvino.ai/2024/about-openvino/compatibility-and-support/supported-devices.html) |
| Other language realization | [Python](https://docs.openvino.ai/2024/learn-openvino/openvino-samples/hello-reshape-ssd.html) |
| Supported devices | [All](https://docs.openvino.ai/2024/about-openvino/compatibility-and-support/supported-devices.html) |
| Other language realization | [Python](https://docs.openvino.ai/2024/learn-openvino/openvino-samples/hello-reshape-ssd.html) |
The following C++ API is used in the application:

View File

@ -107,7 +107,9 @@ def test_custom_add_model():
def test_custom_op():
model = create_snake_model()
compiled_model = compile_model(model)
# todo: CVS-141744
# it hangs with AUTO plugin, but works well with CPU
compiled_model = compile_model(model, "CPU")
assert isinstance(compiled_model, CompiledModel)
request = compiled_model.create_infer_request()

View File

@ -95,6 +95,7 @@ public:
}
}
// the lowest value (example, for signed symetric types: -max)
static float getMinValue(const element::Type precision, const size_t levels) {
switch (precision) {
case element::u4:
@ -134,6 +135,8 @@ public:
break;
case element::f16:
return -1.0e15f;
case element::bf16:
return -3.38953139e38f;
case element::f32:
return std::numeric_limits<float>::lowest();
default:
@ -172,6 +175,8 @@ public:
return 2147483648.f; // 2147483648.f == 2147483647.f
case element::f16:
return 1.0e15f;
case element::bf16:
return 3.38953139e38f;
case element::f32:
return std::numeric_limits<float>::max();
default:

View File

@ -93,9 +93,13 @@ bool check_interval(const std::shared_ptr<ov::opset1::FakeQuantize>& fq,
bool check_intervals(const std::shared_ptr<ov::opset1::FakeQuantize>& fakeQuantize) {
const auto& element_type = fakeQuantize->get_output_element_type(0);
const auto levels = fakeQuantize->get_levels();
if (levels == 0) {
return false;
}
const auto min_value = DataPrecision::getMinValue(element_type, levels);
const auto max_value = DataPrecision::getMaxValue(element_type, levels);
const auto max_diff = (max_value - min_value) / levels;
// let's divide before to avoid overflow
const auto max_diff = max_value / levels - min_value / levels;
// input intervals can be not equal with type intervals for low precision only
const auto exact_comparison = !element_type.is_integral();

View File

@ -25,14 +25,12 @@ class TransformationTestValues {
public:
class Actual {
public:
ov::element::Type precisionBefore;
ov::builder::subgraph::FakeQuantizeOnData fakeQuantizeOnData1;
ov::builder::subgraph::FakeQuantizeOnData fakeQuantizeOnData2;
};
class Expected {
public:
ov::element::Type precisionBefore;
ov::builder::subgraph::FakeQuantizeOnData fakeQuantizeOnData1;
ov::builder::subgraph::FakeQuantizeOnData fakeQuantizeOnData2;
ov::builder::subgraph::DequantizationOperations dequantizationOperations2;
@ -44,17 +42,28 @@ public:
Expected expected;
};
typedef std::tuple<
ov::element::Type,
TransformationTestValues
> EliminateFakeQuantizeTransformationParams;
class EliminateFakeQuantizeTransformation : public LayerTransformation,
public testing::WithParamInterface<TransformationTestValues> {
public testing::WithParamInterface<EliminateFakeQuantizeTransformationParams> {
public:
void SetUp() override {
const TransformationTestValues testValues = GetParam();
const ov::element::Type execPrecision = std::get<0>(GetParam());
TransformationTestValues testValues = std::get<1>(GetParam());
if (!testValues.expected.dequantizationOperations2.multiply.empty()) {
testValues.expected.dequantizationOperations2.multiply.outPrecision = execPrecision;
}
actualFunction = ov::builder::subgraph::FuseFakeQuantizeFunction::get(testValues.inputShape,
testValues.actual.precisionBefore,
testValues.actual.fakeQuantizeOnData1,
testValues.actual.fakeQuantizeOnData2,
{});
execPrecision,
testValues.actual.fakeQuantizeOnData1,
testValues.actual.fakeQuantizeOnData2,
{});
SimpleLowPrecisionTransformer transformer;
transformer.add<ov::pass::low_precision::FakeQuantizeDecompositionTransformation, ov::op::v0::FakeQuantize>(
testValues.params);
@ -67,20 +76,28 @@ public:
referenceFunction =
ov::builder::subgraph::FuseFakeQuantizeFunction::get(testValues.inputShape,
testValues.expected.precisionBefore,
testValues.expected.fakeQuantizeOnData1,
testValues.expected.fakeQuantizeOnData2,
testValues.expected.dequantizationOperations2);
execPrecision,
testValues.expected.fakeQuantizeOnData1,
testValues.expected.fakeQuantizeOnData2,
testValues.expected.dequantizationOperations2);
}
static std::string getTestCaseName(testing::TestParamInfo<TransformationTestValues> obj) {
const TransformationTestValues testValues = obj.param;
static std::string getTestCaseName(testing::TestParamInfo<EliminateFakeQuantizeTransformationParams> obj) {
const ov::element::Type execPrecision = std::get<0>(obj.param);
TransformationTestValues testValues = std::get<1>(obj.param);
if (!testValues.expected.dequantizationOperations2.multiply.empty()) {
testValues.expected.dequantizationOperations2.multiply.outPrecision = execPrecision;
}
std::ostringstream result;
result << testValues.inputShape << "_" << testValues.params.updatePrecisions << "_"
<< testValues.actual.precisionBefore << "_" << testValues.actual.fakeQuantizeOnData1 << "_"
<< testValues.actual.fakeQuantizeOnData2 << "_" << testValues.expected.precisionBefore << "_"
<< testValues.expected.fakeQuantizeOnData1 << "_" << testValues.expected.fakeQuantizeOnData2 << "_"
<< execPrecision << "_"
<< testValues.actual.fakeQuantizeOnData1 << "_"
<< testValues.actual.fakeQuantizeOnData2 << "_"
<< testValues.expected.fakeQuantizeOnData1 << "_"
<< testValues.expected.fakeQuantizeOnData2 << "_"
<< testValues.expected.dequantizationOperations2;
return result.str();
}
@ -100,12 +117,10 @@ const std::vector<TransformationTestValues> testValues = {
{1, 3, 16, 16},
TestTransformationParams(true, {ov::element::u8}, {ov::element::i8}),
{
element::f32,
{256ul, {}, {0.f}, {2.55f}, {0.f}, {2.55f}},
{256ul, {}, {0.f}, {2.55f}, {0.f}, {2.55f}}
},
{
element::f32,
{256ul, {}, {0.f}, {2.55f}, {0.f}, {255.f}, element::u8},
{},
{ ov::element::f32, {}, {{0.01f}, ov::element::f32, {}} }
@ -115,12 +130,10 @@ const std::vector<TransformationTestValues> testValues = {
{1, 3, 16, 16},
TestTransformationParams(true, {ov::element::u8}, {ov::element::i8}),
{
element::f32,
{256ul, {}, {0.f}, {2.55f}, {0.f}, {2.55f}},
{256ul, {}, {0.f}, {2.549f}, {0.f}, {2.55f}}
},
{
element::f32,
{256ul, {}, {0.f}, {2.55f}, {0.f}, {255.f}, element::u8},
{},
{ ov::element::f32, {}, {{0.01f}, ov::element::f32, {}} }
@ -130,38 +143,48 @@ const std::vector<TransformationTestValues> testValues = {
{1, 3, 16, 16},
TestTransformationParams(true, {ov::element::u8}, {ov::element::i8}),
{
element::f32,
{256ul, {}, {0.f}, {2.55f}, {0.f}, {2.55f}},
{256ul, {}, {0.f}, {2.55f}, {0.f}, {2.55f / 2.f}}
},
{
element::f32,
{256ul, {}, {0.f}, {2.55f}, {0.f}, {255.f}, element::u8},
{},
{ ov::element::f32, {}, {{0.005f}, ov::element::f32, {}} }
}
},
{
{1, 3, 16, 16},
TestTransformationParams(true, {ov::element::u8}, {ov::element::i8}),
{
element::f32,
{256ul, {}, {0.f}, {2.55f}, {0.f}, {2.55f}},
{256ul, {}, {0.f}, {2.55f / 2.f}, {0.f}, {2.55f / 2.f}}
},
{
element::f32,
{256ul, {}, {0.f}, {2.55f}, {0.f}, {255.f}, element::u8},
{256ul, {}, {0.f}, {127.5f}, {0.f}, {255.f}, element::u8},
{ ov::element::f32, {}, {{0.005f}, ov::element::f32, {}} }
}
}
};
// clang-format on
INSTANTIATE_TEST_SUITE_P(smoke_LPT,
EliminateFakeQuantizeTransformation,
::testing::ValuesIn(testValues),
::testing::Combine(
::testing::ValuesIn({ov::element::f32, ov::element::bf16}),
::testing::ValuesIn(testValues)),
EliminateFakeQuantizeTransformation::getTestCaseName);
// clang-format off
const std::vector<TransformationTestValues> testValuesDiffFq = {
{
{1, 3, 16, 16},
TestTransformationParams(true, {ov::element::u8}, {ov::element::i8}),
{
{256ul, {}, {0.f}, {2.55f}, {0.f}, {2.55f}},
{256ul, {}, {0.f}, {2.55f / 2.f}, {0.f}, {2.55f / 2.f}}
},
{
{256ul, {}, {0.f}, {2.55f}, {0.f}, {255.f}, element::u8},
{256ul, {}, {0.f}, {127.5f}, {0.f}, {255.f}, element::u8},
{ ov::element::f32, {}, {{0.005f}, ov::element::f32, {}} }
}
}
};
// clang-format on
INSTANTIATE_TEST_SUITE_P(smoke_LPT_DiffFq,
EliminateFakeQuantizeTransformation,
::testing::Combine(
::testing::ValuesIn({ov::element::f32}),
::testing::ValuesIn(testValuesDiffFq)),
EliminateFakeQuantizeTransformation::getTestCaseName);
} // namespace

View File

@ -34,6 +34,12 @@ public:
*/
virtual std::shared_ptr<LoopInfo> clone_with_new_expr(const ExpressionMap& expr_map) const = 0;
/**
* @brief Check if some parameters of Loop are dynamic (undefined)
* @return True if some parameters of Loop are unknown, False if all parameters are static
*/
virtual bool is_dynamic() const;
/**
* @brief Returns count of input ports
* @return count
@ -184,6 +190,8 @@ public:
int64_t ptr_increment = 0;
int64_t finalization_offset = 0;
int64_t data_size = 0;
bool is_dynamic() const;
};
// The structure describes full information about port
// - TODO [140365] : UnifiedLoopInfo should have the map of LoopPorts and LoopDesc as class field
@ -212,6 +220,12 @@ public:
*/
std::shared_ptr<LoopInfo> clone_with_new_expr(const ExpressionMap& expr_map) const override;
/**
* @brief Check if some parameters of Loop are dynamic (undefined)
* @return True if some parameters of Loop are unknown, False if all parameters are static
*/
bool is_dynamic() const override;
/**
* @brief Returns handlers of loop specific iterations
* @return m_handlers
@ -373,6 +387,12 @@ public:
*/
std::shared_ptr<LoopInfo> clone_with_new_expr(const ExpressionMap& expr_map) const override;
/**
* @brief Check if some parameters of Loop are dynamic (undefined)
* @return True if some parameters of Loop are unknown, False if all parameters are static
*/
bool is_dynamic() const override;
/**
* @brief Returns original unified LoopInfo from which this LoopInfo was created
* @return const reference of m_unified_loop_info

View File

@ -6,6 +6,8 @@
#include "pass.hpp"
#include "snippets/utils.hpp"
namespace ov {
namespace snippets {
namespace lowered {
@ -46,6 +48,10 @@ public:
int64_t ptr_increment = 0;
int64_t finalization_offset = 0;
inline bool is_static() const {
return !utils::is_dynamic_value(ptr_increment) && !utils::is_dynamic_value(finalization_offset);
}
friend bool operator==(const ShiftPtrParams& lhs, const ShiftPtrParams& rhs);
friend bool operator!=(const ShiftPtrParams& lhs, const ShiftPtrParams& rhs);
};

View File

@ -26,7 +26,6 @@ public:
bool run(LinearIR& linear_ir, lowered::LinearIR::constExprIt begin, lowered::LinearIR::constExprIt end) override;
private:
static void insertion(LinearIR& linear_ir, const LoopManagerPtr& loop_manager, size_t loop_id);
static bool is_loop_dynamic(const UnifiedLoopInfoPtr& loop_info);
};
} // namespace pass

View File

@ -40,26 +40,13 @@ public:
LoopBegin();
void validate_and_infer_types() override;
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& inputs) const override;
std::shared_ptr<LoopEnd> get_loop_end() const;
protected:
void validate_and_infer_types_except_LoopEnd();
};
class LoopBeginStatic : public LoopBegin {
public:
OPENVINO_OP("LoopBeginStatic", "SnippetsOpset", LoopBegin);
LoopBeginStatic() = default;
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& inputs) const override;
};
class LoopBeginDynamic : public LoopBegin {
public:
OPENVINO_OP("LoopBeginDynamic", "SnippetsOpset", LoopBegin);
LoopBeginDynamic() = default;
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& inputs) const override;
};
/**
* @interface LoopEnd
* @brief Marks the end of the Loop region and defines the loop properties.
@ -77,78 +64,50 @@ class LoopEnd : public LoopBase {
public:
OPENVINO_OP("LoopEnd", "SnippetsOpset", LoopBase);
LoopEnd() = default;
LoopEnd(const Output<Node>& loop_begin, size_t work_amount_increment, std::vector<bool> is_incremented,
LoopEnd(const Output<Node>& loop_begin, size_t work_amount, size_t work_amount_increment,
std::vector<bool> is_incremented, std::vector<int64_t> ptr_increments, std::vector<int64_t> finalization_offsets,
std::vector<int64_t> element_type_sizes, size_t input_num, size_t output_num, size_t id);
void validate_and_infer_types() override;
bool visit_attributes(AttributeVisitor& visitor) override;
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& inputs) const override;
std::shared_ptr<LoopBegin> get_loop_begin();
const std::vector<bool>& get_is_incremented() const;
const std::vector<int64_t>& get_finalization_offsets() const;
const std::vector<int64_t>& get_ptr_increments() const;
const std::vector<int64_t>& get_element_type_sizes() const;
size_t get_work_amount() const;
size_t get_increment() const;
size_t get_id() const;
size_t get_input_num() const;
size_t get_output_num() const;
bool get_evaluate_once() const;
bool has_dynamic_params() const;
void set_is_incremented(std::vector<bool> is_incremented);
void set_finalization_offsets(std::vector<int64_t> offsets);
void set_ptr_increments(std::vector<int64_t> new_ptr_increments);
void set_work_amount(size_t new_work_amount);
void set_increment(size_t new_increment);
void set_evaluate_once(bool once);
void set_id(size_t id);
protected:
std::vector<bool> m_is_incremented = {};
std::vector<int64_t> m_ptr_increments = {};
std::vector<int64_t> m_finalization_offsets = {};
std::vector<int64_t> m_element_type_sizes = {};
size_t m_work_amount = 0;
size_t m_work_amount_increment = 0;
size_t m_input_num = 0;
size_t m_output_num = 0;
size_t m_id = 0; // the corresponding Loop identificator in LoopManager
};
class LoopEndStatic : public LoopEnd {
public:
OPENVINO_OP("LoopEndStatic", "SnippetsOpset", LoopEnd);
LoopEndStatic() = default;
LoopEndStatic(const Output<Node>& loop_begin, size_t work_amount, size_t work_amount_increment,
std::vector<bool> is_incremented, std::vector<int64_t> ptr_increments, std::vector<int64_t> finalization_offsets,
std::vector<int64_t> element_type_sizes, size_t input_num, size_t output_num, size_t id);
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& inputs) const override;
void validate_and_infer_types() override;
bool visit_attributes(AttributeVisitor& visitor) override;
// update_ptr_increments resets non-zero increments to the new_increments. It's used when work_amount_increment is
// updated and we need to refresh ptr increments accordingly while respecting the broadcasting pattern
void update_ptr_increments(int64_t new_increment);
const std::vector<int64_t>& get_finalization_offsets() const;
const std::vector<int64_t>& get_ptr_increments() const;
size_t get_work_amount() const;
bool get_evaluate_once() const;
void set_finalization_offsets(std::vector<int64_t> offsets);
void set_ptr_increments(std::vector<int64_t> new_ptr_increments);
void set_work_amount(size_t new_work_amount);
void set_evaluate_once(bool once);
protected:
std::vector<int64_t> m_ptr_increments = {};
std::vector<int64_t> m_finalization_offsets = {};
size_t m_work_amount = 0;
bool m_evaluate_once = false; // true if the Loop is executed only once, used to skip setting and testing the loop counter
};
class LoopEndDynamic : public LoopEnd {
public:
OPENVINO_OP("LoopEndDynamic", "SnippetsOpset", LoopEnd);
LoopEndDynamic() = default;
LoopEndDynamic(const Output<Node>& loop_begin, size_t work_amount_increment, std::vector<bool> is_incremented,
std::vector<int64_t> element_type_sizes, size_t input_num, size_t output_num, size_t id);
std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& inputs) const override;
};
} // namespace op
} // namespace snippets
} // namespace ov

View File

@ -24,6 +24,10 @@ LoopInfo::LoopInfo(size_t work_amount, size_t increment, const std::vector<Expre
m_output_ports.emplace_back(port);
}
bool LoopInfo::is_dynamic() const {
return utils::is_dynamic_value(m_work_amount) || utils::is_dynamic_value(m_increment);
}
size_t LoopInfo::get_dim_idx() const {
OPENVINO_ASSERT(!m_input_ports.empty(), "Loop info must have at least one input port");
auto equal_dim_idxes = [&](const LoopPort& p) {
@ -136,6 +140,10 @@ std::vector<LoopPort> LoopInfo::clone_loop_ports(const ExpressionMap& expr_map,
return cloned_port_points;
}
bool UnifiedLoopInfo::LoopPortDesc::is_dynamic() const {
return utils::is_dynamic_value(ptr_increment) || utils::is_dynamic_value(finalization_offset);
}
UnifiedLoopInfo::UnifiedLoopInfo(size_t work_amount, size_t increment,
const std::vector<LoopPort>& entries, const std::vector<LoopPort>& exits,
const SpecificIterationHandlers& handlers)
@ -173,6 +181,12 @@ std::shared_ptr<LoopInfo> UnifiedLoopInfo::clone_with_new_expr(const ExpressionM
m_input_port_descs, m_output_port_descs, m_handlers);
}
bool UnifiedLoopInfo::is_dynamic() const {
return LoopInfo::is_dynamic() ||
std::any_of(m_input_port_descs.cbegin(), m_input_port_descs.cend(), [](const LoopPortDesc& shift) { return shift.is_dynamic(); }) ||
std::any_of(m_output_port_descs.cbegin(), m_output_port_descs.cend(), [](const LoopPortDesc& shift) { return shift.is_dynamic(); });
}
const SpecificIterationHandlers& UnifiedLoopInfo::get_handlers() const {
return m_handlers;
}
@ -307,7 +321,6 @@ void ExpandedLoopInfo::validate() const {
"Incompatible data ptr shifts!");
}
std::shared_ptr<LoopInfo> ExpandedLoopInfo::clone_with_new_expr(const ExpressionMap& expr_map) const {
const auto& new_input_ports = clone_loop_ports(expr_map, m_input_ports);
const auto& new_output_ports = clone_loop_ports(expr_map, m_output_ports);
@ -316,6 +329,12 @@ std::shared_ptr<LoopInfo> ExpandedLoopInfo::clone_with_new_expr(const Expression
m_ptr_increments, m_finalization_offsets, m_data_sizes, m_type, m_unified_loop_info);
}
bool ExpandedLoopInfo::is_dynamic() const {
return LoopInfo::is_dynamic() ||
std::any_of(m_ptr_increments.cbegin(), m_ptr_increments.cend(), [](size_t v) { return utils::is_dynamic_value(v); }) ||
std::any_of(m_finalization_offsets.cbegin(), m_finalization_offsets.cend(), [](size_t v) { return utils::is_dynamic_value(v); });
}
const std::shared_ptr<UnifiedLoopInfo>& ExpandedLoopInfo::get_unified_loop_info() const {
OPENVINO_ASSERT(m_unified_loop_info, "Failed to get unified loop info: it's nullptr");
return m_unified_loop_info;

View File

@ -82,22 +82,16 @@ bool CleanRepeatedDataPointerShifts::reuse_increments(const LoopManagerPtr& loop
// TODO [133463]: We have to update LoopEnd and LoopInfo since the both entities must be valid.
// To avoid the both changes, we have to insert Loop ops to LinearIR in the end of pipeline.
auto new_is_incremented = loop_end->get_is_incremented();
if (const auto loop_end_dynamic = ov::as_type_ptr<op::LoopEndDynamic>(loop_end_expr->get_node())) {
for (auto idx_to_drop : resetting_data_indexes) {
new_is_incremented[idx_to_drop] = false;
}
} else if (const auto loop_end_static = ov::as_type_ptr<op::LoopEndStatic>(loop_end_expr->get_node())) {
auto new_ptr_increments = loop_end_static->get_ptr_increments();
auto new_finalization_offsets = loop_end_static->get_finalization_offsets();
for (auto idx_to_drop : resetting_data_indexes) {
new_ptr_increments[idx_to_drop] = 0;
new_finalization_offsets[idx_to_drop] = 0;
new_is_incremented[idx_to_drop] = false;
}
loop_end_static->set_ptr_increments(new_ptr_increments);
loop_end_static->set_finalization_offsets(new_finalization_offsets);
auto new_ptr_increments = loop_end->get_ptr_increments();
auto new_finalization_offsets = loop_end->get_finalization_offsets();
for (auto idx_to_drop : resetting_data_indexes) {
new_is_incremented[idx_to_drop] = false;
new_ptr_increments[idx_to_drop] = 0;
new_finalization_offsets[idx_to_drop] = 0;
}
loop_end->set_is_incremented(new_is_incremented);
loop_end->set_ptr_increments(new_ptr_increments);
loop_end->set_finalization_offsets(new_finalization_offsets);
const auto loop_info = loop_manager->get_loop_info<UnifiedLoopInfo>(loop_end->get_id());
size_t loop_port_idx = 0;

View File

@ -5,7 +5,8 @@
#include "snippets/lowered/pass/cleanup_loop_offsets.hpp"
#include "snippets/lowered/linear_ir.hpp"
#include "snippets/snippets_isa.hpp"
#include "snippets/op/loop.hpp"
#include "snippets/utils.hpp"
#include "snippets/itt.hpp"
namespace ov {
@ -18,7 +19,7 @@ bool CleanupLoopOffsets::run(lowered::LinearIR& linear_ir, lowered::LinearIR::co
bool is_modified = false;
for (auto expr_it = begin; expr_it != end; expr_it++) {
const auto& node = expr_it->get()->get_node();
if (auto loop_end = as_type_ptr<op::LoopEndStatic>(node)) {
if (auto loop_end = as_type_ptr<op::LoopEnd>(node)) {
auto next_expr_it = std::next(expr_it);
const auto& next_node = next_expr_it->get()->get_node();
// Note: Finalization offsets before the Result can be safely disregarded
@ -29,7 +30,7 @@ bool CleanupLoopOffsets::run(lowered::LinearIR& linear_ir, lowered::LinearIR::co
loop_end->set_finalization_offsets(std::vector<int64_t>(fin_offsets.size(), 0));
is_modified = true;
}
if (auto outer_loop_end = as_type_ptr<op::LoopEndStatic>(next_node)) {
if (auto outer_loop_end = as_type_ptr<op::LoopEnd>(next_node)) {
const auto& is_incremented = loop_end->get_is_incremented();
const auto& data_sizes = loop_end->get_element_type_sizes();
auto fin_offsets = loop_end->get_finalization_offsets();
@ -51,6 +52,8 @@ bool CleanupLoopOffsets::run(lowered::LinearIR& linear_ir, lowered::LinearIR::co
if (found != per_port_connector_offset.end()) {
if (!is_incremented[found->second] || outer_data_sizes[i] != data_sizes[found->second])
continue;
if (utils::is_dynamic_value(outer_ptr_increments[i]) || utils::is_dynamic_value(fin_offsets[found->second]))
continue;
// Since data ptr is incremented on [ptr_increment x increment],
// we should guarantee proportionality of ptr shifts.
// If the data ptr can't be proportionally shifted, the optimization is not applied

View File

@ -6,6 +6,7 @@
#include "snippets/lowered/pass/identify_buffers.hpp"
#include "snippets/pass/tokenization.hpp"
#include "snippets/utils.hpp"
#include "snippets/itt.hpp"
namespace ov {
@ -46,7 +47,7 @@ size_t DefineBufferClusters::get_cluster_buffer_id(const AllocateBuffers::Buffer
DefineBufferClusters::BufferPorts DefineBufferClusters::get_input_buffers(const ExpressionPtr& loop_expr) const {
BufferPorts input_buffers;
const auto loop_end = ov::as_type_ptr<op::LoopEndStatic>(loop_expr->get_node());
const auto loop_end = ov::as_type_ptr<op::LoopEnd>(loop_expr->get_node());
const auto in_count = loop_end->get_input_num();
const auto& connectors = loop_expr->get_input_port_connectors();
@ -66,7 +67,7 @@ DefineBufferClusters::BufferPorts DefineBufferClusters::get_input_buffers(const
DefineBufferClusters::BufferPorts DefineBufferClusters::get_output_buffers(const ExpressionPtr& loop_expr) const {
BufferPorts output_buffers;
const auto loop_end = ov::as_type_ptr<op::LoopEndStatic>(loop_expr->get_node());
const auto loop_end = ov::as_type_ptr<op::LoopEnd>(loop_expr->get_node());
const auto in_count = loop_end->get_input_num();
const auto out_count = loop_end->get_output_num();
const auto& connectors = loop_expr->get_input_port_connectors();
@ -85,7 +86,7 @@ DefineBufferClusters::BufferPorts DefineBufferClusters::get_output_buffers(const
void DefineBufferClusters::parse_loop(const LinearIR::constExprIt& expr_it) {
const auto& expr = *expr_it;
const auto loop_end = ov::as_type_ptr<op::LoopEndStatic>(expr->get_node());
const auto loop_end = ov::as_type_ptr<op::LoopEnd>(expr->get_node());
const auto& ptr_increments = loop_end->get_ptr_increments();
const auto& final_offsets = loop_end->get_finalization_offsets();
const auto& data_sizes = loop_end->get_element_type_sizes();
@ -110,19 +111,30 @@ void DefineBufferClusters::parse_loop(const LinearIR::constExprIt& expr_it) {
continue;
const auto input_buffer = ov::as_type_ptr<op::Buffer>(input_buffer_expr->get_node());
// If allocated sizes of buffers are unkown on compilation stage (dynamic),
// we cannot be sure that they're will be the same in runtime.
if ((utils::is_dynamic_value(input_buffer->get_byte_size()) || utils::is_dynamic_value(output_buffer->get_byte_size())))
continue;
// Memory can be reused if reading and writing are executed proportionally:
// - the same reading/writing order
// - the same buffer memory sizes
if ((input_buffer->get_byte_size() != output_buffer->get_byte_size()) ||
(input_buffer_expr->get_output_port_descriptor(0)->get_layout() != output_buffer_expr->get_input_port_descriptor(0)->get_layout()))
continue;
// Also memory can be reused if there are the same ShiftPtrParams (data size, final offsets, ptr increments)
const auto& input_buffer_ports = in.second;
for (const auto& input_buffer_port_idx : input_buffer_ports) {
// Memory can be reused if reading and writing are executed proportionally:
// - the same ShiftPtrParams (data size, final offsets, ptr increments)
// - the same reading/writing order
// - the same buffer memory sizes
const auto input_params =
ShiftPtrParams(data_sizes[input_buffer_port_idx], ptr_increments[input_buffer_port_idx], final_offsets[input_buffer_port_idx]);
const auto output_params =
ShiftPtrParams(data_sizes[output_buffer_port_idx], ptr_increments[output_buffer_port_idx], final_offsets[output_buffer_port_idx]);
if (input_buffer->get_byte_size() == output_buffer->get_byte_size() &&
input_buffer_expr->get_output_port_descriptor(0)->get_layout() == output_buffer_expr->get_input_port_descriptor(0)->get_layout() &&
input_params == output_params) {
// If data pointer shift parameters are unknown on model compilation stage (dynamic),
// we cannot be sure that these data pointers will be proportionally shifted in runtime.
if (input_params.is_static() && output_params.is_static() && input_params == output_params) {
const auto cluster_it = find_cluster_by_expr(input_buffer_expr);
OPENVINO_ASSERT(cluster_it != m_clusters.end(), "Buffer on inputs of Loop must be already saved in clusters");
// Add to the existing cluster
@ -157,11 +169,15 @@ void DefineBufferClusters::parse_nested_loops(const BufferPorts& input_buffers,
auto can_be_data_ptr_proportionally_shifted = [](int64_t outer_buffer_ptr_increment, int64_t outer_buffer_data_size,
int64_t inner_buffer_final_offsets, int64_t inner_buffer_data_size) {
// If data pointer shift parameters are unknown on model compilation stage (dynamic),
// we cannot be sure that these data pointers will be proportionally shifted in runtime.
if (utils::is_dynamic_value(outer_buffer_ptr_increment) || utils::is_dynamic_value(inner_buffer_final_offsets))
return false;
return (outer_buffer_ptr_increment != 0) &&
((inner_buffer_data_size * inner_buffer_final_offsets * -1) == outer_buffer_ptr_increment * outer_buffer_data_size);
};
const auto outer_loop_end = ov::as_type_ptr<op::LoopEndStatic>(outer_loop_end_expr_it->get()->get_node());
const auto outer_loop_end = ov::as_type_ptr<op::LoopEnd>(outer_loop_end_expr_it->get()->get_node());
const auto outer_loop_begin = outer_loop_end->get_loop_begin();
const auto& outer_ptr_increments = outer_loop_end->get_ptr_increments();
const auto& outer_data_sizes = outer_loop_end->get_element_type_sizes();
@ -218,7 +234,7 @@ int64_t DefineBufferClusters::get_buffer_finalization_offset(const ExpressionPtr
const auto consumers = buffer_out->get_consumers();
for (const auto& consumer : consumers) {
const auto consumer_expr = consumer.get_expr();
const auto loop_end = ov::as_type_ptr<ov::snippets::op::LoopEndStatic>(consumer_expr->get_node());
const auto loop_end = ov::as_type_ptr<ov::snippets::op::LoopEnd>(consumer_expr->get_node());
if (loop_end && consumer_expr->get_loop_ids() == buffer_expr->get_loop_ids()) {
const auto loop_order = ov::snippets::pass::GetTopologicalOrder(loop_end);
if (loop_order > last_loop_exec_order) {
@ -243,7 +259,7 @@ bool DefineBufferClusters::unite_nested_clusters(const AllocateBuffers::BufferCl
auto& up_idx = is_outer_up ? outer_idx : inner_idx;
auto& down_idx = is_outer_up ? inner_idx : outer_idx;
if (are_buffer_neighbours(up_buffer, down_buffer, common_loop_end_expr, up_idx, down_idx)) {
const auto common_loop_end = ov::as_type_ptr<op::LoopEndStatic>(common_loop_end_expr->get_node());
const auto common_loop_end = ov::as_type_ptr<op::LoopEnd>(common_loop_end_expr->get_node());
const auto& inner_ptr_increments = common_loop_end->get_ptr_increments();
const auto& inner_final_offsets = common_loop_end->get_finalization_offsets();
const auto& inner_data_sizes = common_loop_end->get_element_type_sizes();
@ -289,7 +305,7 @@ bool DefineBufferClusters::are_buffer_neighbours(const ExpressionPtr& up, const
for (const auto& out : up->get_output_port_connectors()) {
for (const auto& buffer_consumer : out->get_consumers()) {
const auto buffer_consumer_expr = buffer_consumer.get_expr();
const auto loop_end = ov::as_type_ptr<op::LoopEndStatic>(buffer_consumer_expr->get_node());
const auto loop_end = ov::as_type_ptr<op::LoopEnd>(buffer_consumer_expr->get_node());
if (!loop_end)
continue;
const auto& loop_inputs = buffer_consumer_expr->get_input_port_connectors();
@ -326,7 +342,7 @@ bool DefineBufferClusters::run(lowered::LinearIR& linear_ir, lowered::LinearIR::
for (auto expr_it = begin; expr_it != end; ++expr_it) {
const auto& expr = *expr_it;
const auto op = expr->get_node();
if (ov::is_type<op::LoopEndStatic>(op)) {
if (ov::is_type<op::LoopEnd>(op)) {
parse_loop(expr_it);
continue;
}

View File

@ -4,10 +4,9 @@
#include "snippets/lowered/pass/identify_buffers.hpp"
#include "snippets/itt.hpp"
#include "snippets/lowered/linear_ir.hpp"
#include "snippets/op/brgemm.hpp"
#include "snippets/snippets_isa.hpp"
#include "snippets/itt.hpp"
namespace ov {
namespace snippets {
@ -36,9 +35,13 @@ size_t IdentifyBuffers::get_buffer_idx(const ExpressionPtr& target, const Buffer
}
bool IdentifyBuffers::can_reuse_id(const ShiftPtrParams& lhs, const ShiftPtrParams& rhs) {
// If data pointer shift parameters are unknown on model compilation stage (dynamic),
// we cannot be sure that these data pointers will be proportionally shifted.
// Then we force `false` value here to set unique registers for these buffers
const auto are_static = lhs.is_static() && rhs.is_static();
const auto equal_ptr_params_shifting = lhs.ptr_increment == rhs.ptr_increment && lhs.finalization_offset == rhs.finalization_offset;
const auto equal_element_type_sizes = lhs.data_size == rhs.data_size;
return equal_ptr_params_shifting && (equal_element_type_sizes || (lhs.ptr_increment == 0 && lhs.finalization_offset == 0));
return are_static && equal_ptr_params_shifting && (equal_element_type_sizes || (lhs.ptr_increment == 0 && lhs.finalization_offset == 0));
}
bool IdentifyBuffers::are_adjacent(const std::pair<ExpressionPtr, ShiftPtrParams>& lhs,
@ -57,7 +60,7 @@ bool IdentifyBuffers::are_adjacent(const std::pair<ExpressionPtr, ShiftPtrParams
const auto are_outer_loops_the_same = lhs_ids.size() != rhs_ids.size() &&
std::equal(rhs_ids.cbegin(), rhs_ids.cbegin() + count_outer_loops, lhs_ids.cbegin());
const auto outer_buffer_has_zero_shifts = outer_buffer.second.ptr_increment == 0 && outer_buffer.second.finalization_offset == 0;
return !are_outer_loops_the_same || !outer_buffer_has_zero_shifts;
return !(are_outer_loops_the_same && outer_buffer_has_zero_shifts);
}
}
@ -88,7 +91,7 @@ std::vector<bool> IdentifyBuffers::create_adjacency_matrix(LinearIR::constExprIt
for (auto expr_it = begin; expr_it != end; expr_it++) {
const auto &expr = *expr_it;
if (!ov::is_type<op::LoopEndStatic>(expr->get_node()))
if (!ov::is_type<op::LoopEnd>(expr->get_node()))
continue;
const auto buffer_loop_neighbours = get_buffer_loop_neighbours(expr);
@ -111,7 +114,7 @@ std::vector<bool> IdentifyBuffers::create_adjacency_matrix(LinearIR::constExprIt
}
IdentifyBuffers::BufferMap IdentifyBuffers::get_buffer_loop_neighbours(const ExpressionPtr& loop_end_expr) {
const auto& loop_end = ov::as_type_ptr<op::LoopEndStatic>(loop_end_expr->get_node());
const auto& loop_end = ov::as_type_ptr<op::LoopEnd>(loop_end_expr->get_node());
const auto input_count = loop_end->get_input_num();
const auto output_count = loop_end->get_output_num();
@ -142,7 +145,7 @@ IdentifyBuffers::BufferMap IdentifyBuffers::get_buffer_loop_neighbours(const Exp
if (ov::is_type<op::Buffer>(child_expr->get_node())) {
buffer_neighbours[child_expr] = { data_sizes[i], ptr_increments[i], finalization_offsets[i] };
buffer_count++;
} else if (ov::is_type<op::LoopEndStatic>(child_expr->get_node())) {
} else if (ov::is_type<op::LoopEnd>(child_expr->get_node())) {
loop_count++;
}
}
@ -155,7 +158,7 @@ IdentifyBuffers::BufferMap IdentifyBuffers::get_buffer_loop_neighbours(const Exp
}
IdentifyBuffers::BufferMap IdentifyBuffers::get_buffer_loop_inside(const LinearIR::constExprIt& loop_end_it) {
const auto& loop_end = ov::as_type_ptr<op::LoopEndStatic>((*loop_end_it)->get_node());
const auto& loop_end = ov::as_type_ptr<op::LoopEnd>((*loop_end_it)->get_node());
const auto loop_begin = loop_end->get_loop_begin();
BufferMap inner_buffers;
for (auto it = std::reverse_iterator<LinearIR::constExprIt>(loop_end_it); (*it)->get_node() != loop_begin; ++it) {

View File

@ -72,7 +72,7 @@ inline void init_is_incremented(LoopPort& port, size_t loop_id) {
}
}
inline int64_t get_ptr_increment(const LoopPort& loop_port, size_t work_amount) {
inline int64_t get_ptr_increment(const LoopPort& loop_port, size_t work_amount, size_t port_count) {
if (!loop_port.is_incremented)
return 0;
@ -87,8 +87,8 @@ inline int64_t get_ptr_increment(const LoopPort& loop_port, size_t work_amount)
} else {
OPENVINO_THROW("Unsupported expression port type!");
}
// When we cannot say about broadcasting by last dim
if (dim == shape.size() - 1 && utils::is_dynamic_value(shape.back())) {
// When we cannot say about broadcasting
if (utils::is_dynamic_value(shape[dim]) && port_count > 1) {
return utils::get_dynamic_value<int64_t>();
} else if (!(shape[dim] == 1 && work_amount != 1)) {
return get_stride(dim, shape);
@ -134,9 +134,12 @@ void InitLoops::init_loop_info(const UnifiedLoopInfoPtr& loop_info, const size_t
init_work_amount(loop_info);
const auto work_amount = loop_info->get_work_amount();
const auto input_count = loop_info->get_input_count();
const auto output_count = loop_info->get_output_count();
auto init_runtime_parameters = [&work_amount](LoopPort& loop_port, UnifiedLoopInfo::LoopPortDesc& ptr_shifts_params) {
ptr_shifts_params.ptr_increment = get_ptr_increment(loop_port, work_amount);
auto init_runtime_parameters = [&work_amount, &input_count, &output_count](LoopPort& loop_port, UnifiedLoopInfo::LoopPortDesc& ptr_shifts_params) {
ptr_shifts_params.ptr_increment = get_ptr_increment(loop_port, work_amount,
loop_port.expr_port->get_type() == ExpressionPort::Input ? input_count : output_count);
ptr_shifts_params.finalization_offset = get_finalization_offset(work_amount, ptr_shifts_params.ptr_increment);
};

View File

@ -17,41 +17,27 @@ namespace pass {
void InsertLoops::insertion(LinearIR& linear_ir, const LoopManagerPtr& loop_manager, size_t loop_id) {
const auto loop_info = loop_manager->get_loop_info<UnifiedLoopInfo>(loop_id);
auto loop_entries = loop_info->get_input_ports();
auto loop_exits = loop_info->get_output_ports();
const auto work_amount = loop_info->get_work_amount();
const auto work_amount_increment = loop_info->get_increment();
const auto loop_bounds = loop_manager->get_loop_bounds(linear_ir, loop_id);
const auto in_num = loop_info->get_input_count();
const auto out_num = loop_info->get_output_count();
std::vector<PortConnectorPtr> loop_end_inputs;
loop_end_inputs.reserve(loop_entries.size() + loop_exits.size());
loop_end_inputs.reserve(in_num + out_num);
loop_info->iterate_through_ports([&loop_end_inputs](const LoopPort& port) {
loop_end_inputs.push_back(port.expr_port->get_port_connector_ptr());
});
const auto is_incremented = loop_info->get_is_incremented();
const auto ptr_increments = loop_info->get_ptr_increments();
const auto finalization_offsets = loop_info->get_finalization_offsets();
const auto io_data_sizes = loop_info->get_data_sizes();
// Should be inited by LoopInfo
const auto is_dynamic_loop = is_loop_dynamic(loop_info);
std::shared_ptr<op::LoopBegin> loop_begin = nullptr;
std::shared_ptr<op::LoopEnd> loop_end = nullptr;
if (is_dynamic_loop) {
loop_begin = std::make_shared<op::LoopBeginDynamic>();
loop_end = std::make_shared<op::LoopEndDynamic>(loop_begin, work_amount_increment, is_incremented, io_data_sizes,
loop_entries.size(), loop_exits.size(), loop_id);
} else {
const auto ptr_increments = loop_info->get_ptr_increments();
const auto finalization_offsets = loop_info->get_finalization_offsets();
loop_begin = std::make_shared<op::LoopBeginStatic>();
loop_end = std::make_shared<op::LoopEndStatic>(loop_begin, work_amount, work_amount_increment, is_incremented, ptr_increments,
finalization_offsets, io_data_sizes, loop_entries.size(), loop_exits.size(), loop_id);
}
const auto loop_begin = std::make_shared<op::LoopBegin>();
const auto loop_end = std::make_shared<op::LoopEnd>(loop_begin, work_amount, work_amount_increment, is_incremented, ptr_increments,
finalization_offsets, io_data_sizes, in_num, out_num, loop_id);
const auto loop_bounds = loop_manager->get_loop_bounds(linear_ir, loop_id);
const auto outer_loop_ids = loop_manager->get_outer_expr_loops(*loop_bounds.first, loop_id);
const auto loop_begin_expr = *linear_ir.insert_node(loop_begin, std::vector<PortConnectorPtr>{}, outer_loop_ids, false, loop_bounds.first);
@ -60,17 +46,6 @@ void InsertLoops::insertion(LinearIR& linear_ir, const LoopManagerPtr& loop_mana
linear_ir.insert_node(loop_end, loop_end_inputs, outer_loop_ids, false, loop_bounds.second);
}
bool InsertLoops::is_loop_dynamic(const UnifiedLoopInfoPtr& loop_info) {
auto is_loop_port_dynamic = [](const UnifiedLoopInfo::LoopPortDesc& shifts) {
return utils::is_dynamic_value(shifts.ptr_increment) || utils::is_dynamic_value(shifts.finalization_offset);
};
const auto& entry_shifts = loop_info->get_input_port_descs();
const auto& exit_shifts = loop_info->get_output_port_descs();
return utils::is_dynamic_value(loop_info->get_work_amount()) ||
std::any_of(entry_shifts.cbegin(), entry_shifts.cend(), is_loop_port_dynamic) ||
std::any_of(exit_shifts.cbegin(), exit_shifts.cend(), is_loop_port_dynamic);
}
bool InsertLoops::run(LinearIR& linear_ir, lowered::LinearIR::constExprIt begin, lowered::LinearIR::constExprIt end) {
OV_ITT_SCOPED_TASK(ov::pass::itt::domains::SnippetsTransform, "Snippets::InsertLoops")
const auto& loop_manager = linear_ir.get_loop_manager();

View File

@ -101,12 +101,10 @@ void InsertSpecificIterations::init_decomposed_loop(LinearIR& linear_ir, LinearI
const auto& loop_manager = linear_ir.get_loop_manager();
const auto new_id = loop_manager->replace_with_new_loop(linear_ir, begin, std::next(end), decomposed_loop_info, unified_loop_id);
decomposed_loop_end->set_id(new_id);
decomposed_loop_end->set_work_amount(decomposed_loop_info->get_work_amount());
decomposed_loop_end->set_increment(decomposed_loop_info->get_increment());
if (const auto static_loop_end = ov::as_type_ptr<op::LoopEndStatic>(decomposed_loop_end)) {
static_loop_end->set_work_amount(decomposed_loop_info->get_work_amount());
static_loop_end->set_ptr_increments(decomposed_loop_info->get_ptr_increments());
static_loop_end->set_finalization_offsets(decomposed_loop_info->get_finalization_offsets());
}
decomposed_loop_end->set_ptr_increments(decomposed_loop_info->get_ptr_increments());
decomposed_loop_end->set_finalization_offsets(decomposed_loop_info->get_finalization_offsets());
// Note: handlers must be run on the range started with the first operation in the loop body.
const auto handlers = decomposed_loop_info->get_handler_passes();
handlers.run(linear_ir, std::next(begin), end);

View File

@ -85,7 +85,7 @@ TransformInnerSplitLoop::TransformInnerSplitLoop(size_t tail_size) : RangedPass(
bool TransformInnerSplitLoop::run(LinearIR& linear_ir, LinearIR::constExprIt begin, LinearIR::constExprIt end) {
const auto& expr = *end;
const auto node = expr->get_node();
const auto loop_end = ov::as_type_ptr<op::LoopEndStatic>(node);
const auto loop_end = ov::as_type_ptr<op::LoopEnd>(node);
OPENVINO_ASSERT(loop_end, "the last operation in range must be LoopEnd");
const auto& loop_manager = linear_ir.get_loop_manager();
@ -97,7 +97,7 @@ bool TransformInnerSplitLoop::run(LinearIR& linear_ir, LinearIR::constExprIt beg
bool modified = false;
for (auto it = begin; it != end; ++it) {
const auto& expr = *it;
const auto inner_loop_end = ov::as_type_ptr<op::LoopEndStatic>(expr->get_node());
const auto inner_loop_end = ov::as_type_ptr<op::LoopEnd>(expr->get_node());
if (!inner_loop_end)
continue;
// There is already ExpandedLoopInfo
@ -105,6 +105,8 @@ bool TransformInnerSplitLoop::run(LinearIR& linear_ir, LinearIR::constExprIt beg
const auto inner_dim_idx = inner_loop_info->get_dim_idx();
if (inner_dim_idx != current_dim_idx)
continue;
// TODO [141735] : At the moment Splitted loops are not supported in dynamic case
OPENVINO_ASSERT(!inner_loop_end->has_dynamic_params(), "inner loop must be static in TransformInnerSplitLoop");
const auto inner_loop_begin = inner_loop_end->get_loop_begin();
const auto inner_loop_work_amount = static_cast<int64_t>(inner_loop_end->get_work_amount());
const auto inner_loop_increment = inner_loop_end->get_increment();

View File

@ -5,7 +5,8 @@
#include "snippets/lowered/pass/optimize_loop_single_evaluation.hpp"
#include "snippets/lowered/linear_ir.hpp"
#include "snippets/snippets_isa.hpp"
#include "snippets/op/loop.hpp"
#include "snippets/utils.hpp"
#include "snippets/itt.hpp"
namespace ov {
@ -18,7 +19,7 @@ bool OptimizeLoopSingleEvaluation::run(lowered::LinearIR& linear_ir, lowered::Li
bool is_modified = false;
for (auto expr_it = begin; expr_it != end; ++expr_it) {
const auto& expr = *expr_it;
if (auto loop_end = ov::as_type_ptr<op::LoopEndStatic>(expr->get_node())) {
if (auto loop_end = ov::as_type_ptr<op::LoopEnd>(expr->get_node())) {
// *1* solo vector/tail loop + empty outer loop
// => skip increments (both counter & ptr) : set evaluate_once flag
// *2* solo vector/tail loop + non-empty outer loop
@ -26,7 +27,7 @@ bool OptimizeLoopSingleEvaluation::run(lowered::LinearIR& linear_ir, lowered::Li
// and perform pointer increments through finalization offsets
// *3* vector loop(s) + one tail loop
// => vector as usual, tail depends on outer loop, see *1* and *2*
if (loop_end->get_work_amount() >= 2 * loop_end->get_increment())
if (loop_end->has_dynamic_params() || loop_end->get_work_amount() >= 2 * loop_end->get_increment())
continue;
auto new_finalization_offsets = loop_end->get_finalization_offsets();

View File

@ -26,7 +26,9 @@ bool SplitLoops::can_be_split(const UnifiedLoopInfoPtr& loop_to_split, const Uni
const bool equal_dim_idxes = current_dim_idx != LoopInfo::UNDEFINED_DIM_IDX && current_dim_idx == parent_dim_idx;
const bool only_main_body = handlers.get_passes<SpecificLoopIterType::FIRST_ITER>().empty() &&
handlers.get_passes<SpecificLoopIterType::LAST_ITER>().empty();
return loop_to_split->get_work_amount() == loop_to_fuse->get_work_amount() &&
// TODO [141735] : At the moment Splitted loops are not supported in dynamic case
const auto are_static = !loop_to_split->is_dynamic() && !loop_to_fuse->is_dynamic();
return are_static && loop_to_split->get_work_amount() == loop_to_fuse->get_work_amount() &&
loop_to_split->get_increment() != loop_to_fuse->get_increment() && equal_dim_idxes && only_main_body;
}

View File

@ -83,23 +83,23 @@ void validate_buffer(const ExpressionPtr& expr, const LinearIR& linear_ir) {
}
}
void validate_loop_end_static(const ExpressionPtr& expr, const LinearIR& linear_ir) {
const auto loop_end = ov::as_type_ptr<op::LoopEndStatic>(expr->get_node());
OPENVINO_ASSERT(loop_end, "LoopEndStatic validation expects LoopEndStatic op");
OPENVINO_ASSERT(ov::is_type<op::LoopBeginStatic>(loop_end->get_loop_begin()),
"LoopEndStatic must be connected to the LoopBeginStatic");
void validate_loop_end(const ExpressionPtr& expr, const LinearIR& linear_ir) {
const auto loop_end = ov::as_type_ptr<op::LoopEnd>(expr->get_node());
OPENVINO_ASSERT(loop_end, "LoopEnd validation expects LoopEnd op");
OPENVINO_ASSERT(loop_end->get_loop_begin() != nullptr,
"LoopEnd must be connected to the LoopBegin");
const auto& loop_manager = linear_ir.get_loop_manager();
const auto& loop_info = loop_manager->get_loop_info<UnifiedLoopInfo>(loop_end->get_id());
OPENVINO_ASSERT(loop_info->get_work_amount() == loop_end->get_work_amount() &&
loop_info->get_increment() == loop_end->get_increment(),
"Incompatible LoopEndStatic and the corresponding LoopInfo");
"Incompatible LoopEnd and the corresponding LoopInfo");
const auto input_port_infos = loop_info->get_input_ports_info();
const auto output_port_infos = loop_info->get_output_ports_info();
OPENVINO_ASSERT(input_port_infos.size() == loop_end->get_input_num() &&
output_port_infos.size() == loop_end->get_output_num(),
"Incompatible LoopEndStatic and the corresponding LoopInfo");
"Incompatible LoopEnd and the corresponding LoopInfo");
const auto& is_incremented = loop_end->get_is_incremented();
const auto& ptr_increments = loop_end->get_ptr_increments();
@ -109,39 +109,12 @@ void validate_loop_end_static(const ExpressionPtr& expr, const LinearIR& linear_
OPENVINO_ASSERT(is_incremented[i + shift] == loop_port_infos[i].port.is_incremented &&
ptr_increments[i + shift] == loop_port_infos[i].desc.ptr_increment &&
final_offsets[i + shift] == loop_port_infos[i].desc.finalization_offset,
"Incompatible data ptr shifts in LoopEndStatic and the corresponding LoopInfo");
"Incompatible data ptr shifts in LoopEnd and the corresponding LoopInfo");
}
};
validate_loop_ports(input_port_infos);
validate_loop_ports(output_port_infos, loop_end->get_input_num());
}
void validate_loop_end_dynamic(const ExpressionPtr& expr, const LinearIR& linear_ir) {
const auto loop_end = ov::as_type_ptr<op::LoopEndDynamic>(expr->get_node());
OPENVINO_ASSERT(loop_end, "LoopEndDynamic validation expects LoopEndStatic op");
OPENVINO_ASSERT(ov::is_type<op::LoopBeginDynamic>(loop_end->get_loop_begin()),
"LoopEndDynamic must be connected to the LoopBeginDynamic");
const auto& loop_manager = linear_ir.get_loop_manager();
const auto& loop_info = loop_manager->get_loop_info<UnifiedLoopInfo>(loop_end->get_id());
OPENVINO_ASSERT(loop_info->get_increment() == loop_end->get_increment(),
"Incompatible LoopEndDynamic and the corresponding LoopInfo");
OPENVINO_ASSERT(loop_info->get_input_count() == loop_end->get_input_num() &&
loop_info->get_output_count() == loop_end->get_output_num(),
"Incompatible LoopEndStatic and the corresponding LoopInfo");
const auto& is_incremented = loop_end->get_is_incremented();
auto validate_loop_ports = [&](const std::vector<LoopPort>& loop_ports, size_t shift = 0) {
for (size_t i = 0; i < loop_ports.size(); ++i) {
OPENVINO_ASSERT(is_incremented[i + shift] == loop_ports[i].is_incremented,
"Incompatible data ptr shifts in LoopEndStatic and the corresponding LoopInfo");
}
};
validate_loop_ports(loop_info->get_input_ports());
validate_loop_ports(loop_info->get_output_ports(), loop_end->get_input_num());
}
} // namespace
Validate::Validate() {
@ -149,8 +122,7 @@ Validate::Validate() {
{ov::op::v0::Parameter::get_type_info_static(), validate_parameter},
{ov::op::v0::Result::get_type_info_static(), validate_result},
{ov::snippets::op::Buffer::get_type_info_static(), validate_buffer},
{ov::snippets::op::LoopEndStatic::get_type_info_static(), validate_loop_end_static},
{ov::snippets::op::LoopEndDynamic::get_type_info_static(), validate_loop_end_dynamic}
{ov::snippets::op::LoopEnd::get_type_info_static(), validate_loop_end},
};
}

View File

@ -110,18 +110,16 @@ void ValidateExpandedLoops::validate_loop_expressions(const LinearIR& linear_ir)
const auto expanded_loop_info = ov::as_type_ptr<ExpandedLoopInfo>(loop_manager->get_loop_info(loop_id));
INFORMATIVE_ASSERT(expanded_loop_info, "expects only ExpandedLoopInfo in LoopManager");
INFORMATIVE_ASSERT(loop_end->get_work_amount() == expanded_loop_info->get_work_amount(),
"incompatible work amount of LoopEnd and ExpandedLoopInfo");
INFORMATIVE_ASSERT(loop_end->get_increment() == expanded_loop_info->get_increment(),
"incompatible increment of LoopEnd and ExpandedLoopInfo");
INFORMATIVE_ASSERT(loop_end->get_element_type_sizes() == expanded_loop_info->get_data_sizes(),
"incompatible element sizes of LoopEnd and ExpandedLoopInfo");
if (const auto static_loop_end = ov::as_type_ptr<op::LoopEndStatic>(expr->get_node())) {
INFORMATIVE_ASSERT(static_loop_end->get_work_amount() == expanded_loop_info->get_work_amount(),
"incompatible work amount of LoopEnd and ExpandedLoopInfo");
INFORMATIVE_ASSERT(static_loop_end->get_ptr_increments() == expanded_loop_info->get_ptr_increments(),
"incompatible pointer increments of LoopEnd and ExpandedLoopInfo");
INFORMATIVE_ASSERT(static_loop_end->get_finalization_offsets() == expanded_loop_info->get_finalization_offsets(),
"incompatible finalization offsets of LoopEnd and ExpandedLoopInfo");
}
INFORMATIVE_ASSERT(loop_end->get_ptr_increments() == expanded_loop_info->get_ptr_increments(),
"incompatible pointer increments of LoopEnd and ExpandedLoopInfo");
INFORMATIVE_ASSERT(loop_end->get_finalization_offsets() == expanded_loop_info->get_finalization_offsets(),
"incompatible finalization offsets of LoopEnd and ExpandedLoopInfo");
}
}
INFORMATIVE_ASSERT(unique_loop_ids.size() == loop_manager->get_map().size(),

View File

@ -3,7 +3,8 @@
//
#include "snippets/op/loop.hpp"
#include "snippets/generator.hpp"
#include "snippets/utils.hpp"
namespace ov {
namespace snippets {
@ -29,6 +30,11 @@ void LoopBegin::validate_and_infer_types() {
"LoopBegin must have LoopEnd connected to its last output");
}
std::shared_ptr<Node> LoopBegin::clone_with_new_inputs(const OutputVector& inputs) const {
OPENVINO_ASSERT(inputs.empty(), "LoopBegin should not contain inputs");
return std::make_shared<LoopBegin>();
}
std::shared_ptr<LoopEnd> LoopBegin::get_loop_end() const {
const auto& last_output_inputs = get_output_target_inputs(0);
OPENVINO_ASSERT(last_output_inputs.size() == 1, "LoopBegin has more than one inputs attached to the last output");
@ -37,30 +43,71 @@ std::shared_ptr<LoopEnd> LoopBegin::get_loop_end() const {
return loop_end;
}
std::shared_ptr<Node> LoopBeginStatic::clone_with_new_inputs(const OutputVector& inputs) const {
return std::make_shared<LoopBeginStatic>();
}
std::shared_ptr<Node> LoopBeginDynamic::clone_with_new_inputs(const OutputVector& inputs) const {
return std::make_shared<LoopBeginDynamic>();
}
LoopEnd::LoopEnd(const Output<Node>& loop_begin, size_t work_amount_increment, std::vector<bool> is_incremented,
LoopEnd::LoopEnd(const Output<Node>& loop_begin, size_t work_amount, size_t work_amount_increment,
std::vector<bool> is_incremented, std::vector<int64_t> ptr_increments, std::vector<int64_t> finalization_offsets,
std::vector<int64_t> element_type_sizes, size_t input_num, size_t output_num, size_t id)
: LoopBase({loop_begin}),
m_is_incremented(std::move(is_incremented)),
m_ptr_increments(std::move(ptr_increments)),
m_finalization_offsets(std::move(finalization_offsets)),
m_element_type_sizes(std::move(element_type_sizes)),
m_work_amount(work_amount),
m_work_amount_increment(work_amount_increment),
m_input_num(input_num),
m_output_num(output_num),
m_id(id) {
m_id(id),
m_evaluate_once(false) {
constructor_validate_and_infer_types();
}
void LoopEnd::validate_and_infer_types() {
NODE_VALIDATION_CHECK(this, get_input_size() == 1, "LoopEnd must have one input");
const auto loop_begin = ov::as_type_ptr<LoopBegin>(get_input_node_shared_ptr(0));
const auto io_size = m_input_num + m_output_num;
NODE_VALIDATION_CHECK(this, loop_begin != nullptr, "LoopEnd must have LoopBegin as the last argument");
#define VALIDATE_VALUES(values, name, default_value) \
NODE_VALIDATION_CHECK(this, values.empty() || values.size() == io_size, \
name, " must be either empty or defined per every input & output of joined Loop. Expected size: ", \
io_size, " got ", values.size()); \
if (values.empty()) \
values.resize(io_size, default_value);
VALIDATE_VALUES(m_is_incremented, "is_incremented", true)
VALIDATE_VALUES(m_ptr_increments, "ptr_increments", 0)
VALIDATE_VALUES(m_finalization_offsets, "finalization_offsets", 0)
VALIDATE_VALUES(m_element_type_sizes, "element_type_sizes", 0)
#undef VALIDATE_VALUES
set_output_type(0, element::f32, ov::PartialShape{});
}
bool LoopEnd::visit_attributes(AttributeVisitor &visitor) {
std::vector<int> int_incremented(m_is_incremented.cbegin(), m_is_incremented.cend());
visitor.on_attribute("is_incremented", int_incremented);
visitor.on_attribute("ptr_incr", m_ptr_increments);
visitor.on_attribute("fin_offset", m_finalization_offsets);
visitor.on_attribute("data_sizes", m_element_type_sizes);
visitor.on_attribute("work_amount", m_work_amount);
visitor.on_attribute("increment", m_work_amount_increment);
visitor.on_attribute("input_num", m_input_num);
visitor.on_attribute("output_num", m_output_num);
visitor.on_attribute("id", m_id);
visitor.on_attribute("evaluate_once", m_evaluate_once);
return true;
}
std::shared_ptr<Node> LoopEnd::clone_with_new_inputs(const OutputVector& inputs) const {
check_new_args_count(this, inputs);
const auto loop_end = std::make_shared<LoopEnd>(inputs.at(0), m_work_amount, m_work_amount_increment, m_is_incremented, m_ptr_increments,
m_finalization_offsets, m_element_type_sizes, m_input_num, m_output_num, m_id);
loop_end->m_evaluate_once = m_evaluate_once;
return loop_end;
}
std::shared_ptr<LoopBegin> LoopEnd::get_loop_begin() {
const auto& loop_begin = ov::as_type_ptr<LoopBegin>(get_input_source_output(get_input_size() - 1).get_node_shared_ptr());
if (!loop_begin)
throw std::invalid_argument("LoopEnd last input is not connected to LoopBegin");
OPENVINO_ASSERT(loop_begin != nullptr, "LoopEnd last input is not connected to LoopBegin");
return loop_begin;
}
@ -68,6 +115,14 @@ const std::vector<bool>& LoopEnd::get_is_incremented() const {
return m_is_incremented;
}
const std::vector<int64_t>& LoopEnd::get_finalization_offsets() const {
return m_finalization_offsets;
}
const std::vector<int64_t>& LoopEnd::get_ptr_increments() const {
return m_ptr_increments;
}
const std::vector<int64_t>& LoopEnd::get_element_type_sizes() const {
return m_element_type_sizes;
}
@ -80,6 +135,10 @@ size_t LoopEnd::get_output_num() const {
return m_output_num;
}
size_t LoopEnd::get_work_amount() const {
return m_work_amount;
}
size_t LoopEnd::get_increment() const {
return m_work_amount_increment;
}
@ -88,131 +147,51 @@ size_t LoopEnd::get_id() const {
return m_id;
}
bool LoopEnd::get_evaluate_once() const {
return m_evaluate_once;
}
bool LoopEnd::has_dynamic_params() const {
auto is_vector_dynamic = [](const std::vector<int64_t>& values) {
return std::any_of(values.cbegin(), values.cend(), utils::is_dynamic_value<int64_t>);
};
return utils::is_dynamic_value(m_work_amount) || is_vector_dynamic(m_ptr_increments) || is_vector_dynamic(m_finalization_offsets);
}
void LoopEnd::set_is_incremented(std::vector<bool> is_incremented) {
OPENVINO_ASSERT(is_incremented.size() == m_input_num + m_output_num,
"LoopEnd set_is_incremented is called with inconsistent is_incremented.size()");
m_is_incremented = std::move(is_incremented);
}
void LoopEnd::set_finalization_offsets(std::vector<int64_t> offsets) {
OPENVINO_ASSERT(offsets.size() == m_input_num + m_output_num,
"LoopEnd set_finalization_offsets is called with inconsistent offsets.size()");
m_finalization_offsets = std::move(offsets);
}
void LoopEnd::set_ptr_increments(std::vector<int64_t> new_ptr_increments) {
OPENVINO_ASSERT(new_ptr_increments.size() == m_input_num + m_output_num,
"LoopEnd set_ptr_increments is called with inconsistent new_ptr_increments.size()");
m_ptr_increments = std::move(new_ptr_increments);
}
void LoopEnd::set_work_amount(size_t new_work_amount) {
m_work_amount = new_work_amount;
}
void LoopEnd::set_increment(size_t new_increment) {
m_work_amount_increment = new_increment;
}
void LoopEnd::set_evaluate_once(bool once) {
m_evaluate_once = once;
}
void LoopEnd::set_id(size_t id) {
m_id = id;
}
void LoopEnd::validate_and_infer_types() {
NODE_VALIDATION_CHECK(this, get_input_size() == 1, "LoopEnd must have one input");
const auto loop_begin = ov::as_type_ptr<LoopBegin>(get_input_node_shared_ptr(0));
const auto io_size = m_input_num + m_output_num;
NODE_VALIDATION_CHECK(this, loop_begin != nullptr, "LoopEnd must have LoopBegin as the last argument");
NODE_VALIDATION_CHECK(this, m_is_incremented.empty() || m_is_incremented.size() == io_size,
"is_incremented must be either empty or defined per every input & output of joined Loop. Expected size: ",
io_size, " got ", m_is_incremented.size());
set_output_type(0, element::f32, ov::PartialShape{});
}
bool LoopEnd::visit_attributes(AttributeVisitor &visitor) {
std::vector<int> int_incremented(m_is_incremented.cbegin(), m_is_incremented.cend());
visitor.on_attribute("is_incremented", int_incremented);
visitor.on_attribute("data_sizes", m_element_type_sizes);
visitor.on_attribute("increment", m_work_amount_increment);
visitor.on_attribute("input_num", m_input_num);
visitor.on_attribute("output_num", m_output_num);
visitor.on_attribute("id", m_id);
return true;
}
LoopEndStatic::LoopEndStatic(const Output<Node>& loop_begin, size_t work_amount, size_t work_amount_increment,
std::vector<bool> is_incremented, std::vector<int64_t> ptr_increments, std::vector<int64_t> finalization_offsets,
std::vector<int64_t> element_type_sizes, size_t input_num, size_t output_num, size_t id)
: LoopEnd(loop_begin, work_amount_increment, std::move(is_incremented), std::move(element_type_sizes), input_num, output_num, id),
m_ptr_increments(std::move(ptr_increments)), m_finalization_offsets(std::move(finalization_offsets)), m_work_amount(work_amount),
m_evaluate_once(false) {}
std::shared_ptr<Node> LoopEndStatic::clone_with_new_inputs(const OutputVector& inputs) const {
check_new_args_count(this, inputs);
const auto loop_end = std::make_shared<LoopEndStatic>(inputs.at(0), m_work_amount, m_work_amount_increment, m_is_incremented, m_ptr_increments,
m_finalization_offsets, m_element_type_sizes, m_input_num, m_output_num, m_id);
loop_end->m_evaluate_once = m_evaluate_once;
return loop_end;
}
void LoopEndStatic::validate_and_infer_types() {
LoopEnd::validate_and_infer_types();
const auto io_size = m_input_num + m_output_num;
NODE_VALIDATION_CHECK(this, m_ptr_increments.empty() || m_ptr_increments.size() == io_size,
"ptr_increments must be either empty or defined per every input & output of joined Loop. Expected size: ",
io_size, " got ", m_ptr_increments.size());
NODE_VALIDATION_CHECK(this, m_finalization_offsets.empty() || m_finalization_offsets.size() == io_size,
"finalization_offsets must be either empty or defined per every input & output of joined Loop. Expected size: ",
io_size, " got ", m_finalization_offsets.size());
if (m_ptr_increments.empty())
m_ptr_increments.resize(io_size, 0);
if (m_finalization_offsets.empty())
m_finalization_offsets.resize(io_size, 0);
}
bool LoopEndStatic::visit_attributes(AttributeVisitor &visitor) {
visitor.on_attribute("work_amount", m_work_amount);
visitor.on_attribute("ptr_incr", m_ptr_increments);
visitor.on_attribute("fin_offset", m_finalization_offsets);
visitor.on_attribute("evaluate_once", m_evaluate_once);
return LoopEnd::visit_attributes(visitor);
}
const std::vector<int64_t>& LoopEndStatic::get_finalization_offsets() const {
return m_finalization_offsets;
}
const std::vector<int64_t>& LoopEndStatic::get_ptr_increments() const {
return m_ptr_increments;
}
size_t LoopEndStatic::get_work_amount() const {
return m_work_amount;
}
bool LoopEndStatic::get_evaluate_once() const {
return m_evaluate_once;
}
void LoopEndStatic::set_finalization_offsets(std::vector<int64_t> offsets) {
OPENVINO_ASSERT(offsets.size() == m_input_num + m_output_num,
"LoopEnd set_finalization_offsets is called with inconsistent offsets.size()");
m_finalization_offsets = std::move(offsets);
}
void LoopEndStatic::set_ptr_increments(std::vector<int64_t> new_ptr_increments) {
OPENVINO_ASSERT(new_ptr_increments.size() == m_input_num + m_output_num,
"LoopEnd set_ptr_increments is called with inconsistent new_ptr_increments.size()");
m_ptr_increments = std::move(new_ptr_increments);
}
void LoopEndStatic::update_ptr_increments(int64_t new_increment) {
std::transform(m_ptr_increments.begin(), m_ptr_increments.end(), m_ptr_increments.begin(),
[new_increment](int64_t old_increment){
return old_increment != 0 ? new_increment : 0;
});
}
void LoopEndStatic::set_work_amount(size_t new_work_amount) {
m_work_amount = new_work_amount;
}
void LoopEndStatic::set_evaluate_once(bool once) {
m_evaluate_once = once;
}
LoopEndDynamic::LoopEndDynamic(const Output<Node>& loop_begin, size_t work_amount_increment, std::vector<bool> is_incremented,
std::vector<int64_t> element_type_sizes, size_t input_num, size_t output_num, size_t id)
: LoopEnd(loop_begin, work_amount_increment, std::move(is_incremented), std::move(element_type_sizes), input_num, output_num, id) {}
std::shared_ptr<Node> LoopEndDynamic::clone_with_new_inputs(const OutputVector& inputs) const {
check_new_args_count(this, inputs);
return std::make_shared<LoopEndDynamic>(inputs.at(0), m_work_amount_increment, m_is_incremented, m_element_type_sizes, m_input_num, m_output_num, m_id);
}
} // namespace op
} // namespace snippets
} // namespace ov

View File

@ -229,8 +229,11 @@ auto get_num_result_children(const std::shared_ptr<const Node> &node) -> size_t
} // namespace
const std::set<ov::element::Type>& ov::snippets::pass::TokenizeSnippets::get_supported_element_types() {
static const std::set<ov::element::Type> supported_element_types =
{ ov::element::f32, ov::element::bf16, ov::element::i8, ov::element::u8 };
static const std::set<ov::element::Type> supported_element_types = {ov::element::f32,
ov::element::bf16,
ov::element::f16,
ov::element::i8,
ov::element::u8};
return supported_element_types;
}

View File

@ -70,7 +70,8 @@ ov::snippets::pass::FakeQuantizeDecomposition::FakeQuantizeDecomposition() {
return val == 0.f;
})) ||
out_scales.size() != 0));
const bool do_rounding = do_dequantize || fake_quantize_node->get_output_element_type(0) == ov::element::f32;
const bool do_rounding = do_dequantize || fake_quantize_node->get_output_element_type(0) == ov::element::f32 ||
fake_quantize_node->get_output_element_type(0) == ov::element::f16;
ov::NodeVector decomp_ops;
if (input_type != input_low.get_element_type()) {
@ -92,16 +93,18 @@ ov::snippets::pass::FakeQuantizeDecomposition::FakeQuantizeDecomposition() {
ov::PartialShape::broadcast_merge_into(scale_shape,
input_high.get_partial_shape(),
broadcast_type);
const auto scales =
std::make_shared<ov::op::v0::Constant>(ov::element::f32, scale_shape.get_shape(), out_scales);
const auto scales = std::make_shared<ov::op::v0::Constant>(input_low.get_element_type(),
scale_shape.get_shape(),
out_scales);
decomp_ops.push_back(scales);
result = std::make_shared<ov::op::v1::Multiply>(min, scales);
decomp_ops.push_back(result);
} else {
// (levels-1)
const auto levels_minus_one =
std::make_shared<ov::op::v0::Constant>(input_type, Shape{}, fake_quantize_node->get_levels() - 1);
const auto levels_minus_one = std::make_shared<ov::op::v0::Constant>(input_low.get_element_type(),
Shape{},
fake_quantize_node->get_levels() - 1);
decomp_ops.push_back(levels_minus_one);
// (input_high - input_low)
const auto subInHighLow = std::make_shared<ov::op::v1::Subtract>(input_high, input_low);
@ -129,8 +132,9 @@ ov::snippets::pass::FakeQuantizeDecomposition::FakeQuantizeDecomposition() {
if (do_dequantize) {
// (levels-1)
const auto levels_minus_one =
std::make_shared<ov::op::v0::Constant>(input_type, Shape{}, fake_quantize_node->get_levels() - 1);
const auto levels_minus_one = std::make_shared<ov::op::v0::Constant>(output_high.get_element_type(),
Shape{},
fake_quantize_node->get_levels() - 1);
// (output_high - output_low)
const auto sub_out_high_low = std::make_shared<ov::op::v1::Subtract>(output_high, output_low);
// (output_high - output_low) / (levels-1)

View File

@ -38,6 +38,7 @@ GNDecomposition::GNDecomposition() {
// reshape [N, C, spatial] to [N, group, 1, (C / group) * spatial]
const auto orig_shape = group_norm_node->get_input_partial_shape(0).to_shape();
size_t orig_rank = orig_shape.size();
OPENVINO_ASSERT(orig_rank >= 2, "First input rank for group normalization op should be greater than 1");
size_t group_rank = 4;
size_t c_in_group = orig_shape[1] / num_groups;
size_t spatial_dim = 1;

View File

@ -20,7 +20,8 @@ ov::snippets::pass::TokenizeGNSnippets::TokenizeGNSnippets() {
ov::matcher_pass_callback callback = [=](ov::pass::pattern::Matcher& m) {
OV_ITT_SCOPED_TASK(ov::pass::itt::domains::SnippetsTransform, "Snippets::pass::TokenizeGNSnippets")
auto group_norm_node = ov::as_type_ptr<ov::op::v12::GroupNormalization>(m.get_match_root());
if (group_norm_node->is_dynamic() || group_norm_node->get_element_type() != element::f32)
if (group_norm_node->is_dynamic() || group_norm_node->get_element_type() != element::f32 ||
GetSnippetsNodeType(group_norm_node) == SnippetsNodeType::SkippedByPlugin)
return false;
auto subgraph = op::Subgraph::wrap_node_as_subgraph(group_norm_node);

View File

@ -47,12 +47,10 @@ const IShapeInferSnippetsFactory::TRegistry IShapeInferSnippetsFactory::registry
SHAPE_INFER_PREDEFINED(op::HorizonMax, HorizonOpShapeInfer),
SHAPE_INFER_PREDEFINED(op::HorizonSum, HorizonOpShapeInfer),
//
SHAPE_INFER_PREDEFINED(op::LoopBeginStatic, SingleElementShapeInfer),
SHAPE_INFER_PREDEFINED(op::LoopBeginDynamic, SingleElementShapeInfer),
SHAPE_INFER_PREDEFINED(op::LoopBegin, SingleElementShapeInfer),
SHAPE_INFER_PREDEFINED(op::Scalar, SingleElementShapeInfer),
SHAPE_INFER_PREDEFINED(op::VectorBuffer, SingleElementShapeInfer),
SHAPE_INFER_PREDEFINED(op::LoopEndStatic, EmptyShapeInfer),
SHAPE_INFER_PREDEFINED(op::LoopEndDynamic, EmptyShapeInfer),
SHAPE_INFER_PREDEFINED(op::LoopEnd, EmptyShapeInfer),
#ifdef SNIPPETS_DEBUG_CAPS
SHAPE_INFER_PREDEFINED(op::PerfCountBegin, EmptyShapeInfer),
SHAPE_INFER_PREDEFINED(op::PerfCountEnd, EmptyShapeInfer),

View File

@ -0,0 +1,33 @@
// Copyright (C) 2024 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include "lowering_utils.hpp"
#include "subgraph_group_normalization.hpp"
/* The main purpose is to test that GNDecomposition properly decomposes groupNormalization operation
*/
namespace ov {
namespace test {
namespace snippets {
typedef std::tuple<
PartialShape, // Input 0 Shape
size_t, // numGroup
float // epsilon
> GroupNormalizationParams;
class GNDecompositionTest : public LoweringTests, public testing::WithParamInterface<GroupNormalizationParams> {
public:
static std::string getTestCaseName(testing::TestParamInfo<GroupNormalizationParams> obj);
protected:
void SetUp() override;
std::shared_ptr<SnippetsFunctionBase> snippets_model;
};
} // namespace snippets
} // namespace test
} // namespace ov

Some files were not shown because too many files have changed in this diff Show More