Skip to content

Commit

Permalink
Merge branch 'master' into yi3/4bit-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangYiIntel authored Dec 19, 2024
2 parents 99d5c4d + 2f4c730 commit dddb4d9
Show file tree
Hide file tree
Showing 52 changed files with 2,419 additions and 1,267 deletions.
5 changes: 1 addition & 4 deletions .github/actions/setup_python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ inputs:
runs:
using: 'composite'
steps:

- name: Check if Python is already installed (Linux)
if: ${{ runner.os == 'Linux' }}
shell: bash
Expand Down Expand Up @@ -54,13 +53,11 @@ runs:
with:
python-version: ${{ inputs.version }}

- if: ${{ runner.os == 'macOS' || runner.os == 'Windows' || (runner.os == 'Linux' && runner.arch != 'ARM64' && steps.check_python.outputs.installed == 'false' ) }}
- 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@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ inputs.version }}
env:
PIP_CACHE_DIR: ${{ inputs.self-hosted-runner == 'true' && inputs.pip-cache-path || '' }}

- if: ${{ inputs.should-setup-pip-paths == 'true' && runner.os != 'Windows' }}
name: Setup pip variables (cache and install path)
Expand Down
4 changes: 4 additions & 0 deletions .github/scripts/workflow_rerun/errors_to_look_for.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,9 @@
{
"error_text": "Upload progress stalled",
"ticket": 152933
},
{
"error_text": "because the GET request got Content-Type",
"ticket": 158400
}
]
14 changes: 11 additions & 3 deletions .github/workflows/job_build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,20 @@ jobs:
$pythonCommand = "py -$pyVersion -c `"import sys; print(f'{sys.executable}')`""
$pythonExecutablePath = & cmd /c $pythonCommand
$pipVersion = & $pythonExecutablePath -c "import pip; print(pip.__version__)"
Write-Host "Using pip version: $pipVersion for $pyVersion"
$env:PIP_CACHE_DIR="${{ env.PIP_CACHE_PATH }}/$pipVersion"
& $pythonExecutablePath -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt
cmake -DPython3_EXECUTABLE="$pythonExecutablePath" -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B "$pyBuildDir"
cmake --build "$pyBuildDir" --parallel --config ${{ env.CMAKE_BUILD_TYPE }}
cmake -DPython3_EXECUTABLE="$pythonExecutablePath" -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B "$pyBuildDir" &&
cmake --build "$pyBuildDir" --parallel --config ${{ env.CMAKE_BUILD_TYPE }} &&
cmake --install "$pyBuildDir" --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_WHEELS_DIR }} --component python_wheels
if ($LASTEXITCODE -ne 0) {
Write-Host "Failed to build Python wheels for Python $pyVersion"
exit 1
}
}
- name: Pack Artifacts
Expand Down
3 changes: 3 additions & 0 deletions docs/articles_en/about-openvino/release-notes-openvino.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,9 @@ Deprecated and to be removed in the future
* “auto shape” and “auto batch size” (reshaping a model in runtime) will be removed in the
future. OpenVINO's dynamic shape models are recommended instead.

* Starting with 2025.0 MacOS x86 will no longer be recommended for use due to the discontinuation
of validation. Full support will be removed later in 2025.

* A number of notebooks have been deprecated. For an up-to-date listing of available notebooks,
refer to the `OpenVINO™ Notebook index (openvinotoolkit.github.io) <https://openvinotoolkit.github.io/openvino_notebooks/>`__.

Expand Down
38 changes: 37 additions & 1 deletion docs/articles_en/assets/snippets/ov_caching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,50 @@ auto compiled = core.compile_model(model, device, config); // Step 5:
}
}

