Download dataset/elementwise/nkilib_dynamic_elementwise_add/inputs.py from jburtoft/nki-kernel-bench: direct link, hf CLI and curl.
- Browser
- Download file 505 Bytes
-
https://huggingface.co/datasets/jburtoft/nki-kernel-bench/resolve/main/dataset/elementwise/nkilib_dynamic_elementwise_add/inputs.py
- Command line
-
hf download hf://datasets/jburtoft/nki-kernel-bench/dataset/elementwise/nkilib_dynamic_elementwise_add/inputs.py
-
curl -L -o inputs.py https://huggingface.co/datasets/jburtoft/nki-kernel-bench/resolve/main/dataset/elementwise/nkilib_dynamic_elementwise_add/inputs.py
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)), {} | |