Name Strings

SPV_EXT_cooperative_vector

Contact

To report problems with this extension, please open a new issue at:

Contributors

  • Jeff Bolz, NVIDIA

  • Matthew Netsch, Qualcomm

  • Vikram Tarikere, Imagination Technologies

  • Alan Baker, Google

  • Russell Liu, AMD

  • Alexander Galazin, Qualcomm

  • Tobias Hector, AMD

Notice

Copyright (c) 2026 The Khronos Group Inc. Copyright terms at http://www.khronos.org/registry/speccopyright.html

Status

  • Approved by the SPIR-V Working Group: 2026-10-07

  • Approved by the Khronos Board of Promoters: 2026-11-20

Version

Last Modified Date

2026-10-02

Revision

1

Dependencies

This extension is written against the SPIR-V Specification, Version 1.6, Revision 7, Unified.

This extension requires SPIR-V 1.3.

This extension interacts with SPV_EXT_long_vector.

This extension interacts with SPV_KHR_physical_storage_buffer.

This extension interacts with SPV_KHR_untyped_pointers by accepting untyped pointers as pointer operands.

This extension reuses the Cooperative Matrix Use and Cooperative Matrix Operand operand kinds but does not require SPV_KHR_cooperative_matrix.

Overview

This extension adds instructions for per-invocation matrix-vector multiplication and outer-product accumulation. These operations are intended to accelerate the evaluation and training of small neural networks.

SPV_NV_cooperative_vector introduced a dedicated cooperative vector type and instructions for arithmetic, conversion, load, store, matrix-vector multiplication, outer-product accumulation, and component-wise atomic accumulation.

This extension uses ordinary vector types instead. SPV_EXT_long_vector provides equivalent vector types with arbitrary or specialization-constant component counts. Ordinary vector instructions provide arithmetic, conversion, load, and store operations. Component-wise atomic accumulation is provided separately by extensions that allow vector operands for atomic add. Consequently, this extension only provides the matrix-vector multiplication and outer-product functionality.

The matrix-vector and outer-product operations are each split into a pair of instructions. OpCooperativeVectorMatrixLoadEXT produces an abstract matrix value that is consumed by OpCooperativeVectorMatrixMulEXT or OpCooperativeVectorMatrixMulAddEXT. OpCooperativeVectorOuterProductEXT produces an abstract matrix-accumulator value that is consumed by OpCooperativeVectorMatrixAccumulateEXT.

The loaded-matrix and matrix-accumulator parameterizations of the abstract type are intentionally distinct. A loaded matrix cannot be accumulated to memory and an outer product’s result cannot be used for a matrix-vector multiplication. The abstract values also allow an implementation to preserve the producer operands and re-fuse each producer/consumer pair when lowering to hardware.

This extension introduces the types and instructions, but does not specify rules about what types are supported. This is left to the client API specifications, and it is expected that different implementations may support different types.

Extension Name

To use this extension within a SPIR-V module, the following OpExtension must be present in the module:

OpExtension "SPV_EXT_cooperative_vector"

Modifications to the SPIR-V Specification, Version 1.6

2.2 Terms

Add the following type to the definition of Abstract Type:

  • OpTypeCooperativeVectorMatrixEXT

2.16 Validation Rules

Modify section 2.16.1. Universal Validation Rules:

  • Add OpCooperativeVectorMatrixLoadEXT and OpCooperativeVectorMatrixAccumulateEXT to the list of instructions under "It is invalid for a pointer to be an operand to any instruction other than:", when the Logical addressing model is selected and neither the VariablePointers nor VariablePointersStorageBuffer capability are declared.

  • OpTypeCooperativeVectorMatrixEXT types (or types containing them) can only be allocated in Function or Private storage classes.

3.31 Capabilities

Modify Section 3.31, "Capability", adding these rows to the Capability table:

Capability Implicitly Declares

5454

CooperativeVectorEXT
Enables abstract OpTypeCooperativeVectorMatrixEXT types and matrix-vector multiplication instructions.

5455

CooperativeVectorTrainingEXT
Enables abstract OpTypeCooperativeVectorMatrixEXT types with MatrixAccumulatorKHR Use, outer products, and accumulation of outer products to memory.

CooperativeVectorEXT

3.X Cooperative Vector Matrix Layout

New section in 3 "Binary Form".

Cooperative Vector Matrix Layout Enabling Capabilities

0

RowMajorEXT
Contiguous elements in memory form the rows of the matrix.

1

ColumnMajorEXT
Contiguous elements in memory form the columns of the matrix.

