openaccel-lab
aien-dev/openaccel-lab
Brought by drakestapleton
openaccel-lab / controls / dequant_int4_nosign / workload.json
| 1 | { |
| 2 | "name": "dequant_int4_nosign", |
| 3 | "expect": "fail", |
| 4 | "reference_from": "dequant_int4", |
| 5 | "family": "quantization", |
| 6 | "summary": "CONTROL: workloads/dequant_int4 with the nibble sign extension omitted in every entrant (nibbles read as 0..15 instead of -8..7); every element whose nibble is >= 8 is off by 16 * scale, so the exact check must fail; the R = 1, C = 2 case is left out because both nibbles of its single byte may be < 8", |
| 7 | "provenance": "authored for OpenAccel Lab (Apache-2.0); the packed signed-nibble, group-32 layout of common 4-bit weight formats", |
| 8 | "params": { |
| 9 | "R": 64, |
| 10 | "C": 256 |
| 11 | }, |
| 12 | "derived": { |
| 13 | "G": "(C + 31) // 32", |
| 14 | "NB": "C // 2" |
| 15 | }, |
| 16 | "cases": [ |
| 17 | {}, |
| 18 | { |
| 19 | "R": 5, |
| 20 | "C": 70 |
| 21 | } |
| 22 | ], |
| 23 | "shrink": { |
| 24 | "R": { |
| 25 | "min": 1 |
| 26 | }, |
| 27 | "C": { |
| 28 | "min": 2, |
| 29 | "multiple_of": 2 |
| 30 | } |
| 31 | }, |
| 32 | "inputs": [ |
| 33 | { |
| 34 | "name": "w", |
| 35 | "dtype": "u8", |
| 36 | "shape": [ |
| 37 | "R", |
| 38 | "NB" |
| 39 | ], |
| 40 | "gen": { |
| 41 | "kind": "int", |
| 42 | "lo": 0, |
| 43 | "hi": 255 |
| 44 | } |
| 45 | }, |
| 46 | { |
| 47 | "name": "s", |
| 48 | "dtype": "f32", |
| 49 | "shape": [ |
| 50 | "R", |
| 51 | "G" |
| 52 | ], |
| 53 | "gen": { |
| 54 | "kind": "uniform", |
| 55 | "lo": 0.001, |
| 56 | "hi": 0.05 |
| 57 | } |
| 58 | } |
| 59 | ], |
| 60 | "outputs": [ |
| 61 | { |
| 62 | "name": "y", |
| 63 | "dtype": "f32", |
| 64 | "shape": [ |
| 65 | "R", |
| 66 | "C" |
| 67 | ] |
| 68 | } |
| 69 | ], |
| 70 | "tolerance": { |
| 71 | "y": { |
| 72 | "kind": "exact", |
| 73 | "why": "the nibble is an exact integer -8..7, converts to f32 exactly, then one correctly rounded f32 multiply per element" |
| 74 | } |
| 75 | }, |
| 76 | "timing": { |
| 77 | "warmup": 2, |
| 78 | "repeats": 10 |
| 79 | }, |
| 80 | "backends": { |
| 81 | "omega": { |
| 82 | "src": "omega.om" |
| 83 | }, |
| 84 | "opencl": { |
| 85 | "src": "kernel.cl", |
| 86 | "launches": [ |
| 87 | { |
| 88 | "kernel": "dequant_int4", |
| 89 | "global": [ |
| 90 | "R", |
| 91 | "C" |
| 92 | ], |
| 93 | "local": null, |
| 94 | "args": [ |
| 95 | "w", |
| 96 | "s", |
| 97 | "y", |
| 98 | "R", |
| 99 | "C", |
| 100 | "G", |
| 101 | "NB" |
| 102 | ] |
| 103 | } |
| 104 | ] |
| 105 | }, |
| 106 | "triton": { |
| 107 | "src": "triton_kernel.py" |
| 108 | }, |
| 109 | "cuda": { |
| 110 | "src": "kernel.cu" |
| 111 | } |
| 112 | } |
| 113 | } |