vulkan
Safe HaskellNone
LanguageHaskell2010

Vulkan.Extensions.VK_NV_cooperative_vector

Description

Name

VK_NV_cooperative_vector - device extension

VK_NV_cooperative_vector

Name String
VK_NV_cooperative_vector
Extension Type
Device extension
Registered Extension Number
492
Revision
4
Ratification Status
Not ratified
Extension and Version Dependencies
VK_KHR_get_physical_device_properties2 or Vulkan Version 1.1
SPIR-V Dependencies
Contact
Extension Proposal
VK_NV_cooperative_vector

Other Extension Metadata

Last Modified Date
2024-05-23
Interactions and External Dependencies
Contributors
  • Jeff Bolz, NVIDIA

Description

This extension adds support for using cooperative vector types in SPIR-V. Unlike cooperative matrix types, a variable with a cooperative vector type is logically stored in the invocation it belongs to, but they can cooperate behind the scenes when performing matrix-vector multiplies. Cooperative vectors do not require a fully occupied subgroup or uniform control flow like cooperative matrices, although these do increase the likelihood of being on the fast path. And unlike normal vector types, they have arbitrary length and support a relatively limited set of operations. These types are intended to help accelerate the evaluation of small neural networks, where each invocation is performing its own independent evaluation of the network.

Cooperative vector types are defined by the SPV_NV_cooperative_vector SPIR-V extension and can be used with the GL_NV_cooperative_vector GLSL extension.

This extension includes support for enumerating the combinations of types that are supported by the implementation, and for converting matrix data to and from an optimized opaque layout.

New Commands

New Structures

New Unions

New Enums

New Enum Constants

New SPIR-V Capabilities

Version History

  • Revision 4, 2024-05-23 (Jeff Bolz)

    • Add maxCooperativeVectorComponents
  • Revision 3, 2024-05-23 (Jeff Bolz)

    • Add training functions
  • Revision 2, 2024-02-10 (Jeff Bolz)

    • Add device-side matrix conversion
  • Revision 1, 2023-12-13 (Jeff Bolz)

    • Initial revisions

See Also

No cross-references are available

Document Notes

For more information, see the Vulkan Specification.

This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.

Synopsis

Documentation

getPhysicalDeviceCooperativeVectorPropertiesNV Source #

Arguments

:: MonadIO io 
=> PhysicalDevice

physicalDevice is the physical device.

-> io (Result, "properties" ::: Vector CooperativeVectorPropertiesNV) 

vkGetPhysicalDeviceCooperativeVectorPropertiesNV - Returns properties describing what cooperative vector types are supported

Description

If pProperties is NULL, then the number of cooperative vector properties available is returned in pPropertyCount. Otherwise, pPropertyCount must point to a variable set by the user to the number of elements in the pProperties array, and on return the variable is overwritten with the number of structures actually written to pProperties. If pPropertyCount is less than the number of cooperative vector properties available, at most pPropertyCount structures will be written, and INCOMPLETE will be returned instead of SUCCESS, to indicate that not all the available cooperative vector properties were returned.

Valid Usage (Implicit)

  • pPropertyCount must be a valid pointer to a uint32_t value
  • If the value referenced by pPropertyCount is not 0, and pProperties is not NULL, pProperties must be a valid pointer to an array of pPropertyCount CooperativeVectorPropertiesNV structures

Return Codes

Success
Failure

See Also

VK_NV_cooperative_vector, CooperativeVectorPropertiesNV, PhysicalDevice

convertCooperativeVectorMatrixNV Source #

Arguments

:: MonadIO io 
=> Device

device is the device.

-> ConvertCooperativeVectorMatrixInfoNV

pInfo is a pointer to a ConvertCooperativeVectorMatrixInfoNV structure containing information about the layout conversion.

-> io Result 

vkConvertCooperativeVectorMatrixNV - Convert a cooperative vector matrix from one layout and type to another

Description

