|
Mila
Deep Neural Network Library
|
Configuration for Rotary Position Embedding (RoPE) component. More...
#include <stdexcept>#include <string>#include <sstream>#include <utility>import Serialization.Metadata;import Dnn.TensorTypes;import Dnn.ComponentConfig;import Dnn.Component;Classes | |
| class | Mila::Dnn::RopeConfig |
Namespaces | |
| namespace | Mila |
| Mila main API namespace. | |
Enumerations | |
| enum class | Mila::Dnn::RotaryLayout { WholeHead , RotaryPrefix } |
| Which dimension pairs a partial rotary rotates. More... | |
Configuration for Rotary Position Embedding (RoPE) component.
Provides construction, validation and serialization for RoPE configuration.
Design principle (Mila-wide):
Required (constructor): channels, n_heads, n_kv_heads, max_seq_len. Optional (fluent): base (default 10000.0f), rotary_dim (default 0 = full head_dim).
Typical usage:
|
exportstrong |
Which dimension pairs a partial rotary rotates.
Families genuinely disagree.
Only meaningful when rotary_dim is below head_dim; the two coincide at full rotary. Getting it wrong is silent: both layouts rotate the same NUMBER of dimensions and produce a plausible result, and at a short prompt the angles are small enough that generation still looks correct. It diverges with context.