-
Notifications
You must be signed in to change notification settings - Fork 782
Add compute_shaders_with_tensors sample #1438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add compute_shaders_with_tensors sample #1438
Conversation
Signed-off-by: Matthew Sloyan <[email protected]>
asuessenbach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sample looks great! I especially like the good comments on all relevant aspects.
Just a couple of comments...
...ers/tensor_and_data_graph/compute_shaders_with_tensors/glsl/visualization_three_tensors.comp
Show resolved
Hide resolved
...tensions/tensor_and_data_graph/compute_shaders_with_tensors/compute_shaders_with_tensors.cpp
Show resolved
Hide resolved
...tensions/tensor_and_data_graph/compute_shaders_with_tensors/compute_shaders_with_tensors.cpp
Outdated
Show resolved
Hide resolved
...tensions/tensor_and_data_graph/compute_shaders_with_tensors/compute_shaders_with_tensors.cpp
Outdated
Show resolved
Hide resolved
...tensions/tensor_and_data_graph/compute_shaders_with_tensors/compute_shaders_with_tensors.cpp
Outdated
Show resolved
Hide resolved
...extensions/tensor_and_data_graph/compute_shaders_with_tensors/compute_shaders_with_tensors.h
Outdated
Show resolved
Hide resolved
|
Sample works fine for me, but has several validation errors: Using the latest SDK. |
Signed-off-by: Matthew Sloyan <[email protected]>
|
@asuessenbach I have addressed your comments, thank you for review and the suggestions! @SaschaWillems Thank you for trying this out! I will look into this with the latest SDK on our side. The tensor and data graph still isn't fully supported in the public validation layer yet, so this might be the cause. I have also added the guide to downloading and using the ML Extensions for Vulkan Emulation Layer to the description so other can try it out. |
|
I'm getting a few more VVL issues: Can I recommend adding some instructions for Linux? Users don't need to have to build from source to get the layer to work. This is what I did (this run is tested in Ubuntu): It might even be a worthwhile idea to make a few scripts. Just thinking it's probably best to recommend end users use tagged releases rather than clone the repo. Other than those recommendations; this works great in Windows, and Linux. I haven't tested Android yet, but I will. |
Signed-off-by: Matthew Sloyan <[email protected]>
|
Thank you @gpx1000 for the review, we really appreciate the thoughts. I have updated the README.md in the tensor_and_data_graph and the description of this pull request to mention that the emulation layer is now available pre-built on GitHub. I have also generalized the section on using the vkconfig as an alternative to exporting the variables. Thanks for pointing that out! Also thanks for trying on Windows and Linux. Just to note we don't currently support Android which is mentioned in the README, but we're working on it. Regarding the validation layers, sorry about the delay. I have addressed majority of the issues. The updated extensions weren't being requested, so this fixes the tensor and shaderModule related errors. However, there are two remaining (see below) due to a bug in the emulation layer. This is currently being investigated from our side, [error] 1211499479 - VUID-VkTensorDescriptionARM-pDimensions-09883: [error] 1553436542 - VUID-vkGetDataGraphPipelineSessionMemoryRequirementsARM-bindPoint-09784: @SaschaWillems, @gpx1000 Are you both okay with this for now, as it doesn't affect the running sample? We have two more samples to push and some general improvements, so these two errors will be addressed once the issues are sorted in the emulation layer. I have also updated the checkbox to reflect this. |
SaschaWillems
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm totally fine with this. We can always fix outstanding issues after merging.
Signed-off-by: Matthew Sloyan <[email protected]>
fca064c
Description
This sample demonstrates the usage of the VK_ARM_tensors and VK_ARM_data_graph extensions for machine learning inference. These allow you to define a neural network with TOSA operations and then execute inferences using hardware acceleration.
This is the third in a series of samples which shows a user how they can use compute shaders to produce inputs to a simple neural network. There is also a post-processing compute shader that modifies the output tensor.
The first sample can be found here: #1394
Build & run guide
If you would like to try out this new sample locally, we provide an emulation layer which allows them to run. This can be found here: https://github.com/arm/ai-ml-emulation-layer-for-vulkan. There is also a pre-built Windows and Linux package available here: https://github.com/arm/ai-ml-emulation-layer-for-vulkan/releases/tag/v0.8.0 or you can grab it through our tutorial: https://learn.arm.com/learning-paths/mobile-graphics-and-gaming/vulkan-ml-sample/. This tutorial is for this first sample already merged (simple_tensor_and_data_graph), so it shows you everything needed to try it out. The guide is only for Windows though, but the README in the ai-ml-emulation-layer-for-vulkan repository provides a build and usage guide for Linux.
General Checklist:
Please ensure the following points are checked:
Note: The Samples CI runs a number of checks including:
If this PR contains framework changes:
batchcommand line argument to make sure all samples still work properlySample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: