网页 综合 更新时间 2026-04-27 17:00:50

D3D12 LinAlg Matrix Preview - DirectX Developer Blog

自动蜘蛛 devblogs.microsoft.com 正文约 6000 字
D3D12 LinAlg Matrix Preview - DirectX Developer Blog
Welcome to the D3D12 LinAlg Matrix Preview release!
Today, we are excited to announce the preview release for the D3D12 Linear Algebra APIs! This feature set unlocks comprehensive hardware acceleration for Matrix-oriented operations across various use cases. Previously, we announced the WaveMMA and Cooperative Vectors features which supported narrow matrix operation use cases; the LinAlg feature set being announced today subsumes these APIs into a singular set of orthogonal APIs. With today’s announcement, we are enabling developers to both efficiently drive neural rendering techniques directly from individual shader threads in real-time graphics pipelines and utilize higher bandwidth matrix MMA operations for ML and image processing applications, all in a singular combined API.
The application of machine learning techniques is now ubiquitous across the industry. For graphics development, neural network based rendering methods, which we’ve been calling neural rendering, are quickly growing in popularity. At the same time, offloading high bandwidth matrix compute onto the GPU is unquestionably at an all-time high. As such, GPU vendors continue to adopt and expand specialized hardware for matrix operations, and the new LinAlg Matrix APIs put the power of that hardware into your hands!
This blog post is part of the larger SM6.10 preview announcement. See the parent blog post for the full feature set. Also see the GDC 2026 blog putting this feature in context of the overall ML story for DirectX here.
Unlocking efficient use of the GPU’s specialized matrix hardware is the core motivation for the introduction of the LinAlg Matrix APIs. Thanks to the preview process, we were able to go back to the drawing board and evolve the previous design. Thank you for all the feedback and please keep it coming! We will continue to evolve the LinAlg Matrix APIs over the preview period in response to real world feedback.
The new API supports three modes of operations (called Matrix Scopes), motivating different key matrix use cases:
MatrixScope::Thread (previously previewed as Cooperative Vectors)
A thread-scope matrix is expected to be used within the context of a graphics shader thread (SIMT mode). A potential example of such is running inference on a neural network trained to compute lighting, here the neural network solution would be a drop-in replacement to classical physics-based computations. Thread-scope matrices enable incremental adoption of ML techniques into graphics shaders. The compiler can efficiently map these inferencing operations to dedicated hardware accelerators.
MatrixScope::Wave (previously previewed as WaveMMA)
High bandwidth dedicated matrix multiplication hardware is increasingly available in contemporary GPUs. A wave-scope matrix surfaces access to this hardware for complex machine learning and image processing applications. A typical application may employ smaller matrices or manually tiled larger matrices for hardware accelerated matrix-matrix multiplications.
MatrixScope::ThreadGroup
MatrixScope::ThreadGroup is new to the LinAlg Matrix API. It is compatible with all the operations of a wave-scope matrix above serving a different use case. The inputs and weight matrices used in LLM-like networks are much larger than allowed sizes for wave-scope matrices. To serve this case with a wave-scope matrix, manual tiling is mandatory, and for cross-hardware performance, multiple different kernels would be required. Conversely, a threadgroup-scope matrix’s larger size avoids manual tiling. The tiling decision is shifted to the driver, allowing you to ship a single implementation while still retaining optimal tiling.
Shader Model 6.10 introduces high level linear algebra APIs building on top of the Long Vectors and Native DXIL Vectors features released as part of SM6.9. The high level API is converted into a “mid level” API consumed by the driver. The mid level API maintains high levels of context, enabling the driver to take advantage of the underlying hardware capabilities. Meanwhile, the high level API enables better source level usage rules and fast iteration. This API is centered on the new Matrix type provided as a permissively licensed HLSL source header. Depending on the declaration of a specific Matrix instance, various operations are enabled or disabled at compilation time. For example, MatrixScope::Thread is roughly limited to matrix-vector operations, while MatrixScope::Wave and MatrixScope::ThreadGroup are roughly limited to matrix-matrix operations. You can view the full table of available operations in the LinAlg spec.
Below are examples of primary use cases for the Matrix header, each serving a different goal with different available operations. You can find some of these examples here on GitHub.
There are a couple of D3D methods for converting weight and bias matrix data between formats:
For instance, D3D12_LINEAR_ALGEBRA_MATRIX_LAYOUT_MUL_OPTIMAL is a device-specific layout for optimal use with the Matrix-Vector operations such as MultiplyAdd in the code example above.
See ID3D12DevicePreview::GetLinearAlgebraMatrixConversionDestinationInfo() and ID3D12CommandListPreview::ConvertLinearAlgebraMatrix() in the D3D LinAlg spec here.
LinAlg is part of Shader Model 6.10, currently in preview. This requires:
To enable the LinAlg preview with the AgilitySDK from above, in code turn on experimental feature support before creating a D3D12 device:
The API provides many different dimensions of hardware support. To fully explore the granular API, see the documentation here.
To quickly get started with LinAlg, query the device for Tier 1 support:
Supported Tier 1 features are listed here. Other tiered levels of support are also found in that spec.
As usual, Day One PIX support is available. Check here for the latest information.
Linear Algebra Matrix is supported on AMD Radeon™ RX 9000 series graphics products using the AMD Software: AgilitySDK Developer Preview Edition 25.30.41.02 driv
访问原文 返回搜索 https://devblogs.microsoft.com/directx/d3d12-linalg-preview/
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。