Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@
/.github/workflows/windows_consumer_qualification.yml @leehack
/tools/qualification/windows_consumer/ @leehack
/tests/test_windows_consumer_qualification.py @leehack
/.github/actions/openvino-sidecar-*/ @leehack
/.github/workflows/validate_linux_release_rows.yml @leehack
/cmake/openvino_tests.cmake @leehack
/docs/openvino_sidecar.md @leehack
/scripts/generate_assets_manifest.sh @leehack
/scripts/release_contract.py @leehack
/scripts/release_publication.py @leehack
/src/llama_dart_openvino* @leehack
/tools/openvino_sdk.py @leehack
/tools/package_openvino_sidecar.py @leehack
/tools/validate_openvino_sidecar.py @leehack
/.github/workflows/android_hexagon_candidate.yml @leehack
/tools/android_hexagon.py @leehack
/tools/build_android_hexagon_candidate.sh @leehack
Expand Down
40 changes: 40 additions & 0 deletions .github/actions/openvino-sidecar-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build the Linux x64 OpenVINO sidecar
description: Build, package and validate the sidecar against the pinned SDK
inputs:
tag:
description: Native release tag used in the archive name
required: true
outputs:
sdk:
description: Path to the extracted, verified SDK
value: ${{ steps.sdk.outputs.path }}
runs:
using: composite
steps:
- name: Install build dependencies
shell: bash
run: |
. tools/apt_retry.sh
apt_get_update
apt_get_install ninja-build ccache binutils
- name: Fetch the pinned OpenVINO SDK and OpenCL C++ headers
id: sdk
shell: bash
run: |
sdk="$(python3 tools/openvino_sdk.py --output "$RUNNER_TEMP/openvino-sdk" --with-opencl-headers)"
echo "path=$sdk" >> "$GITHUB_OUTPUT"
- name: Build and validate the owner sidecar
shell: bash
env:
SDK: ${{ steps.sdk.outputs.path }}
NATIVE_TAG: ${{ inputs.tag }}
run: |
time python3 tools/build.py linux --arch x64 --backend openvino --openvino-sdk "$SDK" --jobs "$(nproc)"
archive="openvino-payload/llamadart-native-linux-x64-openvino-$NATIVE_TAG.tar.gz"
directory=build/linux-x64-openvino/openvino-payload
python3 tools/package_openvino_sidecar.py \
--build-dir bin/linux/x64-openvino --sdk "$SDK" --directory "$directory" --output "$archive"
python3 tools/validate_openvino_sidecar.py "$directory" --sdk "$SDK"
stat --printf='%n %s bytes\n' "$directory"/libllamadart-openvino.so "$archive"
readelf -d "$directory/libllamadart-openvino.so"
python3 tools/check_glibc_floor.py "$directory"
24 changes: 24 additions & 0 deletions .github/actions/openvino-sidecar-pair/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test the packaged Linux x64 OpenVINO pair
description: Pair the release Vulkan core and independently built OpenVINO sidecar
runs:
using: composite
steps:
- name: Download the release Linux x64 Vulkan core
uses: actions/download-artifact@v8
with:
name: native_linux_x64_vulkan
path: openvino-pair-input/core
- name: Download the release OpenVINO sidecar
uses: actions/download-artifact@v8
with:
name: sidecar_linux_x64_openvino
path: openvino-pair-input/sidecar
- name: Validate and run the pair with origin and identity controls
shell: bash
run: |
sdk="$(python3 tools/openvino_sdk.py --output "$RUNNER_TEMP/openvino-sdk")"
shopt -s nullglob
sidecars=(openvino-pair-input/sidecar/*.tar.gz)
[ "${#sidecars[@]}" = 1 ]
python3 tests/run_openvino_contract.py --scratch "$RUNNER_TEMP/openvino-pair" --sdk "$sdk" \
--core-archive openvino-pair-input/core/runtime.tar.gz --sidecar-archive "${sidecars[0]}"
65 changes: 64 additions & 1 deletion .github/workflows/native_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,61 @@ jobs:
C:\vcpkg\installed
key: vcpkg-${{ runner.os }}-${{ matrix.vcpkg_triplet }}-${{ env.VCPKG_CACHE_VERSION }}

build-linux-openvino:
needs: [resolve-tag]
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Checkout llama.cpp ref
uses: ./.github/actions/checkout-llama-ref
with:
tag: ${{ needs.resolve-tag.outputs.llama_cpp_ref }}
expected_commit: ${{ needs.resolve-tag.outputs.llama_cpp_commit }}
github_token: ${{ github.token }}
- name: Checkout exact release source
uses: ./.github/actions/checkout-native-source
with:
native_commit: ${{ needs.resolve-tag.outputs.native_commit }}
llama_cpp_commit: ${{ needs.resolve-tag.outputs.llama_cpp_commit }}
- name: Build the pinned OpenVINO sidecar
uses: ./.github/actions/openvino-sidecar-build
with:
tag: ${{ needs.resolve-tag.outputs.release_tag }}
- name: Upload the OpenVINO sidecar
uses: actions/upload-artifact@v7
with:
name: sidecar_linux_x64_openvino
path: openvino-payload/*.tar.gz
if-no-files-found: error

openvino-sidecar-pair:
needs: [resolve-tag, build-linux, build-linux-openvino]
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Checkout llama.cpp ref
uses: ./.github/actions/checkout-llama-ref
with:
tag: ${{ needs.resolve-tag.outputs.llama_cpp_ref }}
expected_commit: ${{ needs.resolve-tag.outputs.llama_cpp_commit }}
github_token: ${{ github.token }}
- name: Checkout exact release source
uses: ./.github/actions/checkout-native-source
with:
native_commit: ${{ needs.resolve-tag.outputs.native_commit }}
llama_cpp_commit: ${{ needs.resolve-tag.outputs.llama_cpp_commit }}
- uses: ./.github/actions/openvino-sidecar-pair

smoke-release-contract:
needs: [resolve-tag, build-linux]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -1126,7 +1181,7 @@ jobs:
fi

package-and-release:
needs: [resolve-tag, build-android, build-apple, metal-os-floor, build-linux, build-linux-hip, build-windows, smoke-release-contract]
needs: [resolve-tag, build-android, build-apple, metal-os-floor, build-linux, build-linux-hip, build-windows, smoke-release-contract, openvino-sidecar-pair]
runs-on: macos-latest
outputs:
native_commit: ${{ needs.resolve-tag.outputs.native_commit }}
Expand Down Expand Up @@ -1207,6 +1262,13 @@ jobs:
fi
done

if [ -n "$(find bundles/linux-x64 -iname '*openvino*' -print -quit)" ]; then
echo "OpenVINO belongs in the sidecar, not in the Linux x64 core" >&2
exit 1
fi
openvino_archive="llamadart-native-linux-x64-openvino-${{ needs.resolve-tag.outputs.release_tag }}.tar.gz"
cp "artifacts/sidecar_linux_x64_openvino/$openvino_archive" "release_assets/$openvino_archive"

for bundle_dir in bundles/windows-*; do
[ -d "$bundle_dir" ] || continue
python3 tools/package_windows_runtime.py install --arch "${bundle_dir##*/windows-}" "$bundle_dir" artifacts
Expand Down Expand Up @@ -1258,6 +1320,7 @@ jobs:
tar -czf "release_assets/${HEADER_ARCHIVE}" -C headers_bundle libllamadart llama_cpp

