For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
mhc_post_tile
def mhc_post_tile[dtype: DType, OutLayoutType: TensorLayout, StreamsLayoutType: TensorLayout, YLayoutType: TensorLayout, //, hc_mult: Int, width: Int, non_temporal: Bool = False](output: TileTensor[dtype, OutLayoutType, MutAnyOrigin], streams: TileTensor[dtype, StreamsLayoutType, ImmutAnyOrigin], y: TileTensor[dtype, YLayoutType, ImmutAnyOrigin], post: SIMD[.float32, hc_mult], comb: SIMD[.float32, (hc_mult * hc_mult)], row: Int, col: Int)
Writes one width-wide slice of one token's mHC streams back.
Covers columns [col, col + width). Every load is issued before the
first FMA, so all hc_mult + 1 vectors are in flight together. Math is
fp32, rounded to dtype once.
Parameters:
- dtype (
DType): Element type of the streams,yand the output. - OutLayoutType (
TensorLayout): Layout ofoutput. - StreamsLayoutType (
TensorLayout): Layout ofstreams. - YLayoutType (
TensorLayout): Layout ofy. - hc_mult (
Int): Number of parallel residual streams. - width (
Int): Elements per vector access. - non_temporal (
Bool): Whether to mark the loads and stores non-temporal.
Args:
- output (
TileTensor[dtype, OutLayoutType, MutAnyOrigin]): Updated streams. Shape:[num_rows, hc_mult, hidden]. - streams (
TileTensor[dtype, StreamsLayoutType, ImmutAnyOrigin]): Incoming streams. Shape:[num_rows, hc_mult, hidden]. - y (
TileTensor[dtype, YLayoutType, ImmutAnyOrigin]): Sublayer output. Shape:[num_rows, hidden]. - post (
SIMD[.float32, hc_mult]):post[row, :], the weight ofyin each output stream. - comb (
SIMD[.float32, (hc_mult * hc_mult)]):comb[row, :, :]row-major, socomb[j * hc_mult + k]is the weight of input streamjin output streamk. - row (
Int): Token index. - col (
Int): First column of the slice.