void part5() {
std::string modelPath = "/tmp/myModel.xml";
std::string device = "GPU";
ov::Core core; // Step 1: create ov::Core object
bool hasGPU = false; // Step 1a: Check if GPU is available
auto devices = core.get_available_devices();
for (auto&& supported : devices) {
hasGPU |= supported.find(device) != std::string::npos;
}
if(!hasGPU) {
return;
}
core.set_property(ov::cache_dir("/path/to/cache/dir")); // Step 1b: Enable caching
//! [ov:caching:part5]
static const char codec_key[] = {0x30, 0x60, 0x70, 0x02, 0x04, 0x08, 0x3F, 0x6F, 0x72, 0x74, 0x78, 0x7F};
auto codec_xor = [&](const std::string& source_str) {
auto key_size = sizeof(codec_key);
int key_idx = 0;
std::string dst_str = source_str;
for (char& c : dst_str) {
c ^= codec_key[key_idx % key_size];
key_idx++;
}
return dst_str;
};
auto compiled = core.compile_model(modelPath,
device,
ov::cache_encryption_callbacks(ov::EncryptionCallbacks{codec_xor, codec_xor}),
ov::cache_mode(ov::CacheMode::OPTIMIZE_SIZE)); // Step 5: Compile model
//! [ov:caching:part5]
if (!compiled) {
throw std::runtime_error("error");
}
}

int main() {
try {
part0();
part1();
part2();
part3();
part4();
part5();
} catch (...) {
}
return 0;
}
}
18 changes: 18 additions & 0 deletions docs/articles_en/assets/snippets/ov_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,21 @@ def decrypt_base64(src):
model = core.read_model(model=model_path)
compiled_model = core.compile_model(model=model, device_name=device_name, config=config_cache)
# ! [ov:caching:part4]

# ! [ov:caching:part5]
import base64

def encrypt_base64(src):
return base64.b64encode(bytes(src, "utf-8"))

def decrypt_base64(src):
return base64.b64decode(bytes(src, "utf-8"))

core = ov.Core()
if "GPU" in core.available_devices:
core.set_property({props.cache_dir: path_to_cache_dir})
config_cache = {}
config_cache["CACHE_ENCRYPTION_CALLBACKS"] = [encrypt_base64, decrypt_base64]
config_cache["CACHE_MODE"] = "OPTIMIZE_SIZE"
compiled_model = core.compile_model(model=model_path, device_name='GPU', config=config_cache)
# ! [ov:caching:part5]
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Step 1: Download and Install the OpenVINO Core Components
cd <user_home>/Downloads
4. Download the `OpenVINO Runtime archive file for your system <https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/linux/>`_, extract the files, rename the extracted folder and move it to the desired path:
4. Download the `OpenVINO Runtime archive file for your system <https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/linux/>`_, extract the files, rename the extracted folder and move it to the desired path:

.. tab-set::

Expand All @@ -73,74 +73,74 @@ Step 1: Download and Install the OpenVINO Core Components
.. code-block:: sh
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/linux/l_openvino_toolkit_ubuntu24_2024.5.0.17288.7975fa5da0c_x86_64.tgz --output openvino_2024.5.0.tgz
tar -xf openvino_2024.5.0.tgz
sudo mv l_openvino_toolkit_ubuntu24_2024.5.0.17288.7975fa5da0c_x86_64 /opt/intel/openvino_2024.5.0
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/linux/l_openvino_toolkit_ubuntu24_2024.6.0.17404.4c0f47d2335_x86_64.tgz --output openvino_2024.6.0.tgz
tar -xf openvino_2024.6.0.tgz
sudo mv l_openvino_toolkit_ubuntu24_2024.6.0.17404.4c0f47d2335_x86_64 /opt/intel/openvino_2024.6.0
.. tab-item:: Ubuntu 22.04
:sync: ubuntu-22

.. code-block:: sh
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/linux/l_openvino_toolkit_ubuntu22_2024.5.0.17288.7975fa5da0c_x86_64.tgz --output openvino_2024.5.0.tgz
tar -xf openvino_2024.5.0.tgz
sudo mv l_openvino_toolkit_ubuntu22_2024.5.0.17288.7975fa5da0c_x86_64 /opt/intel/openvino_2024.5.0
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/linux/l_openvino_toolkit_ubuntu22_2024.6.0.17404.4c0f47d2335_x86_64.tgz --output openvino_2024.6.0.tgz
tar -xf openvino_2024.6.0.tgz
sudo mv l_openvino_toolkit_ubuntu22_2024.6.0.17404.4c0f47d2335_x86_64 /opt/intel/openvino_2024.6.0
.. tab-item:: Ubuntu 20.04
:sync: ubuntu-20

