Skip to main content

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:

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 \
    --dxc-path ${SDK_PATH}/dependencies/DirectXShaderCompiler \
    --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" `
    --dxc-path "$env:SDK_PATH\dependencies\DirectXShaderCompiler" `
    --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 \
    --dxc-path ${SDK_PATH}/dependencies/DirectXShaderCompiler \
    --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 Optimal tiling cannot be used with memory aliasing.
  • HLSL support is an experimental feature, DirextXShaderCompiler is linked dynamically. When HLSL support is enabled, Scenario Runner needs to be built from source or libdxcompiler.so or dxcompiler.dll with spir-v enabled needs to be bundled with the prebuild.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ai_ml_sdk_scenario_runner-0.9.0-py3-none-win_amd64.whl (5.1 MB view details)

Uploaded Python 3Windows x86-64

ai_ml_sdk_scenario_runner-0.9.0-py3-none-macosx_11_0_arm64.whl (10.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file ai_ml_sdk_scenario_runner-0.9.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for ai_ml_sdk_scenario_runner-0.9.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 12f14e7f777b410f0e20d630b5f37607c0b11970066624fb56acad9703c3f1a4
MD5 88c25ee457790d33b2aa4ba587662f96
BLAKE2b-256 a384526d9008f00b02d43778b2922c2a1b38841d3ec989765693a22ccf7e1fa9

See more details on using hashes here.

File details

Details for the file ai_ml_sdk_scenario_runner-0.9.0-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ai_ml_sdk_scenario_runner-0.9.0-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca45029f5569dc29552e84678dad5a2d7e22631b0d3181c276fee97937d10f62
MD5 ae07aca7ca16c85a23a8b29cfd1b1a13
BLAKE2b-256 94817fd79b54df950da19c710f1bf974f3ac93a47c8dca8fd63e0353cd199493

See more details on using hashes here.

File details

Details for the file ai_ml_sdk_scenario_runner-0.9.0-py3-none-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ai_ml_sdk_scenario_runner-0.9.0-py3-none-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c392ca968621f76383130a7512df7ec2a7bf45a96410bea9faface59a3b88cb5
MD5 692d8ce5517b12f8696bd675c9df873f
BLAKE2b-256 e92fa15eaad1f10d34bf4f9d220600963cf57e12a8dd96205e578ff4f20a4e99

See more details on using hashes here.

File details

Details for the file ai_ml_sdk_scenario_runner-0.9.0-py3-none-manyLinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ai_ml_sdk_scenario_runner-0.9.0-py3-none-manyLinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d6d16f5124b36303ba33587d59150fb849d8f76400d090501c8683574132334c
MD5 95b6f8eb2385dad2566491bd90284ffa
BLAKE2b-256 4c4ffffa392873f8dc47512dd2906e1d8996e967372a4f7d7ef0bf5c60d9bb3e

See more details on using hashes here.

File details

Details for the file ai_ml_sdk_scenario_runner-0.9.0-py3-none-manyLinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ai_ml_sdk_scenario_runner-0.9.0-py3-none-manyLinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4b0e4abade15e0ae637ffad6f9958563cc98dba16797e545d9872e60d2938169
MD5 283844d853d71504163c31b82f9c57b3
BLAKE2b-256 965ee4ebdabee68cfcc12e7aad3597e3648278ac24fc4139fa12ae079500e9cd

See more details on using hashes here.

File details

Details for the file ai_ml_sdk_scenario_runner-0.9.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ai_ml_sdk_scenario_runner-0.9.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 44c4055b94d16c094cd8a66758cf811adfa36d061917579441b4c0db35890a52
MD5 110e150045fbfb4ec204cd9670293d4c
BLAKE2b-256 7e0ca57db9cf653a02f397b339f3c988a84b50a0055594b86191e5359a0b296f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page