hamer-p150 / code /hamer /kernels /cmm /fused_mover.cpp
changh95's picture
Optimized build (2026-10-03): model call 3.49 ms, device 3.36 ms
58ba6df verified
Raw History Blame Contribute Delete
916 Bytes
// SPDX-FileCopyrightText: © 2026 Tenstorrent Inc.
// SPDX-License-Identifier: Apache-2.0
// Round 8: cmm (mover1) followed by the add+LN epilogue in ONE program on the cmm grid.
// FUSED_PAR 0 (NCRISC): mover1 weights, then the add+LN reader (x resident, gamma / beta, scaler, the next cmm's
// weight prefetch). FUSED_PAR 1 (BRISC): mover1 activations + bias (the cmm output stays in its CB, CMM_ADDLN),
// then the add+LN writer (statistics gather, LN output). The add+LN arguments follow mover1's (ADDLN_CT0 / ADDLN_RT0).
#define kernel_main cmm_mover_main
#include "mover1.cpp"
#undef kernel_main
#define ADDLN_KERNEL_MAIN void addln_part()
#if FUSED_PAR == 0
#include "../addln/reader.cpp"
#else
#include "../addln/writer.cpp"
#endif
void kernel_main() {
#if defined(ADDLN_PROF) && FUSED_PAR == 1
{DeviceZoneScopedN("W-mover"); cmm_mover_main();}
#else
cmm_mover_main();
#endif
addln_part();
}