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