Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::QwenAttentionBlockWorkspace< TDeviceType, TPrecision > Struct Template Referenceexport

Transformer-owned shared activation workspace for QwenAttentionBlock (pooling). More...

Public Types

using MR = typename DeviceTypeTraits<TDeviceType>::memory_resource
using TensorType = Tensor<TPrecision, MR>

Public Member Functions

std::size_t deviceStorageBytes () const
 Total device bytes held, for memory accounting.

Public Attributes

std::shared_ptr< TensorType > attn
std::shared_ptr< TensorType > ffn_act
std::shared_ptr< TensorType > ffn_down
std::shared_ptr< TensorType > ffn_in
std::shared_ptr< TensorType > gate
std::shared_ptr< TensorType > gate_up
std::shared_ptr< TensorType > gated
std::shared_ptr< TensorType > k
std::shared_ptr< TensorType > k_normed
std::shared_ptr< TensorType > normed
std::shared_ptr< TensorType > o
std::shared_ptr< TensorType > q
std::shared_ptr< TensorType > q_normed
std::shared_ptr< TensorType > qkv
std::shared_ptr< TensorType > query_gate
std::shared_ptr< TensorType > res1
std::shared_ptr< TensorType > stream
std::shared_ptr< TensorType > v

Detailed Description

template<DeviceType TDeviceType, TensorDataType TPrecision>
requires PrecisionSupportedOnDevice<TPrecision, TDeviceType>
struct Mila::Dnn::QwenAttentionBlockWorkspace< TDeviceType, TPrecision >

Transformer-owned shared activation workspace for QwenAttentionBlock (pooling).

One slot set serves every layer: the inference path is strictly sequential, so exactly one block is live at a time. Slots are sized [B, chunk, width]; components view prefixes. The single stream slot is alias-safe – a block's input is last read at res_1, mid-block, and only overwritten by its own res_2 at block end.

The DeltaNet block will need a DIFFERENT workspace (chunk-parallel delta-rule buffers, convolution staging), which is exactly the mismatch section 7 records against ITransformerBlock's concrete GqaState. Keeping this struct per-block-kind rather than per-family is what leaves room for that.


The documentation for this struct was generated from the following file: