ML SDK Scenario Runner
Project description
ML SDK Scenario Runner
The Scenario Runner is an application that executes shader and neural network graph workloads through Vulkan® or the ML extensions for Vulkan®. The Scenario Runner acts as a validation and performance exploration vehicle. The Scenario Runner also acts as a mechanism to define test-cases called scenarios in a declarative way via a JSON description. The Scenario Runner can parse the JSON, load the input stimulus that is described in the JSON, execute the scenario and produce output artifacts.
Cloning the repository
To clone the ML SDK Scenario Runner as a stand-alone repository, you can use
regular git clone commands. However, for better management of dependencies and
to ensure everything is placed in the appropriate directories, we recommend
using the git-repo tool to clone the repository as part of the ML SDK for
Vulkan® suite. Repo tool.
For a minimal build and to initialize only the Scenario Runner and its dependencies, run:
repo init -u https://github.com/arm/ai-ml-sdk-manifest -g scenario-runner
Alternatively, to initialize the repo structure for the entire ML SDK for Vulkan®, including the Scenario Runner, run:
repo init -u https://github.com/arm/ai-ml-sdk-manifest -g all
Once the repo is initialized, you can fetch the contents:
repo sync --no-clone-bundle
Cloning on Windows®
To ensure nested submodules do not exceed the maximum long path length, you must enable long paths on Windows®, and you must clone close to the root directory or use a symlink. Make sure to use Git for Windows.
Using PowerShell:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1
git config --global core.longpaths true
git --version # Ensure you are using Git for Windows, for example 2.50.1.windows.1
git clone <git-repo-tool-url>
python <path-to-git-repo>\git-repo\repo init -u <manifest-url> -g all
python <path-to-git-repo>\git-repo\repo sync --no-clone-bundle
Using Git Bash:
cmd.exe "/c reg.exe add \"HKLM\System\CurrentControlSet\Control\FileSystem"" /v LongPathsEnabled /t REG_DWORD /d 1 /f"
git config --global core.longpaths true
git --version # Ensure you are using the Git for Windows, for example 2.50.1.windows.1
git clone <git-repo-tool-url>
python <path-to-git-repo>/git-repo/repo init -u <manifest-url> -g all
python <path-to-git-repo>/git-repo/repo sync --no-clone-bundle
After the sync command completes successfully, you can find the ML SDK Scenario
Runner in <repo_root>/sw/scenario-runner/. You can also find all the
dependencies required by the ML SDK Scenario Runner in
<repo_root>/dependencies/.
Building Scenario Runner from source
The build system must have:
- CMake 3.25 or later.
- C/C++ 17 compiler: GCC, or optionally Clang on Linux and MSVC on Windows®.
- Python 3.10 or later. Required python libraries for building are listed in
tooling-requirements.txt. - Ninja 1.10 or later.
The following dependencies are also needed:
- Argument Parser for Modern C++.
- glslang.
- JSON for Modern C++.
- SPIRV-Headers.
- SPIRV-Tools.
- Vulkan-Headers.
- GoogleTest. Optional, for testing.
For the preferred dependency versions see the manifest file.
Building with the script
To build on Linux, run the following command:
SDK_PATH="path/to/sdk"
python3 ${SDK_PATH}/sw/scenario-runner/scripts/build.py -j $(nproc) \
--flatbuffers-path ${SDK_PATH}/dependencies/flatbuffers \
--argparse-path ${SDK_PATH}/dependencies/argparse \
--json-path ${SDK_PATH}/dependencies/json \
--vulkan-headers-path ${SDK_PATH}/dependencies/Vulkan-Headers \
--glslang-path ${SDK_PATH}/dependencies/glslang \
--spirv-headers-path ${SDK_PATH}/dependencies/SPIRV-Headers \
--spirv-tools-path ${SDK_PATH}/dependencies/SPIRV-Tools \
--vgf-lib-path ${SDK_PATH}/sw/vgf-lib \
--gtest-path ${SDK_PATH}/dependencies/googletest
To build on Windows®, run the following command:
$env:SDK_PATH="path\to\sdk"
$cores = [System.Environment]::ProcessorCount
python "$env:SDK_PATH\sw\scenario-runner\scripts\build.py" -j $cores `
--flatbuffers-path "$env:SDK_PATH\dependencies\flatbuffers" `
--argparse-path "$env:SDK_PATH\dependencies\argparse" `
--json-path "$env:SDK_PATH\dependencies\json" `
--vulkan-headers-path "$env:SDK_PATH\dependencies\Vulkan-Headers" `
--glslang-path "$env:SDK_PATH\dependencies\glslang" `
--spirv-headers-path "$env:SDK_PATH\dependencies\SPIRV-Headers" `
--spirv-tools-path "$env:SDK_PATH\dependencies\SPIRV-Tools" `
--vgf-lib-path "$env:SDK_PATH\sw\vgf-lib" `
--gtest-path "$env:SDK_PATH\dependencies\googletest"
To cross compile for AArch64 architecture, you can add the following option:
SDK_PATH="path/to/sdk"
python3 $SDK_PATH/sw/scenario-runner/scripts/build.py -j $(nproc) \
--flatbuffers-path ${SDK_PATH}/dependencies/flatbuffers \
--argparse-path ${SDK_PATH}/dependencies/argparse \
--json-path ${SDK_PATH}/dependencies/json \
--vulkan-headers-path ${SDK_PATH}/dependencies/Vulkan-Headers \
--glslang-path ${SDK_PATH}/dependencies/glslang \
--spirv-headers-path ${SDK_PATH}/dependencies/SPIRV-Headers \
--spirv-tools-path ${SDK_PATH}/dependencies/SPIRV-Tools \
--vgf-lib-path ${SDK_PATH}/sw/vgf-lib \
--gtest-path ${SDK_PATH}/dependencies/googletest \
--target-platform aarch64
To enable and run tests, use the --test flag. To lint the tests, use the
--lint flag. To enable tests and documentation building python dependencies
must be installed:
pip install -r requirements.txt
pip install -r tooling_requirements.txt
To build the documentation, use the --doc flag. To build the documentation,
you must have sphinx and doxygen installed on your machine.
You can install the build artifacts for this project into a specified location.
To install the build artifacts, pass the --install option with the required
path.
To create an archive with the build artifacts, you must add --package. The
archive is stored in the provided location.
For more command line options, consult the program help:
python3 $SDK_PATH/sw/scenario-runner/scripts/build.py --help
Usage
To run a scenario file, use the following command:
./scenario-runner --scenario ${SCENARIO_JSON_FILE}
Where:
--scenario: File to load the scenario from. The file must be in JSON format. If the resources in the SCENARIO_JSON_FILE are not specified with absolute paths, their relative paths will be resolved against the parent directory of the SCENARIO_JSON_FILE.
For more details, see the help output:
./scenario-runner --help
PyPI
The ML SDK Scenario Runner is available on PyPI as the ai-ml-sdk-scenario-runner package.
Install:
pip install ai-ml-sdk-scenario-runner
Known Limitations
- Resources created with
Optimaltiling cannot be used with memory aliasing.
License
The ML SDK Scenario Runner is distributed under the software licenses in LICENSES directory.
Trademark notice
Arm® is a registered trademarks of Arm Limited (or its subsidiaries) in the US and/or elsewhere.
Khronos®, Vulkan® and SPIR-V™ are registered trademarks of the Khronos® Group.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_ml_sdk_scenario_runner-0.8.0-py3-none-win_amd64.whl.
File metadata
- Download URL: ai_ml_sdk_scenario_runner-0.8.0-py3-none-win_amd64.whl
- Upload date:
- Size: 4.6 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3449b48a699ab2f58a70e7ec881232c0e44bf4943770ec78a981ef778b618515
|
|
| MD5 |
83c5debe47cab23d9026fe1bd65e73bb
|
|
| BLAKE2b-256 |
1cd84f275c518a7a2cd0de9863b385bdf45542dfe70a9fa3397133d3f61a4dfd
|
File details
Details for the file ai_ml_sdk_scenario_runner-0.8.0-py3-none-manylinux2014_x86_64.whl.
File metadata
- Download URL: ai_ml_sdk_scenario_runner-0.8.0-py3-none-manylinux2014_x86_64.whl
- Upload date:
- Size: 12.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9281848105026b046ee9578ade31faa102ed09867cdcd4e3ce30158daf649308
|
|
| MD5 |
fc468f6962337f4b73eb94ef53bc74ef
|
|
| BLAKE2b-256 |
cd97afc16bd5cc71894f160d82a04899a16ce16ac1ba25ba4622fa840031c783
|
File details
Details for the file ai_ml_sdk_scenario_runner-0.8.0-py3-none-manylinux2014_aarch64.whl.
File metadata
- Download URL: ai_ml_sdk_scenario_runner-0.8.0-py3-none-manylinux2014_aarch64.whl
- Upload date:
- Size: 11.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52dee34c4e546e1aab46d8ea1084828dde03475a38800f1fc203e3ed6b770a38
|
|
| MD5 |
357e4d1e9a33c734ead47e23fdc7b1e2
|
|
| BLAKE2b-256 |
ac89f9b697a4c53fc936fc01798ad010d9313b29904a42a043aa4dd398c9fde6
|
File details
Details for the file ai_ml_sdk_scenario_runner-0.8.0-py3-none-macosx_10_13_universal2.whl.
File metadata
- Download URL: ai_ml_sdk_scenario_runner-0.8.0-py3-none-macosx_10_13_universal2.whl
- Upload date:
- Size: 7.5 MB
- Tags: Python 3, macOS 10.13+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f651a863f81ec82234031350f3e58a3e3f2399a117a4c2fa2185687254c39e7
|
|
| MD5 |
a80c80e57117109864842af972d37af1
|
|
| BLAKE2b-256 |
c9ff020fb9d7f57721bee46726e796acd9e925d7de8531e9919dd0e92c0dbcee
|