2

InferencingOptimalEXT
Optimized for inferencing operations.

3

TrainingOptimalEXT
Optimized for training operations.

The corresponding NV enumerants introduced by SPV_NV_cooperative_vector are aliases of these enumerants.

3.X Cooperative Vector Matrix Component Type

Modify the Cooperative Vector Matrix Component Type table, making the EXT enumerants primary and the corresponding NV enumerants aliases:

Cooperative Vector Matrix Component Type Enabling Capabilities

0

Float16EXT

1

Float32EXT

2

Float64EXT

3

SignedInt8EXT

4

SignedInt16EXT

5

SignedInt32EXT

6

SignedInt64EXT

7

UnsignedInt8EXT

8

UnsignedInt16EXT

9

UnsignedInt32EXT

10

UnsignedInt64EXT

1000491000

SignedInt8PackedEXT

1000491001

UnsignedInt8PackedEXT

1000491002

FloatE4M3EXT

1000491003

FloatE5M2EXT

3.XX.6 Type-Declaration Instructions

OpTypeCooperativeVectorMatrixEXT

Declare an abstract matrix type for per-invocation cooperative-vector operations. The matrix is logically owned by the invocation that creates it. Values of this type have no defined physical size or bit pattern.

Component Type specifies the component type of the matrix in memory or the component type used for accumulation. It must be a 32-bit integer constant instruction whose value corresponds to a Cooperative Vector Matrix Component Type.

Rows and Columns specify the logical dimensions of the matrix. They must be 32-bit integer constant instructions. They are treated as unsigned and must be greater than zero.

Use distinguishes a matrix loaded for matrix-vector multiplication from a matrix accumulator produced by an outer product. It must be a 32-bit integer constant instruction whose value corresponds to a Cooperative Matrix Use. It must be MatrixAKHR or MatrixAccumulatorKHR. If it is MatrixAKHR, the CooperativeVectorEXT capability must be declared. If it is MatrixAccumulatorKHR, the CooperativeVectorTrainingEXT capability must be declared.

Capability:
CooperativeVectorEXT or CooperativeVectorTrainingEXT

6

5387

Result <id>

<id>
Component Type

<id>
Rows

<id>
Columns

<id>
Use

3.XX.15 Logical Instructions

Modify OpSelect to allow Result Type to additionally be OpTypeCooperativeVectorMatrixEXT. When Result Type is OpTypeCooperativeVectorMatrixEXT, Condition must be a scalar Boolean.

3.XX.X Cooperative Vector Instructions

OpCooperativeVectorMatrixLoadEXT

Load a matrix from memory into an abstract value for subsequent matrix-vector multiplication.

Result Type must be an OpTypeCooperativeVectorMatrixEXT whose Use is MatrixAKHR. Its Rows and Columns operands specify M and K, the logical dimensions of the matrix after applying Transpose.

Pointer is a pointer value. Its type must be an OpTypePointer or OpTypeUntypedPointerKHR. If its type is OpTypePointer, its Type operand must be a scalar or vector type. If the Shader capability was declared and Pointer’s type is OpTypePointer, 'Pointer must point into an array and any ArrayStride decoration on Pointer is ignored. The storage class of Pointer must be CrossWorkgroup, StorageBuffer or PhysicalStorageBuffer. Pointer points to the first element of the matrix.

If the type of Pointer is OpTypePointer, its pointed-to type can be any scalar or vector type and is otherwise ignored. Raw data is loaded according to the Component Type of Result Type. No conversion is performed.

The Memory Layout operand specifies how matrix elements are laid out in memory. It must come from a 32-bit integer constant instruction whose value corresponds to a Cooperative Vector Matrix Layout. See the Cooperative Vector Matrix Layout table for a description of the layouts and detailed layout-specific rules.

Transpose indicates that the matrix loaded from memory is transposed before performing a multiply. It must come from a scalar Boolean constant instruction. If Memory Layout is RowMajorEXT or ColumnMajorEXT, Transpose must be false.

Not all component types support transposing. It is left to the client API to define which types support transposing. If Transpose is false, the matrix in memory is MxK. If Transpose is true, the matrix in memory is KxM before transposing.

Matrix Stride further qualifies how matrix elements are laid out in memory. It must be a scalar 32-bit integer and its exact semantics depend on Memory Layout. When the type of Pointer is OpTypePointer, Matrix Stride is specified in number of elements based on the Type operand of the pointer type. When the type of Pointer is OpTypeUntypedPointerKHR, Matrix Stride is specified in bytes. If Memory Layout is RowMajorEXT or ColumnMajorEXT, Matrix Stride is the distance in those units from one row or column to the next. For optimal layouts, Matrix Stride is ignored unless otherwise specified by the client API.