.. code-block:: sh
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/linux/l_openvino_toolkit_ubuntu20_2024.5.0.17288.7975fa5da0c_x86_64.tgz --output openvino_2024.5.0.tgz
tar -xf openvino_2024.5.0.tgz
sudo mv l_openvino_toolkit_ubuntu20_2024.5.0.17288.7975fa5da0c_x86_64 /opt/intel/openvino_2024.5.0
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/linux/l_openvino_toolkit_ubuntu20_2024.6.0.17404.4c0f47d2335_x86_64.tgz --output openvino_2024.6.0.tgz
tar -xf openvino_2024.6.0.tgz
sudo mv l_openvino_toolkit_ubuntu20_2024.6.0.17404.4c0f47d2335_x86_64 /opt/intel/openvino_2024.6.0
.. tab-item:: RHEL 8
:sync: rhel-8

.. code-block:: sh
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/linux/l_openvino_toolkit_rhel8_2024.5.0.17288.7975fa5da0c_x86_64.tgz --output openvino_2024.5.0.tgz
tar -xf openvino_2024.5.0.tgz
sudo mv l_openvino_toolkit_rhel8_2024.5.0.17288.7975fa5da0c_x86_64 /opt/intel/openvino_2024.5.0
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/linux/l_openvino_toolkit_rhel8_2024.6.0.17404.4c0f47d2335_x86_64.tgz --output openvino_2024.6.0.tgz
tar -xf openvino_2024.6.0.tgz
sudo mv l_openvino_toolkit_rhel8_2024.6.0.17404.4c0f47d2335_x86_64 /opt/intel/openvino_2024.6.0
.. tab-item:: CentOS 7
:sync: centos-7

.. code-block:: sh
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/linux/l_openvino_toolkit_centos7_2024.5.0.17288.7975fa5da0c_x86_64.tgz --output openvino_2024.5.0.tgz
tar -xf openvino_2024.5.0.tgz
sudo mv l_openvino_toolkit_centos7_2024.5.0.17288.7975fa5da0c_x86_64 /opt/intel/openvino_2024.5.0
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/linux/l_openvino_toolkit_centos7_2024.6.0.17404.4c0f47d2335_x86_64.tgz --output openvino_2024.6.0.tgz
tar -xf openvino_2024.6.0.tgz
sudo mv l_openvino_toolkit_centos7_2024.6.0.17404.4c0f47d2335_x86_64 /opt/intel/openvino_2024.6.0
.. tab-item:: ARM 64-bit
:sync: arm-64

.. code-block:: sh
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/linux/l_openvino_toolkit_ubuntu20_2024.5.0.17288.7975fa5da0c_arm64.tgz -O openvino_2024.5.0.tgz
tar -xf openvino_2024.5.0.tgz
sudo mv l_openvino_toolkit_ubuntu20_2024.5.0.17288.7975fa5da0c_arm64 /opt/intel/openvino_2024.5.0
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/linux/l_openvino_toolkit_ubuntu20_2024.6.0.17404.4c0f47d2335_arm64.tgz -O openvino_2024.6.0.tgz
tar -xf openvino_2024.6.0.tgz
sudo mv l_openvino_toolkit_ubuntu20_2024.6.0.17404.4c0f47d2335_arm64 /opt/intel/openvino_2024.6.0
.. tab-item:: ARM 32-bit
:sync: arm-32

.. code-block:: sh
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/linux/l_openvino_toolkit_debian10_2024.5.0.17288.7975fa5da0c_armhf.tgz -O openvino_2024.5.0.tgz
tar -xf openvino_2024.5.0.tgz
sudo mv l_openvino_toolkit_debian10_2024.5.0.17288.7975fa5da0c_armhf /opt/intel/openvino_2024.5.0
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/linux/l_openvino_toolkit_debian10_2024.6.0.17404.4c0f47d2335_armhf.tgz -O openvino_2024.6.0.tgz
tar -xf openvino_2024.6.0.tgz
sudo mv l_openvino_toolkit_debian10_2024.6.0.17404.4c0f47d2335_armhf /opt/intel/openvino_2024.6.0
5. Install required system dependencies on Linux. To do this, OpenVINO provides a script in the extracted installation directory. Run the following command:

