jburtoft's picture
nki-kernel-bench v0.1
0fef070
Raw History Blame Contribute Delete
505 Bytes
"""Inputs for nkilib_dynamic_elementwise_add (library test): a, b ~ N(0,1) bf16, num_m_tiles = [[M/128]] int32."""
import ml_dtypes
import numpy as np
SHAPES = {"m256_h512": (256, 512), "m2048_h2048": (2048, 2048)}
def make_inputs(seed, shape_id):
M, H = SHAPES[shape_id]
rng = np.random.default_rng(seed)
a = rng.standard_normal((M, H)).astype(ml_dtypes.bfloat16)
b = rng.standard_normal((M, H)).astype(ml_dtypes.bfloat16)
return (a, b, np.array([[M // 128]], dtype=np.int32)), {}