Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ML Workload Library for Vulkan®

The Workload Library provides an experimental C++ API for constructing executable ML workloads for Vulkan® and running them through a common resource-binding and execution model.

Public API

Include the installed public headers that your application requires:

#include <mlworkloadlib/workload.hpp>
#include <mlworkloadlib/context.hpp>
#include <mlworkloadlib/session.hpp>

The API exposes:

  • mlsdk::workloadlib::Workload
  • mlsdk::workloadlib::Context
  • mlsdk::workloadlib::Session
  • mlsdk::workloadlib::BindingSet
  • mlsdk::workloadlib::PreparedExecution

You can create the following workloads:

  • VGF-backed workloads with Workload::fromVGF(...)
  • Standalone compute shader workloads with Workload::fromComputeShader(...)
  • Standalone Vulkan® data graph workloads with Workload::fromDataGraph(...)

Use Context::wrap(...) to provide application-owned Vulkan® objects, or use Context::create() to create a runtime-owned Vulkan® context.

Building the ML Workload Library for Vulkan® from source

The build system must have:

  • C/C++ 17 compiler: GCC or Clang on Linux, Clang on Darwin, or MSVC on Windows®.
  • CMake 3.25 or later.
  • Ninja 1.8.2 or later.
  • Python 3.10 or later and uv 0.9.26. Python tooling dependencies are declared in pyproject.toml and locked in uv.lock.
  • Doxygen 1.9.1 or later. (When building documentation)

To create an archive containing the build artifacts, pass the --package-type option with an archive type such as zip or tgz. Use --package-dir to choose where the archive is written; by default, packages are written to the build directory.

For more command line options, see the help output:

python3 scripts/build.py --help

Build-tree usage

Enable the library when configuring the standalone project:

cmake -S . -B build

Link one of the build-tree targets:

target_link_libraries(my_target PRIVATE mlworkloadlib)

Alternatively, link a namespaced target in the same build:

target_link_libraries(my_target PRIVATE MLWorkloadLibraryForVulkan::mlworkloadlib)

Installed package usage

When the ML Workload Library for Vulkan® is installed, the package exports mlworkloadlib through the MLWorkloadLibraryForVulkan package. Downstream consumers must use MLWorkloadLibraryForVulkan::mlworkloadlib.

find_package(MLWorkloadLibraryForVulkan CONFIG REQUIRED)
target_link_libraries(my_target PRIVATE MLWorkloadLibraryForVulkan::mlworkloadlib)

The package target requires the VGF and VulkanHeaders packages to be discoverable at configure time.

Optional VGF support

VGF workload support is enabled by default. Disable it when the library is only needed for programmatically constructed workloads:

python3 scripts/build.py --disable-vgf-support

For direct CMake configuration, set ML_WORKLOAD_LIB_ENABLE_VGF_SUPPORT=OFF. Such builds do not locate or link VGF Lib. Calls to Workload::fromVGF(...) throw an exception indicating that VGF support is unavailable.

Optional source module support

The base library supports SPIR-V™ modules. You can choose to enable GLSL and HLSL source compilation when you build the library:

python3 scripts/build.py --enable-glsl-support
python3 scripts/build.py --enable-hlsl-support

Use --glslang-path or --dxc-path when the dependency is not in the default location. For direct CMake configuration, use ML_WORKLOAD_LIB_ENABLE_GLSL_SUPPORT with GLSLANG_PATH, or ML_WORKLOAD_LIB_ENABLE_HLSL_SUPPORT with DXC_PATH.

Applications can query the source backends available in the linked library with mlsdk::workloadlib::supports(...).

Documentation

Install Doxygen and the Python documentation tool dependencies and build the HTML documentation:

uv sync --locked --no-install-project --no-default-groups --group tooling
uv run --no-sync python scripts/build.py --doc

The generated documentation is available at build/docs/out/index.html.

Code coverage

Sync the locked Python tooling dependencies, then run the unit tests on Linux with GCC coverage instrumentation:

uv sync --locked --no-install-project --no-default-groups --group test --group tooling
uv run --no-sync python scripts/build.py --coverage --build-dir build-coverage

The coverage command writes a detailed HTML report to build-coverage/coverage/index.html and a machine-readable JSON summary to build-coverage/coverage/summary.json. Coverage is collected for the library sources and public headers; tests and bundled dependencies are excluded from the report.

Consumption model

  • mlworkloadlib is install-tree consumable today via find_package(MLWorkloadLibraryForVulkan).
  • mlworkloadlib depends on external packages (VGF, VulkanHeaders), and those dependencies are resolved via the standalone package config.

License

The ML Workload Library for Vulkan® is distributed under the software licenses in the LICENSES directory.

Trademark notice

Arm® is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.

Khronos® and Vulkan® are registered trademarks, and SPIR-V™ is a trademark of The Khronos Group Inc..

Metadata

Release files for ai-ml-workload-library-for-vulkan 0.12.0.dev20261017

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for ai-ml-workload-library-for-vulkan 0.12.0.dev20261017
File
ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64, Linux glibc 2.24+ ARM64 Details
ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-macosx_15_0_arm64.whl Python 3 none macOS 15.0+ ARM64 Details

Total release size: 4.8 MB

Release files / ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-win_amd64.whl

Download URL ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-win_amd64.whl
Size 2.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
e95f9c106a7335532e6c3670fb1351e05f91ad5c83fb844eac83f8076d699002
BLAKE2b-256 checksum
How to use checksums
26084b5801d00eba91ab85d5e77a68cafaaa348c24f7085695124b2857762f20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.10

Release files / ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 767.0 kB
Tags Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
727c352d127d3282efa63f7eb80ebce0f26df71403e71c244d42881ae50c6db9
BLAKE2b-256 checksum
How to use checksums
db8ea5f676f9d0f05a1565f122e91d56d4b318dc58a713f2b391a7a478285150
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.15

Release files / ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 723.3 kB
Tags Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
96a55f01d6c1ea0eaa8d621e55731c716d86ef062f31cb4cefe49d0d56968fa6
BLAKE2b-256 checksum
How to use checksums
9a8391b1bd94d572a8d5ca97b6387faaed548f13c8bc8aa99a2e0a03c80103c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.15

Release files / ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-macosx_15_0_arm64.whl

Download URL ai_ml_workload_library_for_vulkan-0.12.0.dev20261017-py3-none-macosx_15_0_arm64.whl
Size 583.3 kB
Tags Python 3 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
c30033fdec772a0dea837f0e8e62c286702b85d2b6cb49f400c75e5a7ed69e1f
BLAKE2b-256 checksum
How to use checksums
fa2e0910acb2602a3226634cd2e0fdfda33ce04055e8b8a6e45a7ce50dcf6a73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page