This document is relevant for: Trn2, Trn3
nki.isa.memset#
- nki.isa.memset(dst: NkiTensor, value, engine=engine.unknown, name=None)[source]#
Initialize
dstby filling it with a compile-time constantvalue, using Vector or GpSimd Engine. The memset instruction supports all valid NKI dtypes (see Supported Data Types).dstcan have at most four free dimensions (maximum rank 5, including the partition dimension).- Parameters:
dst – destination tile to initialize.
value – the constant value to initialize with
engine – specify which engine to use for memset:
nki.isa.engine.vectorornki.isa.engine.gpsimd;nki.isa.engine.unknownby default, lets compiler select the best engine for the given input tile shape
Note
For x4 packed types (
float8_e4m3fn_x4,float8_e5m2_x4,float4_e2m1fn_x4), onlyvalue=0is supported.Note
float8_e8m0fnuonly encodes powers of two from2**-127to2**127and NaN. A warning is raised whenvalueis anything else, such as zero, a negative number, infinity, or a non-power of two.
This document is relevant for: Trn2, Trn3