.. code-block:: sh
cd /opt/intel/openvino_2024.5.0
cd /opt/intel/openvino_2024.6.0
sudo -E ./install_dependencies/install_openvino_dependencies.sh
6. (Optional) Install *numpy* Python Library:
Expand All @@ -149,11 +149,11 @@ Step 1: Download and Install the OpenVINO Core Components

This step is required only when you decide to use Python API.

You can use the ``requirements.txt`` file from the ``/opt/intel/openvino_2024.5.0/python`` folder:
You can use the ``requirements.txt`` file from the ``/opt/intel/openvino_2024.6.0/python`` folder:

.. code-block:: sh
cd /opt/intel/openvino_2024.5.0
cd /opt/intel/openvino_2024.6.0
python3 -m pip install -r ./python/requirements.txt
7. For simplicity, it is useful to create a symbolic link as below:
Expand All @@ -162,7 +162,7 @@ Step 1: Download and Install the OpenVINO Core Components
cd /opt/intel
sudo ln -s openvino_2024.5.0 openvino_2024
sudo ln -s openvino_2024.6.0 openvino_2024
.. note::
If you have already installed a previous release of OpenVINO 2024, a symbolic link to the ``openvino_2024`` folder may already exist.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Step 1: Install OpenVINO Core Components
cd <user_home>/Downloads
4. Download the `OpenVINO Runtime archive file for macOS <https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/macos/>`__, extract the files, rename the extracted folder and move it to the desired path:
4. Download the `OpenVINO Runtime archive file for macOS <https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/macos/>`__, extract the files, rename the extracted folder and move it to the desired path:

.. tab-set::

Expand All @@ -57,19 +57,19 @@ Step 1: Install OpenVINO Core Components
.. code-block:: sh
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/macos/m_openvino_toolkit_macos_12_6_2024.5.0.17288.7975fa5da0c_x86_64.tgz --output openvino_2024.5.0.tgz
tar -xf openvino_2024.5.0.tgz
sudo mv m_openvino_toolkit_macos_12_6_2024.5.0.17288.7975fa5da0c_x86_64 /opt/intel/openvino_2024.5.0
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/macos/m_openvino_toolkit_macos_12_6_2024.6.0.17404.4c0f47d2335_x86_64.tgz --output openvino_2024.6.0.tgz
tar -xf openvino_2024.6.0.tgz
sudo mv m_openvino_toolkit_macos_12_6_2024.6.0.17404.4c0f47d2335_x86_64 /opt/intel/openvino_2024.6.0
.. tab-item:: ARM, 64-bit
:sync: arm-64

.. code-block:: sh
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/macos/m_openvino_toolkit_macos_12_6_2024.5.0.17288.7975fa5da0c_arm64.tgz --output openvino_2024.5.0.tgz
tar -xf openvino_2024.5.0.tgz
sudo mv m_openvino_toolkit_macos_12_6_2024.5.0.17288.7975fa5da0c_arm64 /opt/intel/openvino_2024.5.0
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/macos/m_openvino_toolkit_macos_12_6_2024.6.0.17404.4c0f47d2335_arm64.tgz --output openvino_2024.6.0.tgz
tar -xf openvino_2024.6.0.tgz
sudo mv m_openvino_toolkit_macos_12_6_2024.6.0.17404.4c0f47d2335_arm64 /opt/intel/openvino_2024.6.0
5. (Optional) Install *numpy* Python Library:
Expand All @@ -78,19 +78,19 @@ Step 1: Install OpenVINO Core Components

This step is required only when you decide to use Python API.

You can use the ``requirements.txt`` file from the ``/opt/intel/openvino_2024.5.0/python`` folder:
You can use the ``requirements.txt`` file from the ``/opt/intel/openvino_2024.6.0/python`` folder:

