Skip to content

Commit e9efc76

Browse files
ravi9mostafafaheemzhaixuejun1993
authored andcommitted
openvino: Update to OV 2026.2.1, self-contained release packages, operator improvements (ggml-org#24974)
* Update to OV 2026.2.1, Make OV release packages self-contained * Update to OV 2026.2.1, Make OV release packages self-contained * OpenVINO Backend: Remove compute_op_type hardcoded sets (ggml-org#222) * OpenVINO Backend: Remove compute_op_type hardcoded sets * revert get_op_type removal * OpenVINO backend: enable softmax with sink input * OpenVINO backend: opt mul_mat_id convert process for large size * OpenVINO backend: Modify add_id to support 2D/4D * OpenVINO Backend: Add glu_swiglu_oai * PR review: fix paths * PR review: fix path consistency --------- Co-authored-by: Mostafa <mostafas.main.email@gmail.com> Co-authored-by: Xuejun <Xuejun.Zhai@intel.com>
1 parent 911dabc commit e9efc76

13 files changed

Lines changed: 316 additions & 111 deletions

File tree

.devops/openvino.Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
ARG OPENVINO_VERSION_MAJOR=2026.2
2-
ARG OPENVINO_VERSION_FULL=2026.2.0.21903.52ddc073857
1+
ARG OPENVINO_VERSION_MAJOR=2026.2.1
2+
ARG OPENVINO_VERSION_FULL=2026.2.1.21919.ede283a88e3
33
ARG UBUNTU_VERSION=24.04
44

55
# Intel GPU driver versions. https://github.com/intel/compute-runtime/releases
6-
ARG IGC_VERSION=v2.34.4
7-
ARG IGC_VERSION_FULL=2_2.34.4+21428
8-
ARG COMPUTE_RUNTIME_VERSION=26.18.38308.1
9-
ARG COMPUTE_RUNTIME_VERSION_FULL=26.18.38308.1-0
6+
ARG IGC_VERSION=v2.36.3
7+
ARG IGC_VERSION_FULL=2_2.36.3+21719
8+
ARG COMPUTE_RUNTIME_VERSION=26.22.38646.4
9+
ARG COMPUTE_RUNTIME_VERSION_FULL=26.22.38646.4-0
1010
ARG IGDGMM_VERSION=22.10.0
1111

1212
# Intel NPU driver versions. https://github.com/intel/linux-npu-driver/releases

.github/workflows/build-cache.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ jobs:
6868

6969
env:
7070
# Sync versions in build.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
71-
OPENVINO_VERSION_MAJOR: "2026.2"
72-
OPENVINO_VERSION_FULL: "2026.2.0.21903.52ddc073857"
71+
OPENVINO_VERSION_MAJOR: "2026.2.1"
72+
OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
7373

7474
steps:
7575
- name: Clone
@@ -96,8 +96,8 @@ jobs:
9696

9797
env:
9898
# Sync versions in build.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
99-
OPENVINO_VERSION_MAJOR: "2026.2"
100-
OPENVINO_VERSION_FULL: "2026.2.0.21903.52ddc073857"
99+
OPENVINO_VERSION_MAJOR: "2026.2.1"
100+
OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
101101

102102
steps:
103103
- name: Clone

.github/workflows/build-openvino.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939

4040
env:
4141
# Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
42-
OPENVINO_VERSION_MAJOR: "2026.2"
43-
OPENVINO_VERSION_FULL: "2026.2.0.21903.52ddc073857"
42+
OPENVINO_VERSION_MAJOR: "2026.2.1"
43+
OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
4444

4545
steps:
4646
- name: Clone
@@ -96,8 +96,8 @@ jobs:
9696

9797
env:
9898
# Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
99-
OPENVINO_VERSION_MAJOR: "2026.2"
100-
OPENVINO_VERSION_FULL: "2026.2.0.21903.52ddc073857"
99+
OPENVINO_VERSION_MAJOR: "2026.2.1"
100+
OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
101101

102102
steps:
103103
- name: Clone

.github/workflows/build-self-hosted.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ jobs:
266266

267267
env:
268268
# Sync versions in build.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
269-
OPENVINO_VERSION_MAJOR: "2026.2"
270-
OPENVINO_VERSION_FULL: "2026.2.0.21903.52ddc073857"
269+
OPENVINO_VERSION_MAJOR: "2026.2.1"
270+
OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
271271

272272
steps:
273273
- name: Clone

.github/workflows/release.yml

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,8 @@ jobs:
446446

447447
env:
448448
# Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
449-
OPENVINO_VERSION_MAJOR: "2026.2"
450-
OPENVINO_VERSION_FULL: "2026.2.0.21903.52ddc073857"
449+
OPENVINO_VERSION_MAJOR: "2026.2.1"
450+
OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
451451

452452
steps:
453453
- name: Set OpenVINO version output
@@ -506,8 +506,11 @@ jobs:
506506
cmake -B build/ReleaseOV -G Ninja \
507507
-DCMAKE_BUILD_TYPE=Release \
508508
-DGGML_OPENVINO=ON \
509-
-DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }}
510-
cmake --build build/ReleaseOV --config Release -j $(nproc)
509+
-DCMAKE_INSTALL_RPATH='$ORIGIN' \
510+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
511+
-DHF_UI_VERSION=${{ needs.get-version.outputs.ui_version }} \
512+
${{ env.CMAKE_ARGS }}
513+
cmake --build build/ReleaseOV --config Release --parallel
511514
512515
- name: ccache-clear
513516
uses: ./.github/actions/ccache-clear
@@ -521,8 +524,26 @@ jobs:
521524
- name: Pack artifacts
522525
id: pack_artifacts
523526
run: |
524-
cp LICENSE ./build/ReleaseOV/bin/
525-
tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/ReleaseOV/bin .
527+
dest=./build/ReleaseOV/bin
528+
OPENVINO_ROOT=./openvino_toolkit
529+
ov_lib="$OPENVINO_ROOT/runtime/lib/intel64"
530+
531+
# Bundle OpenVINO runtime libs + TBB. Binaries built with RPATH=$ORIGIN
532+
# load these siblings without setupvars.sh / LD_LIBRARY_PATH.
533+
cp -P "$ov_lib"/libopenvino.so* \
534+
"$ov_lib"/libopenvino_c.so* \
535+
"$ov_lib"/libopenvino_*_plugin.so \
536+
"$ov_lib"/libopenvino_intel_npu_compiler*.so \
537+
"$OPENVINO_ROOT"/runtime/3rdparty/tbb/lib/*.so* \
538+
"$dest"
539+
cp -P /usr/lib/x86_64-linux-gnu/libOpenCL.so.1* "$dest" 2>/dev/null || true
540+
cp "$ov_lib"/cache.json "$dest" 2>/dev/null || true
541+
542+
# OpenVINO licensing
543+
cp -r "$OPENVINO_ROOT"/docs/licensing "$dest"/openvino-licensing
544+
545+
cp LICENSE "$dest"
546+
tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C "$dest" .
526547
527548
- name: Upload artifacts
528549
uses: actions/upload-artifact@v6
@@ -538,8 +559,8 @@ jobs:
538559

539560
env:
540561
# Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile
541-
OPENVINO_VERSION_MAJOR: "2026.2"
542-
OPENVINO_VERSION_FULL: "2026.2.0.21903.52ddc073857"
562+
OPENVINO_VERSION_MAJOR: "2026.2.1"
563+
OPENVINO_VERSION_FULL: "2026.2.1.21919.ede283a88e3"
543564

544565
steps:
545566
- name: Set OpenVINO version output
@@ -607,7 +628,9 @@ jobs:
607628
-A x64 ^
608629
-DCMAKE_BUILD_TYPE=Release ^
609630
-DGGML_OPENVINO=ON ^
610-
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
631+
-DLLAMA_BUILD_BORINGSSL=ON ^
632+
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ^
633+
${{ env.CMAKE_ARGS }}
611634
612635
cmake --build build\ReleaseOV --config Release -- /m
613636
@@ -624,8 +647,29 @@ jobs:
624647
id: pack_artifacts
625648
shell: powershell
626649
run: |
627-
Copy-Item LICENSE .\build\ReleaseOV\bin\
628-
7z a -snl llama-${{ steps.tag.outputs.name }}-bin-win-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.zip .\build\ReleaseOV\bin\*
650+
# Locate the extracted OpenVINO toolkit root (same pattern as the Build step).
651+
$OPENVINO_ROOT = (Get-ChildItem -Directory openvino_toolkit | Select-Object -First 1).FullName
652+
if (-not $OPENVINO_ROOT) {
653+
Write-Error "OpenVINO toolkit folder not found under .\openvino_toolkit"
654+
exit 1
655+
}
656+
657+
$dest = ".\build\ReleaseOV\bin\Release"
658+
659+
$ovBin = Join-Path $OPENVINO_ROOT 'runtime\bin\intel64\Release'
660+
Copy-Item -Path (Join-Path $ovBin '*.dll') -Destination $dest -Force
661+
Copy-Item -Path (Join-Path $ovBin 'cache.json') -Destination $dest -Force
662+
663+
$tbbBin = Join-Path $OPENVINO_ROOT 'runtime\3rdparty\tbb\bin'
664+
Copy-Item -Path (Join-Path $tbbBin 'tbb*.dll') -Destination $dest -Force
665+
666+
# OpenVINO licensing
667+
$licensingDest = Join-Path $dest 'openvino-licensing'
668+
New-Item -ItemType Directory -Force -Path $licensingDest | Out-Null
669+
Copy-Item -Path (Join-Path $OPENVINO_ROOT 'docs\licensing\*') -Destination $licensingDest -Recurse -Force
670+
671+
Copy-Item LICENSE $dest
672+
7z a -snl llama-${{ steps.tag.outputs.name }}-bin-win-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.zip $dest\*
629673
630674
- name: Upload artifacts
631675
uses: actions/upload-artifact@v6

docs/backend/OPENVINO.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ chmod +x ubuntu-llamacpp-ov-install.sh
237237
# ============================================
238238
set -euo pipefail
239239
240-
OPENVINO_VERSION_MAJOR="2026.2"
241-
OPENVINO_VERSION_FULL="2026.2.0.21903.52ddc073857"
240+
OPENVINO_VERSION_MAJOR="2026.2.1"
241+
OPENVINO_VERSION_FULL="2026.2.1.21919.ede283a88e3"
242242
243243
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
244244
OPENVINO_INSTALL_DIR="/opt/intel/openvino_${OPENVINO_VERSION_MAJOR}"
@@ -334,7 +334,7 @@ echo " ./build/ReleaseOV/bin/llama-cli -m model.gguf"
334334
```
335335

336336
> [!NOTE]
337-
> The script pins OpenVINO `2026.2` via the `OPENVINO_VERSION_MAJOR` / `OPENVINO_VERSION_FULL` variables at the top — edit them to track a different release.
337+
> The script pins OpenVINO `2026.2.1` via the `OPENVINO_VERSION_MAJOR` / `OPENVINO_VERSION_FULL` variables at the top — edit them to track a different release.
338338

339339
</details>
340340

@@ -364,8 +364,8 @@ REM ============================================
364364
REM llama.cpp OpenVINO Build Script (Ninja)
365365
REM ============================================
366366
367-
set "OPENVINO_VERSION_MAJOR=2026.2"
368-
set "OPENVINO_VERSION_FULL=2026.2.0.21903.52ddc073857"
367+
set "OPENVINO_VERSION_MAJOR=2026.2.1"
368+
set "OPENVINO_VERSION_FULL=2026.2.1.21919.ede283a88e3"
369369
370370
set "SCRIPT_DIR=%~dp0"
371371
set "VCPKG_DIR=C:\vcpkg"
@@ -547,7 +547,7 @@ endlocal
547547
```
548548
549549
> [!NOTE]
550-
> The script pins OpenVINO `2026.2` via the `OPENVINO_VERSION_MAJOR` / `OPENVINO_VERSION_FULL` variables at the top — edit them to track a different release. From any new shell, source the matching `setupvars` script via the junction — `call "C:\Intel\openvino\setupvars.bat"` from `cmd`, or `& "C:\Intel\openvino\setupvars.ps1"` from PowerShell. If `winget` cannot register Visual Studio Build Tools on first run, install them once manually and re-run the script from an elevated **Developer Command Prompt for VS 2022**.
550+
> The script pins OpenVINO `2026.2.1` via the `OPENVINO_VERSION_MAJOR` / `OPENVINO_VERSION_FULL` variables at the top — edit them to track a different release. From any new shell, source the matching `setupvars` script via the junction — `call "C:\Intel\openvino\setupvars.bat"` from `cmd`, or `& "C:\Intel\openvino\setupvars.ps1"` from PowerShell. If `winget` cannot register Visual Studio Build Tools on first run, install them once manually and re-run the script from an elevated **Developer Command Prompt for VS 2022**.
551551
552552
</details>
553553

ggml/src/ggml-openvino/ggml-decoder.cpp

Lines changed: 3 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,77 +1270,14 @@ void GgmlOvDecoder::visit_subgraph(std::function<void(std::shared_ptr<GgmlDecode
12701270
}
12711271

12721272
std::string GgmlOvDecoder::compute_op_type(const ggml_tensor * node) {
1273-
static const std::map<ggml_op, std::string> ops = {
1274-
{GGML_OP_NONE, "GGML_OP_NONE" },
1275-
{GGML_OP_ACC, "GGML_OP_ACC" },
1276-
{GGML_OP_ADD, "GGML_OP_ADD" },
1277-
{GGML_OP_ADD1, "GGML_OP_ADD1" },
1278-
{GGML_OP_ADD_ID, "GGML_OP_ADD_ID" },
1279-
{GGML_OP_CONCAT, "GGML_OP_CONCAT" },
1280-
{GGML_OP_CONT, "GGML_OP_CONT" },
1281-
{GGML_OP_DIV, "GGML_OP_DIV" },
1282-
{GGML_OP_DUP, "GGML_OP_DUP" },
1283-
{GGML_OP_GET_ROWS, "GGML_OP_GET_ROWS" },
1284-
{GGML_OP_MUL, "GGML_OP_MUL" },
1285-
{GGML_OP_MUL_MAT, "GGML_OP_MUL_MAT" },
1286-
{GGML_OP_MUL_MAT_ID, "GGML_OP_MUL_MAT_ID" },
1287-
{GGML_OP_PERMUTE, "GGML_OP_PERMUTE" },
1288-
{GGML_OP_RESHAPE, "GGML_OP_RESHAPE" },
1289-
{GGML_OP_RMS_NORM, "GGML_OP_RMS_NORM" },
1290-
{GGML_OP_NORM, "GGML_OP_NORM" },
1291-
{GGML_OP_ROPE, "GGML_OP_ROPE" },
1292-
{GGML_OP_SCALE, "GGML_OP_SCALE" },
1293-
{GGML_OP_SOFT_MAX, "GGML_OP_SOFT_MAX" },
1294-
{GGML_OP_SUM_ROWS, "GGML_OP_SUM_ROWS" },
1295-
{GGML_OP_SUB, "GGML_OP_SUB" },
1296-
{GGML_OP_TRANSPOSE, "GGML_OP_TRANSPOSE" },
1297-
{GGML_OP_VIEW, "GGML_OP_VIEW" },
1298-
{GGML_OP_SET_ROWS, "GGML_OP_SET_ROWS" },
1299-
{GGML_OP_CPY, "GGML_OP_CPY" },
1300-
{GGML_OP_FLASH_ATTN_EXT, "GGML_OP_FLASH_ATTN_EXT" },
1301-
{GGML_OP_L2_NORM, "GGML_OP_L2_NORM" },
1302-
{GGML_OP_CLAMP, "GGML_OP_CLAMP" },
1303-
{GGML_OP_PAD, "GGML_OP_PAD" },
1304-
{GGML_OP_SSM_CONV, "GGML_OP_SSM_CONV" },
1305-
{GGML_OP_GATED_DELTA_NET, "GGML_OP_GATED_DELTA_NET"},
1306-
{GGML_OP_ARGSORT, "GGML_OP_ARGSORT" },
1307-
{GGML_OP_REPEAT, "GGML_OP_REPEAT" },
1308-
{GGML_OP_IM2COL, "GGML_OP_IM2COL" }
1309-
};
1310-
static const std::map<ggml_unary_op, std::string> unary_ops = {
1311-
{GGML_UNARY_OP_ABS, "GGML_UNARY_OP_ABS" },
1312-
{GGML_UNARY_OP_SGN, "GGML_UNARY_OP_SGN" },
1313-
{GGML_UNARY_OP_NEG, "GGML_UNARY_OP_NEG" },
1314-
{GGML_UNARY_OP_STEP, "GGML_UNARY_OP_STEP" },
1315-
{GGML_UNARY_OP_TANH, "GGML_UNARY_OP_TANH" },
1316-
{GGML_UNARY_OP_ELU, "GGML_UNARY_OP_ELU" },
1317-
{GGML_UNARY_OP_RELU, "GGML_UNARY_OP_RELU" },
1318-
{GGML_UNARY_OP_SIGMOID, "GGML_UNARY_OP_SIGMOID" },
1319-
{GGML_UNARY_OP_GELU, "GGML_UNARY_OP_GELU" },
1320-
{GGML_UNARY_OP_GELU_QUICK, "GGML_UNARY_OP_GELU_QUICK" },
1321-
{GGML_UNARY_OP_SILU, "GGML_UNARY_OP_SILU" },
1322-
{GGML_UNARY_OP_SOFTPLUS, "GGML_UNARY_OP_SOFTPLUS" },
1323-
{GGML_UNARY_OP_HARDSWISH, "GGML_UNARY_OP_HARDSWISH" },
1324-
{GGML_UNARY_OP_HARDSIGMOID, "GGML_UNARY_OP_HARDSIGMOID"},
1325-
{GGML_UNARY_OP_EXP, "GGML_UNARY_OP_EXP" },
1326-
{GGML_UNARY_OP_COUNT, "GGML_UNARY_OP_COUNT" }
1327-
};
1328-
static const std::map<ggml_glu_op, std::string> glu_ops = {
1329-
{GGML_GLU_OP_SWIGLU, "GGML_GLU_OP_SWIGLU"},
1330-
{GGML_GLU_OP_GEGLU, "GGML_GLU_OP_GEGLU" },
1331-
{GGML_GLU_OP_REGLU, "GGML_GLU_OP_REGLU" }
1332-
};
1333-
13341273
switch (node->op) {
13351274
case GGML_OP_UNARY:
1336-
return unary_ops.at(ggml_get_unary_op(node));
1275+
return std::string("GGML_UNARY_OP_") + ggml_unary_op_name(ggml_get_unary_op(node));
13371276
case GGML_OP_GLU:
1338-
return glu_ops.at(ggml_get_glu_op(node));
1277+
return std::string("GGML_GLU_OP_") + ggml_glu_op_name(ggml_get_glu_op(node));
13391278
default:
1340-
return ops.at(node->op);
1279+
return std::string("GGML_OP_") + ggml_op_name(node->op);
13411280
}
1342-
static const std::string unknown_op = "UNKNOWN_GGML_OP";
1343-
return unknown_op;
13441281
}
13451282

13461283
const std::string & GgmlOvDecoder::get_op_type(int node_idx) const {

ggml/src/ggml-openvino/openvino/op/add_id.cpp

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,22 @@ namespace frontend {
1717
namespace ggml {
1818
namespace op {
1919

20+
static ov::Output<ov::Node> reshape_add_id_input_to_2d(const ov::Output<ov::Node> & input,
21+
const ov::PartialShape & input_shape,
22+
const std::vector<int> & dims) {
23+
const auto actual_shape = input.get_partial_shape();
24+
if (actual_shape.rank().is_static() && actual_shape.rank().get_length() == 2) {
25+
return input;
26+
}
27+
28+
if (input_shape.rank().is_static() && input_shape.rank().get_length() == 2) {
29+
return input;
30+
}
31+
32+
auto shape = std::make_shared<ov::op::v3::ShapeOf>(input, ov::element::i64);
33+
return std::make_shared<ov::op::v1::Reshape>(input, get_dimensions(shape, dims), false);
34+
}
35+
2036
OutputVector translate_add_id(const NodeContext & context) {
2137
num_inputs_check(context, 3, 3);
2238

@@ -28,11 +44,9 @@ OutputVector translate_add_id(const NodeContext & context) {
2844
// input: [1, n_token, n_used, n_embd]
2945
// bias: [1, 1, n_expert, n_embd]
3046
// ids: [1, 1, n_token, n_used]
31-
auto bias_shape_4d = std::make_shared<ov::op::v3::ShapeOf>(bias, ov::element::i64);
32-
auto ids_shape_4d = std::make_shared<ov::op::v3::ShapeOf>(ids, ov::element::i64);
33-
34-
bias = std::make_shared<ov::op::v1::Reshape>(bias, get_dimensions(bias_shape_4d, {2, 3}), false);
35-
ids = std::make_shared<ov::op::v1::Reshape>(ids, get_dimensions(ids_shape_4d, {2, 3}), false);
47+
// Model bias constants may already be stored as [n_expert, n_embd].
48+
bias = reshape_add_id_input_to_2d(bias, context.get_input_shape(1), {2, 3});
49+
ids = reshape_add_id_input_to_2d(ids, context.get_input_shape(2), {2, 3});
3650

3751
if (ids.get_element_type() != ov::element::i32 && ids.get_element_type() != ov::element::i64) {
3852
ids = std::make_shared<ov::op::v0::Convert>(ids, ov::element::i32);

0 commit comments

Comments
 (0)