Download code/hamer/kernels/hgemv/prefetch.cpp from changh95/hamer-p150: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/changh95/hamer-p150/resolve/main/code/hamer/kernels/hgemv/prefetch.cpp
- Command line
-
hf download hf://changh95/hamer-p150/code/hamer/kernels/hgemv/prefetch.cpp
-
curl -L -o prefetch.cpp https://huggingface.co/changh95/hamer-p150/resolve/main/code/hamer/kernels/hgemv/prefetch.cpp
1.05 kB
| // SPDX-FileCopyrightText: © 2026 Tenstorrent Inc. | |
| // SPDX-License-Identifier: Apache-2.0 | |
| // Round 10: MANO-head cross-op weight prefetch (tt_kernels.hgemv(prefetch=...)). Runs on the cores of the NEXT hgemv | |
| // (disjoint from this program's GEMV cores): each copies its packed weight column run (one contiguous DRAM run) into | |
| // its shard of a persistent L1 buffer, which the next hgemv uses as its weight CB (HG_WL1). The next program starts | |
| // only after this one has finished, so no further synchronization is needed. | |
| // runtime: active, w_addr, bank, bank offset, dst (L1), bytes | |
| void kernel_main() { | |
| if (!get_arg_val<uint32_t>(0)) { | |
| return; | |
| } | |
| const uint32_t w_addr = get_arg_val<uint32_t>(1), bank = get_arg_val<uint32_t>(2), off = get_arg_val<uint32_t>(3); | |
| const uint32_t dst = get_arg_val<uint32_t>(4), bytes = get_arg_val<uint32_t>(5); | |
| noc_async_read(get_noc_addr_from_bank_id<true>(bank, w_addr + off), dst, bytes); | |
| noc_async_read_barrier(); | |
| } | |