Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/openaccel-lab/blob/main/workloads/rmsnorm/workload.json # openaccel-lab aien-dev/openaccel-lab Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `openaccel-lab / workloads / rmsnorm / workload.json` 110 lines ยท 2249 bytes Raw Blame History 1 { 2 "name": "rmsnorm", 3 "family": "row-normalization", 4 "summary": "per row r of x[R][D]: y = x / sqrt(mean(x^2) + eps) * w, eps = 1e-6 written as an f32 constant", 5 "provenance": "authored for OpenAccel Lab (Apache-2.0)", 6 "params": { 7 "R": 24, 8 "D": 256 9 }, 10 "cases": [ 11 {}, 12 { 13 "R": 1, 14 "D": 1 15 }, 16 { 17 "R": 7, 18 "D": 999 19 } 20 ], 21 "shrink": { 22 "R": { 23 "min": 1 24 }, 25 "D": { 26 "min": 1 27 } 28 }, 29 "inputs": [ 30 { 31 "name": "x", 32 "dtype": "f32", 33 "shape": [ 34 "R", 35 "D" 36 ], 37 "gen": { 38 "kind": "uniform", 39 "lo": -2.0, 40 "hi": 2.0 41 } 42 }, 43 { 44 "name": "w", 45 "dtype": "f32", 46 "shape": [ 47 "D" 48 ], 49 "gen": { 50 "kind": "uniform", 51 "lo": 0.5, 52 "hi": 1.5 53 } 54 } 55 ], 56 "outputs": [ 57 { 58 "name": "y", 59 "dtype": "f32", 60 "shape": [ 61 "R", 62 "D" 63 ] 64 } 65 ], 66 "tolerance": { 67 "y": { 68 "kind": "bound", 69 "rtol": "gamma(D+9)", 70 "atol": 0.0, 71 "why": "every step is multiplicative on positive quantities. sum x^2 in any order, FMA or not: (1+theta_D) (Higham Thm 3.1/3.5); times f32(1/D) or divided by D: theta_2 more; + eps (both terms positive): one more, so v^ = v(1+rho), |rho| <= gamma(D+3), eps = f32(1e-6) in the reference. |(1+rho)^(-1/2) - 1| <= (2 sqrt2 - 2)|rho| <= gamma(D+3) (WolframLanguageEvaluator: MaxValue[{Abs[(1+r)^(-1/2)-1]/Abs[r], -1/2<=r<=10, r!=0}, r] -> 0.`8284271247`). rsqrt budget 2 ulp (OpenCL C 3.0 s7.4, CUDA rsqrtf) = 4u <= gamma(4) (WolframLanguageEvaluator: 2*2^-23/2^-24 -> 4), also covering sqrt + divide (WolframLanguageEvaluator: ((1+u)/(1-u)-1)/u -> 2.`0000001`). x * r * w: two roundings. Lemma 3.3 gives y^ = y(1+theta), |theta| <= gamma(D+9); for D=256, gamma(265) (WolframLanguageEvaluator: 265u/(1-265u), u=2^-24 -> 1.5795e-5). A dropped term changes y by ~1/(2D) relative and fails." 72 } 73 }, 74 "timing": { 75 "warmup": 1, 76 "repeats": 5 77 }, 78 "backends": { 79 "omega": { 80 "src": "omega.om" 81 }, 82 "opencl": { 83 "src": "kernel.cl", 84 "launches": [ 85 { 86 "kernel": "rmsnorm", 87 "global": [ 88 "R*64" 89 ], 90 "local": [ 91 "64" 92 ], 93 "args": [ 94 "x", 95 "w", 96 "y", 97 "D", 98 "local:f32:64" 99 ] 100 } 101 ] 102 }, 103 "triton": { 104 "src": "triton_kernel.py" 105 }, 106 "cuda": { 107 "src": "kernel.cu" 108 } 109 } 110 }