|
Mila
Deep Neural Network Library
|
Memory allocation statistics for component inspection. More...
#include <cstddef>#include <string>#include <format>import Dnn.TensorDataTypeTraits;import Dnn.TensorDataType;import Dnn.TensorTypes;Classes | |
| struct | Mila::Dnn::MemoryStats |
| Memory allocation breakdown for a single component. More... | |
Namespaces | |
| namespace | Mila |
| Mila main API namespace. | |
Functions | |
| MemoryStats | Mila::Dnn::operator+ (MemoryStats lhs, const MemoryStats &rhs) noexcept |
| Aggregate two MemoryStats instances. | |
| template<TensorDataType TDataType> | |
| constexpr std::size_t | Mila::Dnn::storageBytes (dim_t element_count) noexcept |
| Storage bytes occupied by an element count of a given tensor data type. | |
Memory allocation statistics for component inspection.
Provides a breakdown of GPU and host memory allocated by a component across the three lifecycle-defined allocation categories: parameters, state, and gradients.
|
constexprexportnoexcept |
Storage bytes occupied by an element count of a given tensor data type.
The counterpart to Tensor::getStorageSize() for buffers that do not exist yet – getRequiredMemory() sizes allocations before build() makes them. Sub-byte types are the reason this cannot be a multiply: FP4 packs two elements per byte, so element_count * size_in_bytes overstates a packed weight by exactly 2x.
| element_count | Logical elements, not bytes. |