For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo struct
MaskStrategy
struct MaskStrategy
Implemented traitsβ
AnyType,
Copyable,
ImplicitlyCopyable,
ImplicitlyDeletable,
Movable,
RegisterPassable,
TrivialRegisterPassable
comptime membersβ
BITMASKβ
comptime BITMASK = MaskStrategy(Int32(16))
Mask provides its own 32-bit visibility bitmask per 32-col batch via MHAMask.mask_bits(). Subsumes the historical LOWER_TRIANGULAR / UPPER_TRIANGULAR (and OUT_OF_BOUNDS for masks that fold it into mask_bits).
COMPUTEDβ
comptime COMPUTED = MaskStrategy(Int32(4))
Mask where the call operator must be used to compute the masked value.
NO_MASKβ
comptime NO_MASK = MaskStrategy(Int32(0))
No mask is to be applied.
OUT_OF_BOUNDSβ
comptime OUT_OF_BOUNDS = MaskStrategy(Int32(8))
Check if we are out of bounds, e.g. clip at num_keys after a COMPUTED mask. Used in combination with COMPUTED and as the kernel-hardcoded "no mask, just clip" form (e.g. hot-path optimizations in softmax_warp that bypass BITMASK when the runtime mask status is NO_MASK).
Methodsβ
__init__β
def __init__(value: Int32) -> Self
__eq__β
__ne__β
__contains__β
__and__β
def __and__(self, other: Self) -> Self
__or__β
def __or__(self, other: Self) -> Self
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!