Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
LanguageNetwork.ixx File Reference

Abstract base for language model networks. More...

#include <string>
import Dnn.TensorDataTypeTraits;
import Dnn.TensorDataType;
import Compute.DeviceTypeTraits;
import Compute.DeviceType;
import Dnn.TensorTypes;
import Dnn.Tensor;
import Dnn.Network;

Classes

class  Mila::Dnn::LanguageNetwork< TDeviceType, TPrecision >

Namespaces

namespace  Mila
 Mila main API namespace.
namespace  Mila::Dnn

Detailed Description

Abstract base for language model networks.

LanguageNetwork sits between Network and concrete transformer implementations (LlamaTransformer, GptTransformer). It defines the virtual compute interface — forward, backward, prefill, and decode — that LanguageModel uses to drive the autoregressive generation loop without knowing the concrete network type or its quantization policy template parameters.

The virtual boundary here is intentionally coarse: one virtual dispatch per decode step is negligible cost, and it lets LlamaModel and GptModel remain free of quantization and architecture template parameters that belong only at the transformer level.

Hierarchy

Network<TDev, TPrec> └─ LanguageNetwork<TDev, TPrec> [this file] └─ LlamaTransformer<TDev, TPrec, TWeightQuantization, TKvCachePolicy> └─ GptTransformer<TDev, TPrec>