This instruction does not have a Memory Operands operand. The memory load has the semantics that apply when the optional Memory Operands operand of OpLoad is omitted; equivalently, its effective Memory Operands mask is None. The memory object is also treated as if it were NonWritable and Restrict. If this instruction executes, the memory locations containing the matrix must not be modified by any invocation during the entire execution of the shader. Behavior is undefined if this requirement is violated.

Whether and how the matrix access is bounds checked is defined by the client API.

The client API advertises supported combinations of the Component Type of Result Type, dimensions, Memory Layout, and Transpose.

Capability:
CooperativeVectorEXT

7

5450

<id>
Result Type

Result <id>

<id>
Pointer

<id>
Memory Layout

<id>
Transpose

<id>
Matrix Stride

OpCooperativeVectorMatrixMulEXT

Linear-algebraic matrix-vector multiply of Input by the matrix represented by Matrix. Input is treated as a column vector and is left-multiplied by the MxK matrix.

Result Type is the actual type of the result (no reinterpretation), and must be a vector type whose Component Type is a numerical type. The number of components of Result Type must equal M from the type of Matrix. If the component type of Result Type is an integer type, then its components are treated as signed if the MatrixResultSignedComponentsKHR Cooperative Matrix Operand is present and are treated as unsigned otherwise.

Matrix must have type OpTypeCooperativeVectorMatrixEXT whose Use is MatrixAKHR.

Input must have a vector type with a numerical Component Type.

Input is converted to the type indicated by Input Interpretation. This conversion step allows the input type to be converted to a smaller type that the shading language may not natively support. Non-"Packed" types are used to request arithmetic conversions. "Packed" types are used to request a bitcast conversion, e.g. if the shader wants to convert to the smaller type manually.

Input Interpretation must come from a 32-bit integer constant instruction whose value corresponds to a Cooperative Vector Matrix Component Type.

If Input Interpretation is not a Packed enum value, then the conversion is an arithmetic conversion, and Input must have K components. The supported conversions are specified by the client API. Integer to integer conversion saturates. Float to float conversion is implementation-dependent but preserves the value as accurately as reasonably possible. Float to integer conversion rounds to the nearest integer and saturates to the range of the destination type. The tie-breaking rule is implementation-dependent. Integer to float conversion is round-to-nearest-even. If the component type of Input is an integer type, then its components are treated as signed if the MatrixBSignedComponentsKHR Cooperative Matrix Operand is present and are treated as unsigned otherwise.

If Input Interpretation is a Packed enum value, then the conversion is a bitcast where element(s) of Input are bitcast to element(s) of the type described by the enum. The component type of Input must be a 32-bit unsigned integer type. The input vector must have enough components to hold K values of the packed type. If the packed type is not a power of two number of bits, then the extension that introduces the enum defines how bits are packed. Packed types with a power of two number of bits are tightly packed with lower numbered components stored in lower bits.

The client API advertises supported combinations of types, Input Interpretation, the Component Type of Matrix, and dimensions.

The order of the arithmetic operations is implementation-dependent. The internal precision of floating-point operations is defined by the client API. Integer operations used in the multiplication are performed at the precision of the component type of Result Type and are exact (with the usual wrapping rules).

Cooperative Matrix Operands is an optional Cooperative Matrix Operand literal. If not present, it is the same as specifying the Cooperative Matrix Operand NoneKHR.

Only MatrixBSignedComponentsKHR and MatrixResultSignedComponentsKHR can be set. MatrixBSignedComponentsKHR can be set only if the component type of Input is an integer type. MatrixResultSignedComponentsKHR can be set only if the component type of Result Type is an integer type.

Capability:
CooperativeVectorEXT

6+variable

5451

<id>
Result Type

Result <id>

<id>
Matrix

<id>
Input

<id>
Input Interpretation

Optional
Cooperative Matrix Operands

OpCooperativeVectorMatrixMulAddEXT

Linear-algebraic matrix-vector multiply of Input by Matrix, with Bias added to the result. Input is treated as a column vector and is left-multiplied by the matrix.

Result Type, Matrix, Input, and Input Interpretation have the same requirements and semantics as for OpCooperativeVectorMatrixMulEXT.

