Skip to main content

Mojo struct

AlibiScoreMod

@register_passable(trivial) struct AlibiScoreMod[num_heads: Int]

AlibiScoreMod adds the appropriate ALiBi constant bias to attention score.

Implemented traits

AnyType, Copyable, Movable, ScoreModTrait, UnknownDestructibility

Aliases

name_str

alias name_str = __init__[__mlir_type.!kgen.string]("alibi")

Methods

score_mod

score_mod[dtype: DType, width: Int, //, *, element_type: DType = int32](self, coord: IndexList[4, element_type=element_type], score_vec: SIMD[dtype, width], max_prompt_len: Int) -> SIMD[dtype, width]

Was this page helpful?