| 1658 | // every address load_card stores, in a card and in a layer: a worker moves them to where it mapped the holder's memory |
| 1659 | template <typename F> |
| 1660 | void card_ptrs(CardW& c, F f) { |
| 1661 | auto q8 = [&](Q8S& s) { f(s.q), f(s.d); }; |
| 1662 | auto dw = [&](DW& d) { f(d.p), q8(d.s), f(d.ep); }; |
| 1663 | f(c.vmap), f(c.head_norm), q8(c.head_down), q8(c.head_up), dw(c.out), dw(c.ple_key), dw(c.ple_value), f(c.ple_norm_key), |
| 1664 | f(c.ple_norm_query), f(c.ple_norm_conv), f(c.ple_conv); |
| 1665 | for (LayerW& w : c.L) { |
| 1666 | for (int h = 0; h < 2; ++h) f(w.hc_norm[h]), q8(w.hc_down[h]), q8(w.hc_up[h]), f(w.hc_inj[h]); |
| 1667 | f(w.router), dw(w.qkv), dw(w.z), dw(w.ssm_out), dw(w.qkvz), f(w.ab), f(w.conv), f(w.alpha), f(w.beta), f(w.ssm_a), |
| 1668 | f(w.dt_bias), f(w.ssm_norm); |
| 1669 | dw(w.wq), dw(w.wk), dw(w.wv), dw(w.wo), f(w.q_norm), f(w.k_norm), f(w.idx_wq), f(w.idx_wk), dw(w.idx_qk), f(w.idx_qn), |
| 1670 | f(w.idx_kn); |
| 1671 | dw(w.gu_e), dw(w.down_e), dw(w.sh_gu), dw(w.sh_down); |
| 1672 | } |
| 1673 | for (const char*& p : c.ec_host_gu) f(p); |
| 1674 | for (const char*& p : c.ec_host_dn) f(p); |
| 1675 | } |
| 1676 | #if !FNX_27B |
| 1677 | static_assert(sizeof(LayerW) == 952, "LayerW changed: put its new addresses in card_ptrs, then update this size"); |
| 1678 | #endif |