Bias must have a vector type whose Component Type is a numerical type. The number of components of Bias must equal M from the type of Matrix. Before it is added to the matrix-vector product, each component of Bias is converted to the component type of Result Type. The supported conversions and conversion semantics are the same as for the arithmetic conversion of Input described above. If the component type of Bias is an integer type, then its components are treated as signed if the MatrixCSignedComponentsKHR Cooperative Matrix Operand is present and are treated as unsigned otherwise.

The client API advertises supported combinations of types, Input Interpretation, the Component Type of Matrix, the component type of Bias, and dimensions.

Cooperative Matrix Operands has the same requirements and semantics as for OpCooperativeVectorMatrixMulEXT, except that MatrixCSignedComponentsKHR can also be set. MatrixCSignedComponentsKHR can be set only if the component type of Bias is an integer type.

Capability:
CooperativeVectorEXT

7+variable

5452

<id>
Result Type

Result <id>

<id>
Matrix

<id>
Input

<id>
Input Interpretation

<id>
Bias

Optional
Cooperative Matrix Operands

OpCooperativeVectorOuterProductEXT

Linear-algebraic outer product of two vectors.

Let M be the number of components in the vector A and let N be the number of components in the vector B. This instruction computes the outer product of A and B and returns the resulting MxN matrix as an abstract matrix accumulator for subsequent accumulation by OpCooperativeVectorMatrixAccumulateEXT.

Result Type must be an OpTypeCooperativeVectorMatrixEXT whose Use is MatrixAccumulatorKHR and whose dimensions are MxN.

A and B must have vector types with the same numerical Component Type. The component count of A must equal M and the component count of B must equal N.

The internal precision of floating-point operations is defined by the client API. Valid combinations of the component type of A and B and the Component Type of Result Type are determined by the client API.

Capability:
CooperativeVectorTrainingEXT

5

5453

<id>
Result Type

Result <id>

<id>
A

<id>
B

OpCooperativeVectorMatrixAccumulateEXT

Component-wise atomic accumulation of a matrix into memory.

Let M and N be the Rows and Columns of the type of Accumulator. This instruction atomically adds each component of Accumulator to the corresponding component of the MxN matrix in memory starting at Pointer. The destination matrix component type is selected by the Component Type of Accumulator, and its memory layout is determined by Memory Layout and optionally Matrix Stride. The accumulation into memory behaves as if it were a Relaxed atomic add with Device scope. Atomicity is only guaranteed for each component independently.

The internal precision of floating-point operations is defined by the client API.

Pointer is a pointer value. Its type must be an OpTypePointer or OpTypeUntypedPointerKHR. If its type is OpTypePointer, its Type operand must be a scalar or vector type. If the Shader capability was declared and Pointer’s type is OpTypePointer, 'Pointer must point into an array and any ArrayStride decoration on Pointer is ignored. The storage class of Pointer must be Workgroup, CrossWorkgroup, StorageBuffer or PhysicalStorageBuffer. Pointer points to the first element of the matrix. If the type of Pointer is OpTypePointer, its pointed-to type is otherwise ignored.

Accumulator must have type OpTypeCooperativeVectorMatrixEXT whose Use is MatrixAccumulatorKHR. Its Rows, Columns, and Component Type operands select the dimensions and component type of the destination matrix.
Memory Layout specifies how the destination matrix elements are laid out in memory. It must come from a 32-bit integer constant instruction whose value corresponds to a Cooperative Vector Matrix Layout. See the Cooperative Vector Matrix Layout table for a description of the layouts and detailed layout-specific rules. The client API defines which layouts are supported.

Matrix Stride further qualifies how matrix elements are laid out in memory. It must be a scalar 32-bit integer and its exact semantics depend on the Memory Layout. When the type of Pointer is OpTypePointer, Matrix Stride is specified in number of elements based on the Type operand of the pointer type. When the type of Pointer is OpTypeUntypedPointerKHR, Matrix Stride is specified in bytes. If Memory Layout is RowMajorEXT or ColumnMajorEXT, Matrix Stride is the distance in those units from one row or column to the next, and must be present. For optimal layouts, Matrix Stride is ignored unless otherwise specified by the client API.

Whether and how the destination access is bounds checked is defined by the client API.

Capability:
CooperativeVectorTrainingEXT

4+variable

5454

<id>
Pointer

<id>
Accumulator

<id>
Memory Layout

Optional <id>
Matrix Stride

