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::Workloadmlsdk::workloadlib::Contextmlsdk::workloadlib::Sessionmlsdk::workloadlib::BindingSetmlsdk::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
uv0.9.26. Python tooling dependencies are declared inpyproject.tomland locked inuv.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