openaccel-lab
aien-dev/openaccel-lab
Brought by drakestapleton
openaccel-lab / workloads / reduce_max / workload.json
| 1 | { |
| 2 | "name": "reduce_max", |
| 3 | "family": "reduction", |
| 4 | "summary": "y[0] = max of n f32 elements; OpenCL/CUDA reduce in a 256-wide local tree per block, then one block reduces the block partials", |
| 5 | "provenance": "authored for OpenAccel Lab (Apache-2.0)", |
| 6 | "params": { |
| 7 | "n": 100003 |
| 8 | }, |
| 9 | "derived": { |
| 10 | "nb": "(n + 255) // 256" |
| 11 | }, |
| 12 | "cases": [ |
| 13 | {}, |
| 14 | {"n": 1}, |
| 15 | {"n": 257} |
| 16 | ], |
| 17 | "shrink": { |
| 18 | "n": {"min": 1} |
| 19 | }, |
| 20 | "inputs": [ |
| 21 | {"name": "x", "dtype": "f32", "shape": ["n"], "gen": {"kind": "normal4", "mean": -3.0, "std": 2.0}} |
| 22 | ], |
| 23 | "outputs": [ |
| 24 | {"name": "y", "dtype": "f32", "shape": [1]} |
| 25 | ], |
| 26 | "scratch": [ |
| 27 | {"name": "part", "dtype": "f32", "shape": ["nb"]} |
| 28 | ], |
| 29 | "tolerance": { |
| 30 | "y": { |
| 31 | "kind": "exact", |
| 32 | "why": "max does no rounding: the result is one of the inputs, whatever the order" |
| 33 | } |
| 34 | }, |
| 35 | "timing": {"warmup": 1, "repeats": 5}, |
| 36 | "backends": { |
| 37 | "omega": {"src": "omega.om"}, |
| 38 | "opencl": { |
| 39 | "src": "kernel.cl", |
| 40 | "launches": [ |
| 41 | {"kernel": "rmax_part", "global": ["nb * 256"], "local": [256], "args": ["x", "part", "n", "local:f32:256"]}, |
| 42 | {"kernel": "rmax_fin", "global": [256], "local": [256], "args": ["part", "y", "nb", "local:f32:256"]} |
| 43 | ] |
| 44 | }, |
| 45 | "triton": {"src": "triton_kernel.py"}, |
| 46 | "cuda": {"src": "kernel.cu"} |
| 47 | } |
| 48 | } |