Issues

  1. Why does this extension use ordinary vector types rather than introduce an EXT cooperative vector type?

    RESOLVED: SPV_EXT_long_vector provides equivalent types, including vectors whose component count is a specialization constant. Reusing ordinary vectors also makes the existing arithmetic, conversion, load, and store instructions available without extending each of them.

  2. Why are matrix load and matrix-vector multiply separate instructions?

    RESOLVED: To more closely match dx::linalg.

  3. Should this extension reuse OpTypeCooperativeMatrixKHR?

    RESOLVED: No. This extension defines a dedicated abstract type with similar parameters. Cooperative matrix values have broader value semantics and a different set of supported instructions.

  4. How are loaded matrices kept distinct from outer-product accumulators?

    RESOLVED: They use distinct MatrixAKHR and MatrixAccumulatorKHR parameterizations of OpTypeCooperativeVectorMatrixEXT, reusing the existing Cooperative Matrix Use operand kind. This prevents a loaded matrix from being passed to OpCooperativeVectorMatrixAccumulateEXT and prevents an outer product from being passed to OpCooperativeVectorMatrixMulEXT or OpCooperativeVectorMatrixMulAddEXT.

  5. Why is Component Type a parameter of OpTypeCooperativeVectorMatrixEXT?

    RESOLVED: It determines the format loaded from memory for MatrixAKHR and the arithmetic and memory format used for MatrixAccumulatorKHR. Making it a type parameter also makes incompatible matrix formats distinct SPIR-V types. It uses the Cooperative Vector Matrix Component Type enum rather than a SPIR-V scalar type so that matrix formats without a corresponding scalar type, including the FP8 formats introduced by SPV_NV_cooperative_vector, can be represented.

  6. Why are Memory Layout and Transpose operands of the memory instructions rather than parameters of OpTypeCooperativeVectorMatrixEXT?

    RESOLVED: They describe how a memory instruction accesses a matrix and do not need to be part of the identity of the abstract matrix type. Once loaded, the matrix has the logical dimensions specified by its type regardless of its source layout or whether it was transposed. Keeping them on the memory instructions also more closely matches dx::linalg and permits matrix values loaded in different ways to have the same type.

  7. Why does OpTypeCooperativeVectorMatrixEXT not have a Scope operand like OpTypeCooperativeMatrixKHR?

    RESOLVED: Cooperative-vector matrices and accumulators are always logically owned by a single invocation. A Scope operand would be fixed to Invocation and carry no additional information.

  8. Should the abstract intermediate values be storable, copyable, selectable, or usable as function parameters and return values?

    RESOLVED: Yes. They may flow through ordinary SPIR-V value operations. There are no other type-specific operations on them. The Use parameter prevents loaded matrices and outer-product accumulators from being interchanged.

  9. How are out-of-bounds accesses handled?

    RESOLVED: Bounds checking is a property of the client API and does not require a SPIR-V operand. A client API may provide modes in which these operations are bounds checked and modes in which they are not.

  10. How are offsets and strides represented for memory accesses?

    RESOLVED: As with cooperative matrix loads and stores, the pointer operand points to the first element accessed, so any offset is folded into the access-chain instruction used to form the pointer. When the pointer has an OpTypePointer type, stride is measured in elements of its pointed-to type. When the pointer has an OpTypeUntypedPointerKHR type, stride is measured in bytes. This differs from SPV_NV_cooperative_vector, whose matrix and bias instructions have explicit byte-offset operands and whose matrix strides are always measured in bytes.

  11. Why does OpCooperativeVectorMatrixMulAddEXT take a vector value for Bias rather than load it from memory?

    RESOLVED: The shader can load an ordinary vector before the instruction, giving it explicit control over the address, memory semantics, bounds checking, and the bias’s source type. The type of the vector supplies the bias type without a separate interpretation operand, and the client API advertises which bias and result type combinations are supported.

  12. May the component type of A and B differ from the Component Type of the result of OpCooperativeVectorOuterProductEXT?

    RESOLVED: Yes. As in SPV_NV_cooperative_vector, A and B must have the same component type, but the accumulator component type is selected independently. The client API defines the supported combinations and the precision of the operations.

  13. Can the training instruction support only TrainingOptimalEXT layout? If so, can the Memory Layout and Matrix Stride instruction operands be removed?

    RESOLVED: There is no restriction on layout at the universal SPIR-V level. The current client API may support only TrainingOptimalEXT layout and ignore Matrix Stride, but future client APIs may relax this.

  14. Why is there no replacement for OpCooperativeVectorReduceSumAccumulateNV?

    RESOLVED: Despite its name, that instruction performs component-wise atomic adds rather than a reduction. Extensions that allow vector operands for atomic add provide the same operation more generally.

Revision History

Rev Date Author Changes

1

2026-07-27

Jeff Bolz

Initial revision