If pInfo->dstData is NULL, then the number of bytes required to store the converted matrix is returned in pDstSize. Otherwise, pInfo->pDstSize must point to a variable set by the user to the number of bytes in pInfo->dstData, and on return the variable is overwritten with the number of bytes actually written to pInfo->dstData. pInfo->srcData can be NULL when pInfo->dstData is NULL. If pInfo->pDstSize is less than the number of bytes required to store the converted matrix, no bytes will be written, and INCOMPLETE will be returned instead of SUCCESS, to indicate that not enough space was provided.

Valid Usage

  • If pInfo->srcData.hostAddress is NULL, then pInfo->dstData.hostAddress must be NULL
  • If pInfo->srcData.hostAddress is not NULL, then pInfo->srcSize must be large enough to contain the source matrix, based either on the standard matrix layout or based on the size filled out by this command
  • If pInfo->dstData.hostAddress is not NULL, then the value pointed to by pInfo->pDstSize must be large enough to contain the destination matrix, based either on the standard matrix layout or based on the size filled out by this command
  • If pInfo->dstData.hostAddress is not NULL, the source and destination memory ranges must not overlap

Valid Usage (Implicit)

  • device must be a valid Device handle

Return Codes

Success
Failure

See Also

VK_NV_cooperative_vector, ConvertCooperativeVectorMatrixInfoNV, Device

cmdConvertCooperativeVectorMatrixNV Source #

Arguments

:: MonadIO io 
=> CommandBuffer

commandBuffer is the command buffer into which the command will be recorded.

-> ("infos" ::: Vector ConvertCooperativeVectorMatrixInfoNV)

pInfos is a pointer to an array of ConvertCooperativeVectorMatrixInfoNV structures containing information about the layout conversion.

-> io () 

vkCmdConvertCooperativeVectorMatrixNV - Convert a cooperative vector matrix from one layout and type to another

Description

This command does the same conversions as convertCooperativeVectorMatrixNV, but executes on the device. One conversion is performed for each of the infoCount elements of pInfos.

This command’s execution is synchronized using PIPELINE_STAGE_2_CONVERT_COOPERATIVE_VECTOR_MATRIX_BIT_NV.

Valid Usage

  • For each element of pInfo, srcData.deviceAddress must be a valid DeviceAddress
  • For each element of pInfo, dstData.deviceAddress must be a valid DeviceAddress
  • For each element of pInfo, srcData.deviceAddress must be 64 byte aligned
  • For each element of pInfo, dstData.deviceAddress must be 64 byte aligned
  • For each element of pInfo, srcSize must be large enough to contain the source matrix, based either on the standard matrix layout or based on the size filled out by convertCooperativeVectorMatrixNV
  • For each element of pInfo, the value pointed to by pDstSize must be large enough to contain the destination matrix, based either on the standard matrix layout or based on the size filled out by convertCooperativeVectorMatrixNV
  • Memory accessed by the sources and destinations of all of the conversions must not overlap

Valid Usage (Implicit)

  • pInfos must be a valid pointer to an array of infoCount valid ConvertCooperativeVectorMatrixInfoNV structures
  • commandBuffer must be in the recording state
  • The CommandPool that commandBuffer was allocated from must support QUEUE_COMPUTE_BIT, or QUEUE_GRAPHICS_BIT operations
  • This command must only be called outside of a render pass instance
  • This command must not be called between suspended render pass instances
  • This command must only be called outside of a video coding scope
  • infoCount must be greater than 0

Host Synchronization

  • Host access to commandBuffer must be externally synchronized
  • Host access to the CommandPool that commandBuffer was allocated from must be externally synchronized

Command Properties

'

Command Buffer LevelsRender Pass ScopeVideo Coding ScopeSupported Queue TypesCommand Type
Primary SecondaryOutside Outside VK_QUEUE_COMPUTE_BIT VK_QUEUE_GRAPHICS_BITAction

Conditional Rendering

vkCmdConvertCooperativeVectorMatrixNV is not affected by conditional rendering

See Also

