Mila 0.13.48
Deep Neural Network Library
Loading...
Searching...
No Matches
Dnn.Components.RmsNorm Module Reference

Exported Modules

module  Dnn.Tensor
module  Compute.DeviceId
module  Compute.Device
module  Serialization.Tensor
module  Dnn.TensorInitializers
module  Compute.DeviceType
module  Dnn.ITensor
module  Compute.ExecutionContext
module  Serialization.Mode
module  Compute.MemoryResource
module  Compute.OperationTraits
module  Dnn.TensorTypes
module  Dnn.TensorDataType
module  Compute.UnaryOperation
module  Compute.IExecutionContext
module  Compute.CpuMemoryResource
module  Dnn.Component
module  Dnn.TensorDataTypeTraits
module  Serialization.ModelArchive
module  Compute.DeviceTypeTraits
module  Compute.ExecutionContextFactory
module  Dnn.Components.RmsNormConfig
module  Dnn.TensorPartitioning
module  Dnn.ComponentType

Classes

class  Mila::Dnn::RmsNorm< TDeviceType, TPrecision >
 Device-templated RMS Normalization component. More...

Typedefs

using ComponentBase = Component<TDeviceType, TPrecision>
using MR = typename DeviceTypeTraits<TDeviceType>::memory_resource
using OpType = typename OperationTraits<OperationType::RmsNormOp, TDeviceType, TPrecision>::type
using TensorType = Tensor<TPrecision, MR>

Functions

 RmsNorm (const std::string &name, const RmsNormConfig &config, std::optional< DeviceId > device_id=std::nullopt)
 ~RmsNorm () override=default
void allocateParameters (const shape_t *input_shape)
TensorTypebackward (const TensorType &input, const TensorType &output_grad)
 Run backward pass and return a reference to the component-owned input-gradient tensor.
void createOperation ()
TensorTypeforward (const TensorType &input)
 Run forward pass and return a reference to the component-owned output tensor.
DeviceId getDeviceId () const override
 Get the compute device id associated with this component.
std::vector< ITensor * > getGradients () const override
 Return non-owning pointers to parameter gradient tensors.
MemoryStats getMemoryStats () const override
 Return the current memory allocation breakdown for this component.
std::vector< ITensor * > getParameters () const override
 Return non-owning pointers to parameter tensors.
const ComponentType getType () const override
 Get the component type identifier.
void initializeGradients ()
void loadParameter (const std::string &name, const ITensorBlob &blob) override
 Load a parameter from serialized tensor data.
void onBuilding (const BuildContext &build_context) override
 Hook invoked by build() to allocate component buffers.
void onExecutionContextSet () override
 Lifecycle hook: Called immediately after ExecutionContext is set.
void onTrainingModeChanging (TrainingMode training_mode) override
 Hook called before TrainingMode transitions.
size_t parameterCount () const override
 Return number of trainable parameters.
void save_ (ModelArchive &archive, SerializationMode mode) const override
void synchronize () override
 Wait for outstanding device work submitted by this component.
std::string toString () const override
 Produce a short, human-readable description of the component.
void validateInputShape (const shape_t &input_shape) const
void zeroGradients () override
 Clear all model-owned gradients for this component.

Variables

std::shared_ptr< TensorTypebias_ { nullptr }
std::shared_ptr< TensorTypebias_grad_ { nullptr }
RmsNormConfig config_
std::unique_ptr< TensorTypeinput_grad_ { nullptr }
std::shared_ptr< OpTypeoperation_ { nullptr }
shape_t outer_shape_
std::unique_ptr< TensorTypeoutput_ { nullptr }
std::optional< TensorTypeoutput_view_
std::unique_ptr< IExecutionContextowned_exec_context_ { nullptr }
std::shared_ptr< TensorTypeweight_ { nullptr }
std::shared_ptr< TensorTypeweight_grad_ { nullptr }

Files

file  /__w/Mila/Mila/Mila/Src/Dnn/Components/Normalization/RmsNorm/RmsNorm.ixx
 RMS Normalization component.