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®

mlworkloadlib provides a public C++ API for constructing executable ML workloads for Vulkan® and running them through a common resource-binding and execution model.

Public API

The installed public headers are included directly as needed:

#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, and mlsdk::workloadlib::PreparedExecution. Supported workloads are VGF-backed workloads created with Workload::fromVGF(...) and standalone compute shader workloads created with Workload::fromComputeShader(...), and standalone Vulkan® data graph workloads created with Workload::fromDataGraph(...); callers provide application-owned Vulkan® objects through Context::wrap(...), or let Context::create() 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. Required python libraries for building are listed in tooling-requirements.txt.
  • 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)

or, if you prefer 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 should use MLWorkloadLibraryForVulkan::mlworkloadlib.

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

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

Optional source module support

SPIR-V™ modules are supported by the base library. GLSL and HLSL source compilation are optional and can be enabled when building:

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:

python3 -m pip install -r tooling-requirements.txt
python3 scripts/build.py --doc

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

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®, Vulkan®, and SPIR-V™ are trademarks of the Khronos® Group.

Metadata

Release files for ai-ml-workload-library-for-vulkan 0.11.0.dev202609170032

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

Built distribution (wheel)

Table of built distributions (wheels) for ai-ml-workload-library-for-vulkan 0.11.0.dev202609170032
File Interpreter ABI Platform
ai_ml_workload_library_for_vulkan-0.11.0.dev202609170032-py3-none-manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details

Release files / ai_ml_workload_library_for_vulkan-0.11.0.dev202609170032-py3-none-manylinux2014_x86_64.whl

Download URL ai_ml_workload_library_for_vulkan-0.11.0.dev202609170032-py3-none-manylinux2014_x86_64.whl
Size 351.0 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
30ee2c7fe936e564539f307fdd63b5d07716a7274739db5e8bd5f90eff11a71b
BLAKE2b-256 checksum
How to use checksums
5a6c1e7d85da6c8bb6d0755d48d4b6245d0e19cb6e133c6e87b821c74bec29c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.8

Release history Release notifications | RSS feed

0.11.0

4 release files

This release
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