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

Device-templated fused SoftmaxCrossEntropy loss module. More...

#include <memory>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <type_traits>
#include <cstdint>
#include <stdexcept>
import Serialization.ModelArchive;
import Compute.DeviceTypeTraits;
import Dnn.Components.CrossEntropyConfig;
import Dnn.Component;
import Compute.CpuMemoryResource;
import Dnn.ITensor;
import Compute.OperationTraits;
import Serialization.Mode;
import Dnn.Tensor;
import Compute.MemoryResource;
import Dnn.TensorDataType;
import Dnn.TensorDataTypeTraits;
import Compute.Device;
import Compute.DeviceId;
import Dnn.TensorTypes;
import Compute.ExecutionContext;
import Compute.DeviceType;

Classes

class  Mila::Dnn::SoftmaxCrossEntropy< TDeviceType, TPrecision >
 Fused SoftmaxCrossEntropy loss module (device-templated). More...

Namespaces

namespace  Mila
 Mila main API namespace.

Detailed Description

Device-templated fused SoftmaxCrossEntropy loss module.

Resolves its backend operation at compile time via OperationTraits<CrossEntropyOp, TDeviceType, TPrecision>, which maps to the fused CudaSoftmaxCrossEntropyOp on the CUDA path. The operation implements the fused softmax + cross-entropy for numerical stability and performance.

STATUS: Component modernized to the current Component lifecycle and migrated off the legacy OperationRegistry. CUDA dispatch is wired (FP32/BF16); the CPU path is not yet provided (CpuSoftmaxCrossEntropyOp is excluded from the build), so a Cpu instantiation is a deliberate hard compile error. Targeted for Llama training support; the component has no live instantiation site yet, so its template body is not exercised by the build until one exists (e.g. a unit test).