executorch icon indicating copy to clipboard operation
executorch copied to clipboard

Support int8 texture tensors without requiring int8 buffers

Open SS-JIA opened this issue 1 year ago • 3 comments

Summary:

Context

By default, storage buffers in Vulkan must contain 32 bit data types; using 8 bit and 16 bit data types in buffers can be enabled optionally by supporting the VK_KHR_8bit_storage extension or the VK_KHR_16bit_storage extension respectively.

Previously, 8-bit and 16-bit tensors were enabled by using those extensions; however, this meant that 8-bit and 16-bit tensors could not be used if the Vulkan driver does not support the corresponding extension.

This diff adds support for 8-bit texture-backed tensors without the need for the VK_KHR_8bit_storage extension. This is done by introducing shaders that manually pack and repack 4 8-bit integers into a single int32 value. Once the tensor data has been transferred to an image texture (which will use the VK_FORMAT_R8G8B8A8_SINT image format) the extension will no longer be required.

Differential Revision: D60536832

SS-JIA avatar Jul 31 '24 20:07 SS-JIA

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/4485

Note: Links to docs will display an error until the docs builds have been completed.

:white_check_mark: No Failures

As of commit c269cf972a097429325515c962a15638749d5897 with merge base 1090bcd26e683188ebc1ebb056f174b35930392c (image): :green_heart: Looks good so far! There are no failures yet. :green_heart:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

pytorch-bot[bot] avatar Jul 31 '24 20:07 pytorch-bot[bot]

This pull request was exported from Phabricator. Differential Revision: D60536832

facebook-github-bot avatar Jul 31 '24 20:07 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D60536832

facebook-github-bot avatar Aug 01 '24 23:08 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D60536832

facebook-github-bot avatar Aug 02 '24 16:08 facebook-github-bot

This pull request was exported from Phabricator. Differential Revision: D60536832

facebook-github-bot avatar Aug 02 '24 16:08 facebook-github-bot

This pull request has been merged in pytorch/executorch@448c7d3c07125c1f13e24ff81de7473a6a446916.

facebook-github-bot avatar Aug 02 '24 17:08 facebook-github-bot