Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::Compute::IKvCacheLifecycle Struct Referenceabstractexport

Capability interface for KV-cache state management. More...

Inheritance diagram for Mila::Dnn::Compute::IKvCacheLifecycle:

Public Member Functions

virtual ~IKvCacheLifecycle ()=default
virtual void initializeKvCache (int batch_size, int max_sequence_length)=0
 Allocate the KV cache for a given batch size and maximum sequence length.
virtual void resetKvCache ()=0
 Reset the KV cache to an empty state, preserving the allocation.

Detailed Description

Capability interface for KV-cache state management.

Implemented by attention operations (GQA, MHA) that allocate and maintain key/value caches across autoregressive decode steps. This concern is orthogonal to positional dispatch — an operation may implement both IPositionalUnaryOp and IKVCacheLifecycle.

Constructor & Destructor Documentation

◆ ~IKvCacheLifecycle()

virtual Mila::Dnn::Compute::IKvCacheLifecycle::~IKvCacheLifecycle ( )
virtualdefault

Member Function Documentation

◆ initializeKvCache()

virtual void Mila::Dnn::Compute::IKvCacheLifecycle::initializeKvCache ( int batch_size,
int max_sequence_length )
pure virtual

◆ resetKvCache()


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