VK_NV_cooperative_vector, CommandBuffer, ConvertCooperativeVectorMatrixInfoNV

data PhysicalDeviceCooperativeVectorFeaturesNV Source #

VkPhysicalDeviceCooperativeVectorFeaturesNV - Structure describing cooperative vector features that can be supported by an implementation

Members

This structure describes the following features:

Description

If the PhysicalDeviceCooperativeVectorFeaturesNV structure is included in the pNext chain of the PhysicalDeviceFeatures2 structure passed to getPhysicalDeviceFeatures2, it is filled in to indicate whether each corresponding feature is supported. If the application wishes to use a Device with any features described by PhysicalDeviceCooperativeVectorFeaturesNV, it must add an instance of the structure, with the desired feature members set to TRUE, to the pNext chain of DeviceCreateInfo when creating the Device.

Valid Usage (Implicit)

See Also

VK_NV_cooperative_vector, Bool32, StructureType

Constructors

PhysicalDeviceCooperativeVectorFeaturesNV 

Fields

  • cooperativeVector :: Bool

    cooperativeVector indicates that the implementation supports the CooperativeVectorNV SPIR-V capability.

  • cooperativeVectorTraining :: Bool

    cooperativeVectorTraining indicates that the implementation supports the CooperativeVectorTrainingNV SPIR-V capability.

Instances

Instances details
Eq PhysicalDeviceCooperativeVectorFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Storable PhysicalDeviceCooperativeVectorFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Show PhysicalDeviceCooperativeVectorFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

FromCStruct PhysicalDeviceCooperativeVectorFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

ToCStruct PhysicalDeviceCooperativeVectorFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Zero PhysicalDeviceCooperativeVectorFeaturesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

data CooperativeVectorPropertiesNV Source #

VkCooperativeVectorPropertiesNV - Structure specifying cooperative vector properties

Description

COMPONENT_TYPE_SINT8_PACKED_NV and COMPONENT_TYPE_UINT8_PACKED_NV must not be used for members other than inputInterpretation.

The following combinations must be supported (each row is a required combination):

inputTypeinputInterpretationmatrixInterpretationbiasInterpretationresultType
FLOAT16FLOAT16FLOAT16FLOAT16FLOAT16
UINT32SINT8_PACKEDSINT8SINT32SINT32
SINT8SINT8SINT8SINT32SINT32
FLOAT32SINT8SINT8SINT32SINT32
FLOAT16FLOAT_E4M3FLOAT_E4M3FLOAT16FLOAT16
FLOAT16FLOAT_E5M2FLOAT_E5M2FLOAT16FLOAT16

Valid Usage (Implicit)

See Also

VK_NV_cooperative_vector, Bool32, ComponentTypeKHR, StructureType, getPhysicalDeviceCooperativeVectorPropertiesNV

Constructors

CooperativeVectorPropertiesNV 

Fields

Instances

Instances details
Eq CooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Storable CooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Show CooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

FromCStruct CooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

ToCStruct CooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Zero CooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

data PhysicalDeviceCooperativeVectorPropertiesNV Source #

VkPhysicalDeviceCooperativeVectorPropertiesNV - Structure describing cooperative vector properties supported by an implementation

Description

If the PhysicalDeviceCooperativeVectorPropertiesNV structure is included in the pNext chain of the PhysicalDeviceProperties2 structure passed to getPhysicalDeviceProperties2, it is filled in with each corresponding implementation-dependent property.

Valid Usage (Implicit)

See Also

VK_NV_cooperative_vector, Bool32, ShaderStageFlags, StructureType

Constructors

PhysicalDeviceCooperativeVectorPropertiesNV 

Fields

Instances

Instances details
Eq PhysicalDeviceCooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Storable PhysicalDeviceCooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Show PhysicalDeviceCooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

FromCStruct PhysicalDeviceCooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

ToCStruct PhysicalDeviceCooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Zero PhysicalDeviceCooperativeVectorPropertiesNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

data ConvertCooperativeVectorMatrixInfoNV Source #

VkConvertCooperativeVectorMatrixInfoNV - Structure specifying a request to convert the layout and type of a cooperative vector matrix

Description

When called from cmdConvertCooperativeVectorMatrixNV, the deviceAddress members of srcData and dstData are used. When called from convertCooperativeVectorMatrixNV, the hostAddress members of srcData and dstData are used.

For each of the source and destination matrix, if the layout is not either COOPERATIVE_VECTOR_MATRIX_LAYOUT_ROW_MAJOR_NV or COOPERATIVE_VECTOR_MATRIX_LAYOUT_COLUMN_MAJOR_NV, then the corresponding stride parameter is ignored.

The size of the destination is only a function of the destination layout information, and does not depend on the source layout information.

Conversion can be used to convert between COMPONENT_TYPE_FLOAT32_KHR or COMPONENT_TYPE_FLOAT16_KHR and any supported lower-precision floating-point type. In this case, the conversion uses round-to-nearest-even rounding.

Valid Usage

  • If srcLayout is row-major or column-major, then srcStride must be greater than the length of a row/column, and a multiple of the element size

Valid Usage (Implicit)

See Also

VK_NV_cooperative_vector, ComponentTypeKHR, CooperativeVectorMatrixLayoutNV, DeviceOrHostAddressConstKHR, DeviceOrHostAddressKHR, StructureType, cmdConvertCooperativeVectorMatrixNV, convertCooperativeVectorMatrixNV

Constructors

ConvertCooperativeVectorMatrixInfoNV 

Fields

newtype ComponentTypeKHR Source #

VkComponentTypeKHR - Specify SPIR-V cooperative matrix component type

Description

See Also

VK_KHR_cooperative_matrix, VK_NV_cooperative_matrix, VK_NV_cooperative_vector, ConvertCooperativeVectorMatrixInfoNV, CooperativeMatrixFlexibleDimensionsPropertiesNV, CooperativeMatrixPropertiesKHR, CooperativeMatrixPropertiesNV, CooperativeVectorPropertiesNV

Constructors

ComponentTypeKHR Int32 

Instances

Instances details
Eq ComponentTypeKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Ord ComponentTypeKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Storable ComponentTypeKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Read ComponentTypeKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Show ComponentTypeKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Zero ComponentTypeKHR Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

newtype CooperativeVectorMatrixLayoutNV Source #

VkCooperativeVectorMatrixLayoutNV - Specify cooperative vector matrix layout

Description

All enum values match the corresponding SPIR-V value.

Row-major layout has elements of each row stored consecutively in memory, with a controllable stride from the start of one row to the start of the next row. Column-major layout has elements of each column stored consecutively in memory, with a controllable stride from the start of one column to the start of the next column. Inferencing-optimal and Training-optimal layouts are implementation-dependent, and the application can convert a matrix to those layouts using convertCooperativeVectorMatrixNV or cmdConvertCooperativeVectorMatrixNV. Training-optimal layout with COMPONENT_TYPE_FLOAT16_KHR or COMPONENT_TYPE_FLOAT32_KHR type has the additional guarantee that the application can reinterpret the data as an array of elements and perform element-wise operations on the data, and finite values in any padding elements do not affect the result of a matrix-vector multiply (inf/NaN values may still cause NaN values in the result).

See Also

VK_NV_cooperative_vector, ConvertCooperativeVectorMatrixInfoNV

Instances

Instances details
Eq CooperativeVectorMatrixLayoutNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Ord CooperativeVectorMatrixLayoutNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Storable CooperativeVectorMatrixLayoutNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Read CooperativeVectorMatrixLayoutNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Show CooperativeVectorMatrixLayoutNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

Zero CooperativeVectorMatrixLayoutNV Source # 
Instance details

Defined in Vulkan.Extensions.VK_NV_cooperative_vector

type NV_COOPERATIVE_VECTOR_EXTENSION_NAME = "VK_NV_cooperative_vector" Source #