for archive in release_assets/llamadart-native-linux-*.tar.gz; do
[ "${archive##*/}" != "$openvino_archive" ] || continue
python3 tools/validate_linux_artifact.py "$archive"
done

Expand Down
55 changes: 53 additions & 2 deletions .github/workflows/validate_linux_release_rows.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Validate Linux Release Rows

# native_release.yml's Linux jobs without their upload, because the release runs
# only when dispatched and #132 went unnoticed until one failed.
# Exercise the Linux release jobs on pull requests. Only the packaged OpenVINO
# pair uploads temporary artifacts.
# tests/test_linux_release_rows.py fails when the two differ.
on:
pull_request:
Expand All @@ -15,6 +15,15 @@ on:
- third_party/llama.cpp
- tools/apt_retry.sh
- tools/build.py
- tools/openvino_sdk.py
- tools/package_openvino_sidecar.py
- tools/validate_openvino_sidecar.py
- tools/mutate_embedded_identity.py
- src/llama_dart_openvino*
- src/llama_dart_wrapper.h
- tests/*openvino*
- third_party/OpenCL-Headers
- third_party/OpenCL-ICD-Loader
- tools/check_glibc_floor.py
- tools/check_linux_arm64_cpu_variants.sh
- tools/docker/**
Expand Down Expand Up @@ -270,6 +279,15 @@ jobs:
QEMU_SYSROOT: /usr/aarch64-linux-gnu
run: tools/check_linux_arm64_cpu_variants.sh "${RUNNER_TEMP}/llamadart-clean-arm64"

- name: Upload the x64 Vulkan core
if: matrix.arch == 'x64' && matrix.backend == 'vulkan'
uses: actions/upload-artifact@v7
with:
name: native_linux_x64_vulkan
path: artifact_payload/runtime.tar.gz
if-no-files-found: error
retention-days: 1

build-linux-hip:
runs-on: ubuntu-latest
container: rocm/dev-ubuntu-22.04:6.3.4
Expand Down Expand Up @@ -357,3 +375,36 @@ jobs:
--output "$PAYLOAD/runtime.tar.gz" \
--pattern "libggml-hip.so"
ls -la "$PAYLOAD"

build-linux-openvino:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Build the pinned OpenVINO sidecar
uses: ./.github/actions/openvino-sidecar-build
with:
tag: candidate
- name: Upload the OpenVINO sidecar
uses: actions/upload-artifact@v7
with:
name: sidecar_linux_x64_openvino
path: openvino-payload/*.tar.gz
if-no-files-found: error
retention-days: 1

openvino-sidecar-pair:
needs: [build-linux, build-linux-openvino]
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false
- uses: ./.github/actions/openvino-sidecar-pair
43 changes: 41 additions & 2 deletions .github/workflows/validate_wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,43 @@ jobs:
QEMU_SYSROOT: /usr/aarch64-linux-gnu
run: tools/check_linux_arm64_cpu_variants.sh "${RUNNER_TEMP}/llamadart-clean-arm64"

openvino-sidecar-contract:
needs: changes
if: needs.changes.outputs.native == 'true'
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
matrix:
upstream: ${{ fromJSON(needs.changes.outputs.upstreams) }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive
persist-credentials: false
- name: Select candidate upstream
if: matrix.upstream != needs.changes.outputs.pinned
env:
LLAMADART_QUALIFICATION_SHA: ${{ fromJSON(env.LLAMADART_UPSTREAMS)[matrix.upstream] }}
run: |
git -C third_party/llama.cpp fetch --depth=1 origin "$LLAMADART_QUALIFICATION_SHA"
git -C third_party/llama.cpp checkout --detach "$LLAMADART_QUALIFICATION_SHA"
test "$(git -C third_party/llama.cpp rev-parse HEAD)" = "$LLAMADART_QUALIFICATION_SHA"
- name: Build the pinned OpenVINO sidecar
uses: ./.github/actions/openvino-sidecar-build
with:
tag: candidate
- name: Build the OpenVINO contract tests
run: |
build=build/linux-x64-openvino
cmake -S . -B "$build" -DLLAMADART_BUILD_TESTS=ON
cmake --build "$build" --parallel "$(nproc)" --target \
llamadart_openvino_api_test llamadart_openvino_identity_test llamadart_openvino_diagnosis_test
- name: Run the OpenVINO contract tests
run: ctest --test-dir build/linux-x64-openvino -R llamadart_openvino --output-on-failure
- name: Validate the OpenVINO build and package tools
run: python3 -m unittest discover -s tests -p 'test_*openvino*.py'

wrapper-contract:
needs: changes
if: needs.changes.outputs.native == 'true'
Expand Down Expand Up @@ -527,6 +564,7 @@ jobs:
llamadart_f16_dot_accumulation_test
llamadart_speculative_api_test
llamadart_build_identity_test llamadart_upstream_abi_test
llamadart_openvino_identity_test
llamadart_cancel_flag_test
llamadart_tts_api_test
llamadart_tts_types_test
Expand Down Expand Up @@ -661,6 +699,7 @@ jobs:
llamadart_owner_api_test llamadart_owner_reentrancy_test
llamadart_file_sha256_test llamadart_model_fd_test
llamadart_build_identity_test llamadart_upstream_abi_test
llamadart_openvino_api_test llamadart_openvino_identity_test
llamadart_cancel_flag_test
llamadart_exit_teardown_test
llamadart_vulkan_device_info_test
Expand All @@ -678,7 +717,7 @@ jobs:
$wrapperDir = (Resolve-Path build/wx64).Path
$upstreamDir = (Resolve-Path build/wx64/bin).Path
$env:PATH = "$wrapperDir;$upstreamDir;$env:PATH"
ctest --test-dir build/wx64 -R "owner_api|owner_reentrant|file_sha256|model_fd|barrier|grammar_top_k_p|build_identity|upstream_abi|cancel_flag|vocabulary|reasoning-budget|vulkan_device_info|device_memory|fit_api|tts_api|tts_types|asr_stream|tts_stream|image_token_limit" --timeout 120 --output-on-failure
ctest --test-dir build/wx64 -R "owner_api|owner_reentrant|file_sha256|model_fd|barrier|grammar_top_k_p|build_identity|openvino|upstream_abi|cancel_flag|vocabulary|reasoning-budget|vulkan_device_info|device_memory|fit_api|tts_api|tts_types|asr_stream|tts_stream|image_token_limit" --timeout 120 --output-on-failure
- name: Validate wrapper exports
shell: pwsh
run: |
Expand Down Expand Up @@ -796,7 +835,7 @@ jobs:

wrapper-validation:
if: always()
needs: [changes, android-arm64-isa, android-vulkan-shaders, kleidiai-dispatch-emulated, windows-arm64-kleidiai, windows-arm64-vulkan, windows-x64-runtime-closure, linux-artifact-contract, wrapper-contract, msvc-mtmd-link-contract, macos-exit-teardown]
needs: [changes, android-arm64-isa, android-vulkan-shaders, kleidiai-dispatch-emulated, windows-arm64-kleidiai, windows-arm64-vulkan, windows-x64-runtime-closure, linux-artifact-contract, openvino-sidecar-contract, wrapper-contract, msvc-mtmd-link-contract, macos-exit-teardown]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
Expand Down
3 changes: 3 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ there.
It dispatches `native_release.yml` for an exact unbuilt stable release and
never publishes assets or mutates the repository itself.

See `docs/openvino_sidecar.md` for the Linux x64 OpenVINO sidecar contract,
packaged pair checks and Intel NPU qualification.

## CI Triage

- A cancelled job with no runner name and no steps never ran. Read
Expand Down
23 changes: 23 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,33 @@ endif()
add_library(llamadart_lib SHARED
"src/llama_dart_wrapper.cpp"
"src/llama_dart_build_identity.cpp"
"src/llama_dart_openvino.cpp"
"src/llama_dart_file_sha256.cpp"
"src/llama_dart_image_token_limit.cpp"
"src/llama_dart_device_memory.cpp"
"src/llama_dart_vulkan_device_info.cpp")
include(cmake/build_identity.cmake)
llamadart_add_build_identity(llamadart_lib)
if (TARGET ggml-openvino)
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64)$" OR
NOT GGML_BACKEND_DL OR NOT LLAMADART_OPENVINO_RUNTIME_BUILD OR
NOT LLAMADART_OPENCL_CPP_HEADERS)
message(FATAL_ERROR "OpenVINO needs a Linux x64 module build with the pinned SDK from tools/build.py")
endif()
target_sources(ggml-openvino PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src/llama_dart_openvino_shim.cpp")
target_include_directories(ggml-openvino PRIVATE
third_party/llama.cpp/include third_party/llama.cpp/ggml/src/ggml-openvino)
target_include_directories(ggml-openvino SYSTEM PRIVATE "${LLAMADART_OPENCL_CPP_HEADERS}")
target_compile_definitions(ggml-openvino PRIVATE
LLAMADART_OPENVINO_RUNTIME_BUILD="${LLAMADART_OPENVINO_RUNTIME_BUILD}")
llamadart_use_build_identity(ggml-openvino)
target_link_options(ggml-openvino PRIVATE "LINKER:--disable-new-dtags")
set_target_properties(ggml-openvino PROPERTIES
OUTPUT_NAME llamadart-openvino
BUILD_WITH_INSTALL_RPATH ON
INSTALL_RPATH "$ORIGIN")
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_sources(llamadart_lib PRIVATE
$<TARGET_OBJECTS:llamadart_static_destructors>)
Expand Down Expand Up @@ -391,6 +412,7 @@ set_target_properties(llamadart_lib PROPERTIES

target_include_directories(llamadart_lib PRIVATE
third_party/llama.cpp/include
third_party/llama.cpp/ggml/src
third_party/llama.cpp/src
third_party/llama.cpp/common
src
Expand Down Expand Up @@ -433,6 +455,7 @@ if (LLAMADART_BUILD_TESTS)
endforeach()
endif()

include(cmake/openvino_tests.cmake)
add_executable(llamadart_f16_dot_accumulation_test tests/f16_dot_accumulation_test.cpp)
target_compile_features(llamadart_f16_dot_accumulation_test PRIVATE cxx_std_17)
target_compile_definitions(llamadart_f16_dot_accumulation_test PRIVATE
Expand Down
Loading
Loading