Archived
checkpoint: nomic config key aliases, RAD_MAP_TRANSPOSE honouring src_index
meta_from_config_json reads the nomic spellings (n_layer, n_embd, n_head, n_inner, n_positions, moe_top_k, layer_norm_epsilon, rotary_emb_base) as fallbacks in the same chain as the usual keys; existing checkpoints parse as before. RAD_MAP_TRANSPOSE can first take one expert's sub-tensor of a stacked table: src_index[0] picks the dim-0 sub-tensor of a rank-3 stack, or, with src_rows[0] > 0, the row block of a rank-2 stack flattened over its rows. map_transpose_slice() declares it; map_slice() takes the same optional sub_rows. Tests in checkpoint_test cover the aliases, the [8,4,3] case, the flattened case and an out-of-range index.
This commit is contained in:
1 parent
157450a82b
commit
4853db97db
4 files changed
+182
-16
No files matched your search
+7
-2
@@ -597,7 +597,10 @@ typedef struct RadNameMap {
|
||||
|
||||
/* RAD_MAP_ROWS only: piece i is rows [src_index[i], src_index[i] + src_rows[i]) of the 2-D (or
|
||||
* higher, rows along dim 0) tensor src[i]; the pieces join along dim 0. RAD_MAP_COLS: columns
|
||||
* [src_index[0], src_index[0] + src_rows[0]) of src[0]'s last dimension. */
|
||||
* [src_index[0], src_index[0] + src_rows[0]) of src[0]'s last dimension. RAD_MAP_TRANSPOSE with
|
||||
* src_index[0] >= 0: rows [src_index[0] * src_rows[0], (src_index[0] + 1) * src_rows[0]) when
|
||||
* src[0] is rank 2 and src_rows[0] > 0 (a stack flattened over rows); otherwise src_index[0] is
|
||||
* the dim-0 sub-tensor of a higher-rank stack. */
|
||||
int64_t src_rows[8];
|
||||
} RadNameMap;
|
||||
|
||||
@@ -624,7 +627,9 @@ typedef struct RadNameMap {
|
||||
* columns it is fed.
|
||||
*
|
||||
* RAD_MAP_TRANSPOSE swaps the last two dimensions of src[0] in each leading slice, [.., a, b] to
|
||||
* [.., b, a]: a linear a checkpoint keeps as (in, out), where the GEMMs read (out, in).
|
||||
* [.., b, a]: a linear a checkpoint keeps as (in, out), where the GEMMs read (out, in). With
|
||||
* src_index[0], it first takes one expert's sub-tensor (see src_rows): a stacked expert table kept
|
||||
* [n_expert, in, out] or flattened [n_expert * in, out].
|
||||
*
|
||||
* RAD_MAP_EMA is an exponential-moving-average codebook as EnCodec-style quantisers keep it: src[0]
|
||||
* the embedding sums [bins, ...], src[1] the cluster usage [bins], and the codebook is each row
|
||||
|
||||
Reference in new issue
Block a user