.. code-block:: sh
cd /opt/intel/openvino_2024.5.0
cd /opt/intel/openvino_2024.6.0
python3 -m pip install -r ./python/requirements.txt
6. For simplicity, it is useful to create a symbolic link as below:

.. code-block:: sh
sudo ln -s /opt/intel/openvino_2024.5.0 /opt/intel/openvino_2024
sudo ln -s /opt/intel/openvino_2024.6.0 /opt/intel/openvino_2024
.. note::
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ Step 1: Download and Install OpenVINO Core Components
``C:\Program Files (x86)\Intel`` is the recommended folder. You may also use a different path if desired or if you don't have administrator privileges on your computer.


2. Download the `OpenVINO Runtime archive file for Windows <https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/windows/>`__ to your local ``Downloads`` folder.
2. Download the `OpenVINO Runtime archive file for Windows <https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/windows/>`__ to your local ``Downloads`` folder.

If you prefer using command-lines, run the following commands in the command prompt window you opened:

.. code-block:: sh
cd <user_home>/Downloads
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.5/windows/w_openvino_toolkit_windows_2024.5.0.17288.7975fa5da0c_x86_64.zip --output openvino_2024.5.0.zip
curl -L https://storage.openvinotoolkit.org/repositories/openvino/packages/2024.6/windows/w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64.zip --output openvino_2024.6.0.zip
.. note::

A ``.sha256`` file is provided together with the archive file to validate your download process. To do that, download the ``.sha256`` file from the same repository and run ``CertUtil -hashfile openvino_2024.5.0.zip SHA256``. Compare the returned value in the output with what's in the ``.sha256`` file: if the values are the same, you have downloaded the correct file successfully; if not, create a Support ticket `here <https://www.intel.com/content/www/us/en/support/contact-intel.html>`__.
A ``.sha256`` file is provided together with the archive file to validate your download process. To do that, download the ``.sha256`` file from the same repository and run ``CertUtil -hashfile openvino_2024.6.0.zip SHA256``. Compare the returned value in the output with what's in the ``.sha256`` file: if the values are the same, you have downloaded the correct file successfully; if not, create a Support ticket `here <https://www.intel.com/content/www/us/en/support/contact-intel.html>`__.


3. Use your favorite tool to extract the archive file, rename the extracted folder, and move it to the ``C:\Program Files (x86)\Intel`` directory.
Expand All @@ -61,9 +61,9 @@ Step 1: Download and Install OpenVINO Core Components

.. code-block:: sh
tar -xf openvino_2024.5.0.zip
ren w_openvino_toolkit_windows_2024.5.0.17288.7975fa5da0c_x86_64 openvino_2024.5.0
move openvino_2024.5.0 "C:\Program Files (x86)\Intel"
tar -xf openvino_2024.6.0.zip
ren w_openvino_toolkit_windows_2024.6.0.17404.4c0f47d2335_x86_64 openvino_2024.6.0
move openvino_2024.6.0 "C:\Program Files (x86)\Intel"
4. (Optional) Install *numpy* Python Library:
Expand All @@ -72,11 +72,11 @@ Step 1: Download and Install OpenVINO Core Components

This step is required only when you decide to use Python API.

You can use the ``requirements.txt`` file from the ``C:\Program Files (x86)\Intel\openvino_2024.5.0\python`` folder:
You can use the ``requirements.txt`` file from the ``C:\Program Files (x86)\Intel\openvino_2024.6.0\python`` folder:

.. code-block:: sh
cd "C:\Program Files (x86)\Intel\openvino_2024.5.0"
cd "C:\Program Files (x86)\Intel\openvino_2024.6.0"
python -m pip install -r .\python\requirements.txt
Expand All @@ -85,7 +85,7 @@ Step 1: Download and Install OpenVINO Core Components
.. code-block:: sh
cd C:\Program Files (x86)\Intel
mklink /D openvino_2024 openvino_2024.5.0
mklink /D openvino_2024 openvino_2024.6.0
.. note::
Expand Down
Loading

0 comments on commit dddb4d9

Please sign in to comment.