sync 6fdf6301e2bb
Browse filesFiles changed (8)
11 unmodified lines121314151516171812 unmodified lines31323334353637389 unmodified lines484950515253545556575859606162636465666768697071727374757677787980818283848586874 unmodified lines9293945995969798991001011026610310410510611 unmodified lines
## Description
Fuses skip addition with layer normalization for rank-2 or rank-3 input and a non-empty hidden axis. With exact-shape skip, float32 and float16 output-only paths support optional `beta`; adding `bias` requires `beta`. Returning the residual sum requires `beta`: float32 supports optional `bias` and arbitrary hidden sizes, while float16 requires `bias` and a hidden size divisible by four. Broadcast skip is supported for rank-3 float32 input, required `beta`, no `bias` or residual output, and a hidden size divisible by four. Bfloat16 and training statistics are not implemented.Fuses skip addition with layer normalization over a non-empty final hidden axis of rank-2 or rank-3 input. Exact-shape skip supports float32 and float16. Optional float32 mean and inverse-standard-deviation outputs expose row statistics. Broadcast skip supports rank-3 float32 input with beta, no bias or residual output, and a hidden size divisible by four. Output-only and residual-only paths have additional beta, bias and alignment requirements stated by their variants. Bfloat16 is not implemented.
See the [ONNX Runtime `SkipLayerNormalization` contrib-operator spec](https://github.com/microsoft/onnxruntime/blob/main/docs/ContribOperators.md#com.microsoft.SkipLayerNormalization) for the reference semantics.
12 unmodified lines| Name | Upstream name | Logical dtype | Rank | Shape | Description | Presence || --- | --- | --- | --- | --- | --- | --- || `outputT` | `output` | `T` | same as `inputT` | same as `inputT` | Normalized output tensor with the same shape as `input`. | required || `meanT` | `mean` | `U` | same as `inputT` | derived | Per-row mean; zero for simplified RMS normalization. Shape matches the input with its final axis replaced by one. | optional || `invStdT` | `inv_std_var` | `U` | same as `inputT` | derived | Per-row inverse standard deviation, or inverse RMS for simplified normalization. Shape matches the input with its final axis replaced by one. | optional || `residualT` | `input_skip_bias_sum` | `T` | same as `inputT` | same as `inputT` | Sum of `input`, `skip`, and `bias` (when present) before normalization, with the same shape as `input`. | optional |
## Attributes9 unmodified lines| Variable | Allowed dtypes || --- | --- || `T` | `float32`, `float16` || `U` | `float32` |
## Implementation variants
One implementation is selected per call from the device capabilities, the request shapes and the dtypes; these notes say what each one covers.
- `hidden1_f32_no_beta` — Closed-form one-element rows bind only gamma, optional beta, the output, and row parameters. Each invocation writes one row without reading the unused residual inputs.- `hidden1_f32_beta` — Closed-form one-element rows bind only gamma, optional beta, the output, and row parameters. Each invocation writes one row without reading the unused residual inputs.- `hidden1_f16_no_beta` — Closed-form one-element rows bind only gamma, optional beta, the output, and row parameters. Each invocation writes one row without reading the unused residual inputs.- `hidden1_f16_beta` — Closed-form one-element rows bind only gamma, optional beta, the output, and row parameters. Each invocation writes one row without reading the unused residual inputs.- `stats_mean_plain` — Row normalization returning mean statistics with `plain` optional inputs and outputs.- `stats_mean_residual` — Row normalization returning mean statistics with `residual` optional inputs and outputs.- `stats_mean_beta` — Row normalization returning mean statistics with `beta` optional inputs and outputs.- `stats_mean_beta_residual` — Row normalization returning mean statistics with `beta_residual` optional inputs and outputs.- `stats_mean_bias` — Row normalization returning mean statistics with `bias` optional inputs and outputs.- `stats_mean_bias_residual` — Row normalization returning mean statistics with `bias_residual` optional inputs and outputs.- `stats_mean_bias_beta` — Row normalization returning mean statistics with `bias_beta` optional inputs and outputs.- `stats_mean_bias_beta_residual` — Row normalization returning mean statistics with `bias_beta_residual` optional inputs and outputs.- `stats_inv_plain` — Row normalization returning inv statistics with `plain` optional inputs and outputs.- `stats_inv_residual` — Row normalization returning inv statistics with `residual` optional inputs and outputs.- `stats_inv_beta` — Row normalization returning inv statistics with `beta` optional inputs and outputs.- `stats_inv_beta_residual` — Row normalization returning inv statistics with `beta_residual` optional inputs and outputs.- `stats_inv_bias` — Row normalization returning inv statistics with `bias` optional inputs and outputs.- `stats_inv_bias_residual` — Row normalization returning inv statistics with `bias_residual` optional inputs and outputs.- `stats_inv_bias_beta` — Row normalization returning inv statistics with `bias_beta` optional inputs and outputs.- `stats_inv_bias_beta_residual` — Row normalization returning inv statistics with `bias_beta_residual` optional inputs and outputs.- `stats_both_plain` — Row normalization returning both statistics with `plain` optional inputs and outputs.- `stats_both_residual` — Row normalization returning both statistics with `residual` optional inputs and outputs.- `stats_both_beta` — Row normalization returning both statistics with `beta` optional inputs and outputs.- `stats_both_beta_residual` — Row normalization returning both statistics with `beta_residual` optional inputs and outputs.- `stats_both_bias` — Row normalization returning both statistics with `bias` optional inputs and outputs.- `stats_both_bias_residual` — Row normalization returning both statistics with `bias_residual` optional inputs and outputs.- `stats_both_bias_beta` — Row normalization returning both statistics with `bias_beta` optional inputs and outputs.- `stats_both_bias_beta_residual` — Row normalization returning both statistics with `bias_beta_residual` optional inputs and outputs.
## Device requirements
4 unmodified lines- [`metadata.json`](build/webgpu/metadata.json) — kernel metadata (id, digests, per-variant templates, provenance)- [`manifest.json`](build/webgpu/manifest.json) — the op contract (source of truth)- [`test.json`](build/webgpu/test.json) — correctness cases- [`bench.json`](build/webgpu/bench.json) — benchmark + tuning cases- [`bench.json`](build/webgpu/bench.json) — benchmark cases- [`norm-skip-row-vec4.wgsl.jinja`](build/webgpu/norm-skip-row-vec4.wgsl.jinja)- [`norm-skip-row.wgsl.jinja`](build/webgpu/norm-skip-row.wgsl.jinja)- [`norm-stats-copy.wgsl.jinja`](build/webgpu/norm-stats-copy.wgsl.jinja)
## Use with `@huggingface/kernels`
```shnpm install --save-exact @huggingface/kernels@0.0.1-preview.2npm install --save-exact @huggingface/kernels@0.0.1-preview.3```
Required output shapes and logical data types are inferred from the supplied inputs and attributes; result tensors are allocated automatically.239 unmodified lines240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366239 unmodified lines "residualT": { "shape": [65535, 1], "dtype": "float32" } }, "bench": { "metrics": [{ "type": "bandwidth", "value": "4 * (4 * args.rows * args.hidden + 3 * args.hidden)" }] } }, { "name": "independent_float32_rows257_option2", "preset": "edge", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [257, 1], "dist": "normal", "seed": 1301, "scale": 0.2 }, "skipT": { "dtype": "float32", "shape": [257, 1], "dist": "normal", "seed": 1302, "scale": 0.2 }, "gammaT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": 1.125 }, "betaT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": -0.25 }, "biasT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": 0.125 } }, "outputs": { "outputT": { "dtype": "float32", "shape": [257, 1] } } }, { "name": "independent_float32_rows65537_option0", "preset": "edge", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [65537, 1], "dist": "normal", "seed": 1301, "scale": 0.2 }, "skipT": { "dtype": "float32", "shape": [65537, 1], "dist": "normal", "seed": 1302, "scale": 0.2 }, "gammaT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": 1.125 } }, "outputs": { "outputT": { "dtype": "float32", "shape": [65537, 1] } } }, { "name": "independent_float32_rows65537_option2", "preset": "edge", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [65537, 1], "dist": "normal", "seed": 1301, "scale": 0.2 }, "skipT": { "dtype": "float32", "shape": [65537, 1], "dist": "normal", "seed": 1302, "scale": 0.2 }, "gammaT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": 1.125 }, "betaT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": -0.25 }, "biasT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": 0.125 } }, "outputs": { "outputT": { "dtype": "float32", "shape": [65537, 1] } } }, { "name": "independent_float32_rows65537_option3", "preset": "edge", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [65537, 1], "dist": "normal", "seed": 1301, "scale": 0.2 }, "skipT": { "dtype": "float32", "shape": [65537, 1], "dist": "normal", "seed": 1302, "scale": 0.2 }, "gammaT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": 1.125 }, "betaT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": -0.25 }, "biasT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": 0.125 } }, "outputs": { "outputT": { "dtype": "float32", "shape": [65537, 1] }, "residualT": { "dtype": "float32", "shape": [65537, 1] } } }, { "name": "independent_float16_rows257_option2", "preset": "edge", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [257, 1], "dist": "normal", "seed": 1301, "scale": 0.2 }, "skipT": { "dtype": "float16", "shape": [257, 1], "dist": "normal", "seed": 1302, "scale": 0.2 }, "gammaT": { "dtype": "float16", "shape": [1], "dist": "constant", "value": 1.125 }, "betaT": { "dtype": "float16", "shape": [1], "dist": "constant", "value": -0.25 }, "biasT": { "dtype": "float16", "shape": [1], "dist": "constant", "value": 0.125 } }, "outputs": { "outputT": { "dtype": "float16", "shape": [257, 1] } } }, { "name": "independent_float16_rows65537_option0", "preset": "edge", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [65537, 1], "dist": "normal", "seed": 1301, "scale": 0.2 }, "skipT": { "dtype": "float16", "shape": [65537, 1], "dist": "normal", "seed": 1302, "scale": 0.2 }, "gammaT": { "dtype": "float16", "shape": [1], "dist": "constant", "value": 1.125 } }, "outputs": { "outputT": { "dtype": "float16", "shape": [65537, 1] } } }, { "name": "independent_float16_rows65537_option2", "preset": "edge", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [65537, 1], "dist": "normal", "seed": 1301, "scale": 0.2 }, "skipT": { "dtype": "float16", "shape": [65537, 1], "dist": "normal", "seed": 1302, "scale": 0.2 }, "gammaT": { "dtype": "float16", "shape": [1], "dist": "constant", "value": 1.125 }, "betaT": { "dtype": "float16", "shape": [1], "dist": "constant", "value": -0.25 }, "biasT": { "dtype": "float16", "shape": [1], "dist": "constant", "value": 0.125 } }, "outputs": { "outputT": { "dtype": "float16", "shape": [65537, 1] } } }, { "name": "independent_float32_rows524289_wg8_fold", "preset": "edge", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [524289, 1], "dist": "normal", "seed": 1301, "scale": 0.2 }, "skipT": { "dtype": "float32", "shape": [524289, 1], "dist": "normal", "seed": 1302, "scale": 0.2 }, "gammaT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": 1.125 }, "betaT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": -0.25 }, "biasT": { "dtype": "float32", "shape": [1], "dist": "constant", "value": 0.125 } }, "outputs": { "outputT": { "dtype": "float32", "shape": [524289, 1] }, "residualT": { "dtype": "float32", "shape": [524289, 1] } }, "tunables": { "MAX_WORKGROUP_SIZE": 8 } }, { "name": "independent_float16_rows524289_wg8_fold", "preset": "edge", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [524289, 1], "dist": "normal", "seed": 1301, "scale": 0.2 }, "skipT": { "dtype": "float16", "shape": [524289, 1], "dist": "normal", "seed": 1302, "scale": 0.2 }, "gammaT": { "dtype": "float16", "shape": [1], "dist": "constant", "value": 1.125 }, "betaT": { "dtype": "float16", "shape": [1], "dist": "constant", "value": -0.25 }, "biasT": { "dtype": "float16", "shape": [1], "dist": "constant", "value": 0.125 } }, "outputs": { "outputT": { "dtype": "float16", "shape": [524289, 1] } }, "tunables": { "MAX_WORKGROUP_SIZE": 8 } } ]}10 unmodified lines11121314151617181920212223242526272829303 unmodified lines343536233738394041284243303132334435453746474849424350515253544950555657585960616263646566676869702 unmodified lines73747561767778796465666768697071808182838485868788738990914 unmodified lines96979884858687888990919293949596979899100101102103104105106107108109110111112113114991001011021031041051061071161081091101111211121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382391271282402412422432444 unmodified lines24925025113925225325421 unmodified lines2762772781671682792802812822832842851751761771781791801811822862872882892901 unmodified line29229329419029529619329729829930030130220020120230330430530630730830931020931131231331410 unmodified lines3253263272262272283283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953962352363973983994004014 unmodified lines4064074082474094104114124134142542552564154164174184194204214222632644234244254264271 unmodified line4294304312722734324334342754354364374384394402822832844414424434444454464474482914494504512942954524534544554565 unmodified lines4624634643073083094654664674684694704714724734744754763163174774784794804811 unmodified line4834844853253264864874883284894904914924934943353363374954964974984995005015023445035045053473485065075085095103525115125132 unmodified lines5165175183613623635195205215225235245255265275283685295303703713723733743753763775315325335345351 unmodified line5375385393853863873885405415425435445455465475483953963975495505515525535544025555564045575585595605615625634084094105645655663 unmodified lines5705715724204214225735745755765775785795805815824275835844294304314324334344354365855865875885894405905915925934444455945955964475975985994516006016024544554566036046056066076084616096104636116126134664676146156164694706176186196206216226236244776256264794804816276286296306316326336346356366376384884894904914924934944956396406416426431 unmodified line6456466475035046486496505066516526536546556565135145156576586596606616626636645226656666675255266686696705286716726736743 unmodified lines6786796805385395406816826836846856866876886896905456916925475485495505515525535546936946956966971 unmodified line6997007015625637027037045657057067077087097105725735747117127137147157165797177185817197207215845857227237245877257265897277287292 unmodified lines7327337345985996007357367377387397407417427437446056066077457467476096106117487497507517527537547557566137577587597607617626186196206216226236246256266276286296306316326336347637647657667677687697706367717727737746396406417757767777786446456466476486497797807817827837847857866517877887897907917926567936586596607947957967977987998006628018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155310 unmodified lines }, "outputs": { "outputT": { "onnx": "output", "dtype": "T", "rank": "ranks.inputT", "shape": "shapes.inputT" }, "meanT": { "onnx": "mean", "dtype": "U", "optional": true, "rank": "ranks.inputT", "shape": "prefix(shapes.inputT, ranks.inputT - 1) + [1]" }, "invStdT": { "onnx": "inv_std_var", "dtype": "U", "optional": true, "rank": "ranks.inputT", "shape": "prefix(shapes.inputT, ranks.inputT - 1) + [1]" }, "residualT": { "onnx": "input_skip_bias_sum", "dtype": "T",3 unmodified lines } }, "attributes": { "epsilon": { "default": 9.999999960041972e-13 } }, "typeConstraints": { "T": ["float32", "float16"] }, "typeConstraints": { "T": ["float32", "float16"], "U": ["float32"] }, "tunables": { "MAX_WORKGROUP_SIZE": { "default": 256 } }, "derive": { "rowCount": "numel(shapes.inputT) / max(1, dim(shapes.inputT, -1))", "hiddenSize": "dim(shapes.inputT, -1)", "skipWg": "max(1, min(tunables.MAX_WORKGROUP_SIZE, device.limits.maxComputeInvocationsPerWorkgroup, device.limits.maxComputeWorkgroupSizeX, pow2ceil(hiddenSize)))", "skipWg": "max(1, min(tunables.MAX_WORKGROUP_SIZE, device.limits.maxComputeInvocationsPerWorkgroup, device.limits.maxComputeWorkgroupSizeX)) if hiddenSize == 1 else (max(1, min(tunables.MAX_WORKGROUP_SIZE, device.limits.maxComputeInvocationsPerWorkgroup, device.limits.maxComputeWorkgroupSizeX, pow2ceil(hiddenSize))))", "skipWgVec4": "max(1, min(tunables.MAX_WORKGROUP_SIZE, device.limits.maxComputeInvocationsPerWorkgroup, device.limits.maxComputeWorkgroupSizeX, pow2ceil(ceilDiv(hiddenSize, 4))))", "portableWideExecution": "not has(device.adapterInfo, \"subgroupMinSize\") or device.adapterInfo.subgroupMinSize >= 32", "broadcastRows": "dim(shapes.inputT, 0) * dim(shapes.inputT, 1)", "broadcastHiddenSize": "dim(shapes.inputT, 2)", "broadcastSkipWgVec4": "max(1, min(tunables.MAX_WORKGROUP_SIZE, device.limits.maxComputeInvocationsPerWorkgroup, device.limits.maxComputeWorkgroupSizeX, pow2ceil(ceilDiv(broadcastHiddenSize, 4))))", "rowDispatchFits": "rowCount <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) * min(device.limits.maxComputeWorkgroupsPerDimension, 65535)", "broadcastDispatchFits": "broadcastRows <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) * min(device.limits.maxComputeWorkgroupsPerDimension, 65535)", "normResourcesFit": "skipWg * 8 <= device.limits.maxComputeWorkgroupStorageSize and skipWgVec4 * 8 <= device.limits.maxComputeWorkgroupStorageSize", "broadcastResourcesFit": "broadcastSkipWgVec4 * 8 <= device.limits.maxComputeWorkgroupStorageSize", "epsilonOk": "attrs.epsilon >= 0", "coreContract": "epsilonOk and (ranks.inputT == 2 or ranks.inputT == 3) and ranks.skipT == ranks.inputT and ranks.gammaT == 1 and ranks.outputT == ranks.inputT and sameShape(shapes.inputT, shapes.skipT) and sameShape(shapes.outputT, shapes.inputT) and dim(shapes.inputT, -1) > 0 and dim(shapes.gammaT, 0) == dim(shapes.inputT, -1)", "residualOutputContract": "present.residualT and sameShape(shapes.residualT, shapes.inputT)", "outputOnlyContract": "not present.residualT", "betaContract": "false if not present.betaT else (ranks.betaT == 1 and dim(shapes.betaT, 0) == dim(shapes.inputT, -1))", "noBetaContract": "not present.betaT", "f32MainDtypes": "tensorDtypes.inputT == \"float32\" and tensorDtypes.skipT == \"float32\" and tensorDtypes.gammaT == \"float32\" and tensorDtypes.outputT == \"float32\"", "f16MainDtypes": "tensorDtypes.inputT == \"float16\" and tensorDtypes.skipT == \"float16\" and tensorDtypes.gammaT == \"float16\" and tensorDtypes.outputT == \"float16\"", "f32ResidualDtypes": "f32MainDtypes and tensorDtypes.residualT == \"float32\" if present.residualT else false", "f16ResidualDtypes": "f16MainDtypes and tensorDtypes.residualT == \"float16\" if present.residualT else false", "vec4Aligned": "dim(shapes.inputT, -1) % 4 == 0", "broadcastSkipShapeOk": "(ranks.skipT == 2 and dim(shapes.skipT, 0) == dim(shapes.inputT, 1) and dim(shapes.skipT, 1) == dim(shapes.inputT, 2)) or (ranks.skipT == 3 and ((dim(shapes.skipT, 0) == 1 and dim(shapes.skipT, 1) == dim(shapes.inputT, 1) and dim(shapes.skipT, 2) == dim(shapes.inputT, 2)) or sameShape(shapes.skipT, shapes.inputT)))", "broadcastOutputOnlyContract": "false if ranks.inputT != 3 or not present.betaT else (epsilonOk and not present.biasT and not present.residualT and dim(shapes.inputT, 2) % 4 == 0 and broadcastSkipShapeOk and ranks.gammaT == 1 and ranks.betaT == 1 and ranks.outputT == 3 and tensorDtypes.inputT == \"float32\" and tensorDtypes.skipT == \"float32\" and tensorDtypes.gammaT == \"float32\" and tensorDtypes.betaT == \"float32\" and tensorDtypes.outputT == \"float32\" and dim(shapes.inputT, 2) > 0 and dim(shapes.gammaT, 0) == dim(shapes.inputT, 2) and dim(shapes.betaT, 0) == dim(shapes.inputT, 2) and sameShape(shapes.outputT, shapes.inputT))", "hasSubgroups": "device.features.has(\"subgroups\") and device.wgslLanguageFeatures.has(\"subgroup_id\")", "hasF16": "device.features.has(\"shader-f16\")", "statsRequested": "present.meanT or present.invStdT", "portableWideExecution": "not has(device.adapterInfo, \"subgroupMinSize\") or device.adapterInfo.subgroupMinSize >= 32", "broadcastRows": "dim(shapes.inputT, 0) * dim(shapes.inputT, 1)", "broadcastHiddenSize": "dim(shapes.inputT, 2)", "broadcastSkipWgVec4": "max(1, min(tunables.MAX_WORKGROUP_SIZE, device.limits.maxComputeInvocationsPerWorkgroup, device.limits.maxComputeWorkgroupSizeX, pow2ceil(ceilDiv(broadcastHiddenSize, 4))))", "broadcastDispatchFits": "broadcastRows <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) * min(device.limits.maxComputeWorkgroupsPerDimension, 65535)", "broadcastResourcesFit": "broadcastSkipWgVec4 * 8 <= device.limits.maxComputeWorkgroupStorageSize", "betaContract": "false if not present.betaT else (ranks.betaT == 1 and dim(shapes.betaT, 0) == dim(shapes.inputT, -1))", "noBetaContract": "not present.betaT", "broadcastSkipShapeOk": "(ranks.skipT == 2 and dim(shapes.skipT, 0) == dim(shapes.inputT, 1) and dim(shapes.skipT, 1) == dim(shapes.inputT, 2)) or (ranks.skipT == 3 and ((dim(shapes.skipT, 0) == 1 and dim(shapes.skipT, 1) == dim(shapes.inputT, 1) and dim(shapes.skipT, 2) == dim(shapes.inputT, 2)) or sameShape(shapes.skipT, shapes.inputT)))", "broadcastOutputOnlyContract": "false if ranks.inputT != 3 or not present.betaT else (epsilonOk and not present.biasT and not present.residualT and dim(shapes.inputT, 2) % 4 == 0 and broadcastSkipShapeOk and ranks.gammaT == 1 and ranks.betaT == 1 and ranks.outputT == 3 and tensorDtypes.inputT == \"float32\" and tensorDtypes.skipT == \"float32\" and tensorDtypes.gammaT == \"float32\" and tensorDtypes.betaT == \"float32\" and tensorDtypes.outputT == \"float32\" and dim(shapes.inputT, 2) > 0 and dim(shapes.gammaT, 0) == dim(shapes.inputT, 2) and dim(shapes.betaT, 0) == dim(shapes.inputT, 2) and sameShape(shapes.outputT, shapes.inputT))", "f32_beta_no_bias_residual_contract": "coreContract and residualOutputContract and betaContract and f32ResidualDtypes and not present.biasT and tensorDtypes.betaT == \"float32\"", "f32_beta_bias_residual_contract": "false if not present.biasT else (coreContract and residualOutputContract and betaContract and f32ResidualDtypes and ranks.biasT == 1 and tensorDtypes.betaT == \"float32\" and tensorDtypes.biasT == \"float32\" and dim(shapes.biasT, 0) == hiddenSize)", "f16_beta_bias_residual_contract": "false if not present.biasT else (hasF16 and coreContract and residualOutputContract and betaContract and f16ResidualDtypes and ranks.biasT == 1 and tensorDtypes.betaT == \"float16\" and tensorDtypes.biasT == \"float16\" and dim(shapes.biasT, 0) == hiddenSize)",2 unmodified lines "f32_beta_bias_output_only_contract": "false if not present.biasT else (coreContract and outputOnlyContract and betaContract and f32MainDtypes and ranks.biasT == 1 and tensorDtypes.betaT == \"float32\" and tensorDtypes.biasT == \"float32\" and dim(shapes.biasT, 0) == hiddenSize)", "f16_no_beta_output_contract": "hasF16 and coreContract and outputOnlyContract and noBetaContract and f16MainDtypes and not present.biasT", "f16_beta_no_bias_output_only_contract": "hasF16 and coreContract and outputOnlyContract and betaContract and f16MainDtypes and not present.biasT and tensorDtypes.betaT == \"float16\"", "f16_beta_bias_output_only_contract": "false if not present.biasT else (hasF16 and coreContract and outputOnlyContract and betaContract and f16MainDtypes and ranks.biasT == 1 and tensorDtypes.betaT == \"float16\" and tensorDtypes.biasT == \"float16\" and dim(shapes.biasT, 0) == hiddenSize)" "f16_beta_bias_output_only_contract": "false if not present.biasT else (hasF16 and coreContract and outputOnlyContract and betaContract and f16MainDtypes and ranks.biasT == 1 and tensorDtypes.betaT == \"float16\" and tensorDtypes.biasT == \"float16\" and dim(shapes.biasT, 0) == hiddenSize)", "statsContract": "statsRequested and coreContract and f16Ok(dtypes.T) and (not present.biasT or (ranks.biasT == 1 and dim(shapes.biasT, 0) == hiddenSize)) and (not present.residualT or sameShape(shapes.residualT, shapes.inputT)) and (not present.betaT or (ranks.betaT == 1 and dim(shapes.betaT, 0) == hiddenSize))" }, "bindings": { "input": { "arg": "inputT", "buffer": "read-only-storage", "elementType": "$vectorScalar" }, "skip": { "arg": "skipT", "buffer": "read-only-storage", "elementType": "$vectorScalar" }, "gamma": { "arg": "gammaT", "buffer": "read-only-storage", "elementType": "$vectorScalar", "length": "$HIDDEN_LEN" }, "beta": { "arg": "betaT", "buffer": "read-only-storage", "elementType": "$vectorScalar", "length": "$HIDDEN_LEN" }, "output": { "arg": "outputT", "buffer": "storage", "elementType": "$vectorScalar" }, "bias": { "arg": "biasT", "buffer": "read-only-storage", "elementType": "$vectorScalar", "length": "$HIDDEN_LEN" }, "input_skip_bias_sum": { "arg": "residualT", "buffer": "storage", "elementType": "$vectorScalar" }, "params_2": { "input": { "arg": "inputT", "elementType": "$vectorScalar" }, "skip": { "arg": "skipT", "elementType": "$vectorScalar" }, "gamma": { "arg": "gammaT", "elementType": "$vectorScalar", "length": "$HIDDEN_LEN" }, "beta": { "arg": "betaT", "elementType": "$vectorScalar", "length": "$HIDDEN_LEN" }, "output": { "arg": "outputT", "elementType": "$vectorScalar" }, "bias": { "arg": "biasT", "elementType": "$vectorScalar", "length": "$HIDDEN_LEN" }, "input_skip_bias_sum": { "arg": "residualT", "elementType": "$vectorScalar" }, "params_main": { "name": "params", "buffer": "uniform", "struct": [ { "name": "rows", "type": "u32", "value": "rowCount" }, {4 unmodified lines { "name": "epsilon", "type": "f32", "value": "attrs.epsilon" } ] }, "input_2": { "arg": "inputT", "name": "input", "buffer": "read-only-storage", "elementType": "$scalar" }, "skip_2": { "arg": "skipT", "name": "skip", "buffer": "read-only-storage", "elementType": "$scalar" }, "bias_2": { "arg": "biasT", "name": "bias", "buffer": "read-only-storage", "elementType": "$scalar", "length": "$HIDDEN_LEN" }, "gamma_2": { "arg": "gammaT", "name": "gamma", "buffer": "read-only-storage", "elementType": "$scalar", "length": "$HIDDEN_LEN" }, "beta_2": { "arg": "betaT", "name": "beta", "buffer": "read-only-storage", "elementType": "$scalar", "length": "$HIDDEN_LEN" }, "output_2": { "arg": "outputT", "name": "output", "buffer": "storage", "elementType": "$scalar" }, "input_skip_bias_sum_2": { "arg": "residualT", "name": "input_skip_bias_sum", "buffer": "storage", "elementType": "$scalar" }, "params_3": { "input_main": { "arg": "inputT", "name": "input", "elementType": "$scalar" }, "skip_main": { "arg": "skipT", "name": "skip", "elementType": "$scalar" }, "bias_main": { "arg": "biasT", "name": "bias", "elementType": "$scalar", "length": "$HIDDEN_LEN" }, "gamma_main": { "arg": "gammaT", "name": "gamma", "elementType": "$scalar", "length": "$HIDDEN_LEN" }, "beta_main": { "arg": "betaT", "name": "beta", "elementType": "$scalar", "length": "$HIDDEN_LEN" }, "output_main": { "arg": "outputT", "name": "output", "elementType": "$scalar" }, "input_skip_bias_sum_main": { "arg": "residualT", "name": "input_skip_bias_sum", "elementType": "$scalar" }, "params__uniform": { "name": "params", "buffer": "uniform", "struct": [ { "name": "rows", "type": "u32", "value": "rowCount" }, { "name": "epsilon", "type": "f32", "value": "attrs.epsilon" } ] } }, "mean": { "arg": "meanT", "elementType": "f32" }, "inv_std_var": { "arg": "invStdT", "elementType": "f32" }, "row_stats": { "scratch": "rowStats", "elementType": "vec2<f32>" }, "row_stats_read": { "scratch": "rowStats", "name": "row_stats", "buffer": "read-only-storage", "elementType": "vec2<f32>" }, "params_stats": { "name": "params", "struct": [{ "name": "rows", "type": "u32", "value": "rowCount" }] } }, "variants": [ { "id": "hidden1_f32_no_beta", "priority": 20, "when": ["f32_no_beta_output_contract", "hiddenSize == 1", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "hasBias": false, "hasBeta": "present.betaT", "writeResidualSum": false, "useSubgroups": false, "scalar": "dtypes.T", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize" }, "passes": [ { "id": "main", "name": "SkipLayerNormalization.Hidden1", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["gamma_main", "output_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "hidden1_f32_beta", "priority": 20, "when": ["(f32_beta_no_bias_output_only_contract or f32_beta_bias_output_only_contract)", "hiddenSize == 1", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "hasBias": false, "hasBeta": "present.betaT", "writeResidualSum": false, "useSubgroups": false, "scalar": "dtypes.T", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize" }, "passes": [ { "id": "main", "name": "SkipLayerNormalization.Hidden1", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["gamma_main", "beta_main", "output_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "hidden1_f16_no_beta", "priority": 20, "when": ["f16_no_beta_output_contract", "hiddenSize == 1", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "hasBias": false, "hasBeta": "present.betaT", "writeResidualSum": false, "useSubgroups": false, "scalar": "dtypes.T", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize" }, "passes": [ { "id": "main", "name": "SkipLayerNormalization.Hidden1", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["gamma_main", "output_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "hidden1_f16_beta", "priority": 20, "when": ["(f16_beta_no_bias_output_only_contract or f16_beta_bias_output_only_contract)", "hiddenSize == 1", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "hasBias": false, "hasBeta": "present.betaT", "writeResidualSum": false, "useSubgroups": false, "scalar": "dtypes.T", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize" }, "passes": [ { "id": "main", "name": "SkipLayerNormalization.Hidden1", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["gamma_main", "beta_main", "output_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "beta_output_only_vec4_broadcast", "priority": 19, "when": ["broadcastOutputOnlyContract", "broadcastResourcesFit", "broadcastDispatchFits"], "derive": { "scalar": "\"f32\"", "vectorScalar": "\"vec4<f32>\"", "HIDDEN_LEN": "broadcastHiddenSize / 4" }, "when": ["broadcastOutputOnlyContract", "broadcastResourcesFit", "broadcastDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "vectorScalar": "\"vec4<f32>\"", "HIDDEN_LEN": "broadcastHiddenSize / 4" }, "passes": [ { "id": "main",4 unmodified lines "hasBias": false, "hasBeta": true, "writeResidualSum": false, "usesF16Spec": false, "broadcastSkip": true, "hidden": "broadcastHiddenSize", "hiddenVec": "broadcastHiddenSize / 4",21 unmodified lines ] } ], "dispatch": { "x": "min(broadcastRows, 65535)", "y": "ceilDiv(broadcastRows, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "dispatch": { "x": "min(broadcastRows, 65535)", "y": "ceilDiv(broadcastRows, 65535)", "z": 1 } } ] }, { "id": "beta_bias_vec4", "priority": 15, "when": ["f32_beta_bias_residual_contract", "vec4Aligned", "hasSubgroups or \"bias\" == \"bias\" or portableWideExecution", "normResourcesFit", "rowDispatchFits"], "derive": { "scalar": "\"f32\"", "vectorScalar": "\"vec4<f32>\"", "hasBias": "\"bias\" == \"bias\"", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize / 4" }, "when": ["f32_beta_bias_residual_contract", "vec4Aligned", "hasSubgroups or \"bias\" == \"bias\" or portableWideExecution", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "vectorScalar": "\"vec4<f32>\"", "hasBias": "\"bias\" == \"bias\"", "HIDDEN_LEN": "hiddenSize / 4" }, "passes": [ { "id": "normalize",1 unmodified line "shader": "norm-skip-row-vec4.wgsl.jinja", "derive": { "simplified": false, "hasBias": "\"bias\" == \"bias\"", "hasBeta": true, "writeResidualSum": true, "usesF16Spec": false, "hidden": "hiddenSize", "hiddenVec": "hiddenSize / 4", "wg": "skipWgVec4", "vecType": "\"vec4<f32>\"", "useSubgroups": "hasSubgroups" }, "bindings": ["input", "skip", "bias", "gamma", "beta", "output", "input_skip_bias_sum", "params_2"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input", "skip", "bias", "gamma", "beta", "output", "input_skip_bias_sum", "params_main"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 } } ] }, { "id": "beta_bias_row", "priority": 5, "when": ["f32_beta_bias_residual_contract", "normResourcesFit", "rowDispatchFits"], "when": ["f32_beta_bias_residual_contract", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "useSubgroups": "hasSubgroups",10 unmodified lines "name": "SkipLayerNormalization.Row.Normalize", "shader": "norm-skip-row.wgsl.jinja", "derive": { "writeResidualSum": true }, "bindings": ["input_2", "skip_2", "bias_2", "gamma_2", "beta_2", "output_2", "input_skip_bias_sum_2", "params_3"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input_main", "skip_main", "bias_main", "gamma_main", "beta_main", "output_main", "input_skip_bias_sum_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "beta_no_bias_vec4", "priority": 20, "when": ["f32_beta_no_bias_residual_contract", "vec4Aligned", "hasSubgroups or portableWideExecution", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "vectorScalar": "\"vec4<f32>\"", "hasBias": "\"no_bias\" == \"bias\"", "HIDDEN_LEN": "hiddenSize / 4" }, "passes": [ { "id": "main", "name": "SkipLayerNormalization.Vec4", "shader": "norm-skip-row-vec4.wgsl.jinja", "derive": { "simplified": false, "hasBeta": true, "writeResidualSum": true, "hidden": "hiddenSize", "hiddenVec": "hiddenSize / 4", "wg": "skipWgVec4", "vecType": "\"vec4<f32>\"", "useSubgroups": "hasSubgroups" }, "bindings": ["input", "skip", "gamma", "beta", "output", "input_skip_bias_sum", "params_main"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 } } ] }, { "id": "beta_no_bias_row", "priority": 10, "when": ["f32_beta_no_bias_residual_contract", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "useSubgroups": "hasSubgroups", "hasBeta": true, "writeResidualSum": true, "hasBias": "\"no_bias\" == \"bias\"", "scalar": "\"f32\"", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize" }, "passes": [ { "id": "main", "name": "SkipLayerNormalization.Row", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "beta_main", "output_main", "input_skip_bias_sum_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "beta_bias_vec4_f16", "priority": 21, "when": ["f16_beta_bias_residual_contract", "vec4Aligned", "normResourcesFit", "rowDispatchFits"], "derive": { "scalar": "\"f16\"", "vectorScalar": "\"vec4<f16>\"", "HIDDEN_LEN": "hiddenSize / 4" }, "when": ["f16_beta_bias_residual_contract", "vec4Aligned", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "vectorScalar": "\"vec4<f16>\"", "HIDDEN_LEN": "hiddenSize / 4" }, "passes": [ { "id": "main",4 unmodified lines "hasBias": true, "hasBeta": true, "writeResidualSum": true, "usesF16Spec": true, "hidden": "hiddenSize", "hiddenVec": "hiddenSize / 4", "wg": "skipWgVec4", "vecType": "\"vec4<f16>\"", "useSubgroups": "hasSubgroups" }, "bindings": ["input", "skip", "bias", "gamma", "beta", "output", "input_skip_bias_sum", "params_2"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input", "skip", "bias", "gamma", "beta", "output", "input_skip_bias_sum", "params_main"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 } } ] }, { "id": "no_beta_output_only_vec4", "priority": 20, "when": ["f32_no_beta_output_contract", "vec4Aligned", "normResourcesFit", "rowDispatchFits"], "derive": { "scalar": "\"f32\"", "vectorScalar": "\"vec4<f32>\"", "HIDDEN_LEN": "hiddenSize / 4" }, "when": ["f32_no_beta_output_contract", "vec4Aligned", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "vectorScalar": "\"vec4<f32>\"", "HIDDEN_LEN": "hiddenSize / 4" }, "passes": [ { "id": "main",1 unmodified line "shader": "norm-skip-row-vec4.wgsl.jinja", "derive": { "simplified": false, "hasBias": false, "hasBeta": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "usesF16Spec": false, "hidden": "hiddenSize", "hiddenVec": "hiddenSize / 4", "wg": "skipWgVec4", "vecType": "\"vec4<f32>\"", "useSubgroups": "hasSubgroups" }, "bindings": ["input", "skip", "gamma", "output", "params_2"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input", "skip", "gamma", "output", "params_main"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 } } ] }, { "id": "no_beta_output_only_row", "priority": 10, "when": ["f32_no_beta_output_contract", "normResourcesFit", "rowDispatchFits"], "when": ["f32_no_beta_output_contract", "normResourcesFit", "rowDispatchFits", "hiddenSize != 1", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "hasBias": false, "hasBeta": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "useSubgroups": "hasSubgroups", "scalar": "\"f32\"",5 unmodified lines "id": "main", "name": "SkipLayerNormalization.NoBetaOutputOnly.Row", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_2", "skip_2", "gamma_2", "output_2", "params_3"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input_main", "skip_main", "gamma_main", "output_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "no_beta_output_only_vec4_f16", "priority": 20, "when": ["f16_no_beta_output_contract", "vec4Aligned", "normResourcesFit", "rowDispatchFits"], "derive": { "scalar": "\"f16\"", "vectorScalar": "\"vec4<f16>\"", "HIDDEN_LEN": "hiddenSize / 4" }, "when": ["f16_no_beta_output_contract", "vec4Aligned", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "vectorScalar": "\"vec4<f16>\"", "HIDDEN_LEN": "hiddenSize / 4" }, "passes": [ { "id": "main",1 unmodified line "shader": "norm-skip-row-vec4.wgsl.jinja", "derive": { "simplified": false, "hasBias": false, "hasBeta": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "usesF16Spec": true, "hidden": "hiddenSize", "hiddenVec": "hiddenSize / 4", "wg": "skipWgVec4", "vecType": "\"vec4<f16>\"", "useSubgroups": "hasSubgroups" }, "bindings": ["input", "skip", "gamma", "output", "params_2"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input", "skip", "gamma", "output", "params_main"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 } } ] }, { "id": "no_beta_output_only_row_f16", "priority": 10, "when": ["f16_no_beta_output_contract", "normResourcesFit", "rowDispatchFits"], "when": ["f16_no_beta_output_contract", "normResourcesFit", "rowDispatchFits", "hiddenSize != 1", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "hasBias": false, "hasBeta": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "useSubgroups": "hasSubgroups", "scalar": "\"f16\"", "usesF16": true, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize" },2 unmodified lines "id": "main", "name": "SkipLayerNormalization.NoBetaOutputOnly.Row.F16", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_2", "skip_2", "gamma_2", "output_2", "params_3"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input_main", "skip_main", "gamma_main", "output_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "beta_no_bias_vec4", "id": "beta_no_bias_output_only_vec4", "priority": 20, "when": ["f32_beta_no_bias_residual_contract", "vec4Aligned", "hasSubgroups or portableWideExecution", "normResourcesFit", "rowDispatchFits"], "derive": { "scalar": "\"f32\"", "vectorScalar": "\"vec4<f32>\"", "hasBias": "\"no_bias\" == \"bias\"", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize / 4" }, "when": ["f32_beta_no_bias_output_only_contract", "vec4Aligned", "hasSubgroups or portableWideExecution", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "vectorScalar": "\"vec4<f32>\"", "HIDDEN_LEN": "hiddenSize / 4" }, "passes": [ { "id": "main",1 unmodified line "shader": "norm-skip-row-vec4.wgsl.jinja", "derive": { "simplified": false, "hasBias": "\"no_bias\" == \"bias\"", "hasBeta": true, "writeResidualSum": true, "usesF16Spec": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "hidden": "hiddenSize", "hiddenVec": "hiddenSize / 4", "wg": "skipWgVec4", "vecType": "\"vec4<f32>\"", "useSubgroups": "hasSubgroups" }, "bindings": ["input", "skip", "gamma", "beta", "output", "input_skip_bias_sum", "params_2"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input", "skip", "gamma", "beta", "output", "params_main"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 } } ] }, { "id": "beta_no_bias_row", "id": "beta_no_bias_output_only_row", "priority": 10, "when": ["f32_beta_no_bias_residual_contract", "normResourcesFit", "rowDispatchFits"], "when": ["f32_beta_no_bias_output_only_contract", "normResourcesFit", "rowDispatchFits", "hiddenSize != 1", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "useSubgroups": "hasSubgroups", "hasBeta": true, "writeResidualSum": true, "hasBias": "\"no_bias\" == \"bias\"", "scalar": "\"f32\"", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize"3 unmodified lines "id": "main", "name": "SkipLayerNormalization.Row", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_2", "skip_2", "gamma_2", "beta_2", "output_2", "input_skip_bias_sum_2", "params_3"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input_main", "skip_main", "gamma_main", "beta_main", "output_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "beta_no_bias_output_only_vec4", "id": "beta_no_bias_output_only_vec4_f16", "priority": 20, "when": ["f32_beta_no_bias_output_only_contract", "vec4Aligned", "hasSubgroups or \"no_bias\" == \"bias\" or portableWideExecution", "normResourcesFit", "rowDispatchFits"], "derive": { "scalar": "\"f32\"", "vectorScalar": "\"vec4<f32>\"", "hasBias": "\"no_bias\" == \"bias\"", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize / 4" }, "when": ["f16_beta_no_bias_output_only_contract", "vec4Aligned", "hasSubgroups or portableWideExecution", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "vectorScalar": "\"vec4<f16>\"", "HIDDEN_LEN": "hiddenSize / 4" }, "passes": [ { "id": "main", "name": "SkipLayerNormalization.Vec4", "name": "SkipLayerNormalization.Vec4.F16", "shader": "norm-skip-row-vec4.wgsl.jinja", "derive": { "simplified": false, "hasBias": "\"no_bias\" == \"bias\"", "hasBeta": true, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "usesF16Spec": false, "hidden": "hiddenSize", "hiddenVec": "hiddenSize / 4", "wg": "skipWgVec4", "vecType": "\"vec4<f32>\"", "vecType": "\"vec4<f16>\"", "useSubgroups": "hasSubgroups" }, "bindings": ["input", "skip", "gamma", "beta", "output", "params_2"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input", "skip", "gamma", "beta", "output", "params_main"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 } } ] }, { "id": "beta_no_bias_output_only_row", "id": "beta_no_bias_output_only_row_f16", "priority": 10, "when": ["f32_beta_no_bias_output_only_contract", "normResourcesFit", "rowDispatchFits"], "when": ["f16_beta_no_bias_output_only_contract", "normResourcesFit", "rowDispatchFits", "hiddenSize != 1", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "useSubgroups": "hasSubgroups", "hasBeta": true, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "hasBias": "\"no_bias\" == \"bias\"", "scalar": "\"f32\"", "useSubgroups": "hasSubgroups", "scalar": "\"f16\"", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize" }, "passes": [ { "id": "main", "name": "SkipLayerNormalization.Row", "name": "SkipLayerNormalization.Row.F16", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_2", "skip_2", "gamma_2", "beta_2", "output_2", "params_3"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input_main", "skip_main", "gamma_main", "beta_main", "output_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "beta_bias_output_only_vec4", "priority": 20, "when": ["f32_beta_bias_output_only_contract", "vec4Aligned", "hasSubgroups or \"bias\" == \"bias\" or portableWideExecution", "normResourcesFit", "rowDispatchFits"], "derive": { "scalar": "\"f32\"", "vectorScalar": "\"vec4<f32>\"", "hasBias": "\"bias\" == \"bias\"", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize / 4" }, "when": ["f32_beta_bias_output_only_contract", "vec4Aligned", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "vectorScalar": "\"vec4<f32>\"", "HIDDEN_LEN": "hiddenSize / 4" }, "passes": [ { "id": "main",1 unmodified line "shader": "norm-skip-row-vec4.wgsl.jinja", "derive": { "simplified": false, "hasBias": "\"bias\" == \"bias\"", "hasBeta": true, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "usesF16Spec": false, "hidden": "hiddenSize", "hiddenVec": "hiddenSize / 4", "wg": "skipWgVec4", "vecType": "\"vec4<f32>\"", "useSubgroups": "hasSubgroups" }, "bindings": ["input", "skip", "gamma", "beta", "bias", "output", "params_2"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input", "skip", "gamma", "beta", "bias", "output", "params_main"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 } } ] }, { "id": "beta_bias_output_only_row", "priority": 10, "when": ["f32_beta_bias_output_only_contract", "normResourcesFit", "rowDispatchFits"], "when": ["f32_beta_bias_output_only_contract", "normResourcesFit", "rowDispatchFits", "hiddenSize != 1", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "useSubgroups": "hasSubgroups", "hasBeta": true, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "hasBias": "\"bias\" == \"bias\"", "useSubgroups": "hasSubgroups", "scalar": "\"f32\"", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize"3 unmodified lines "id": "main", "name": "SkipLayerNormalization.Row", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_2", "skip_2", "bias_2", "gamma_2", "beta_2", "output_2", "params_3"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input_main", "skip_main", "bias_main", "gamma_main", "beta_main", "output_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "beta_no_bias_output_only_vec4_f16", "id": "beta_bias_output_only_vec4_f16", "priority": 20, "when": ["f16_beta_no_bias_output_only_contract", "vec4Aligned", "hasSubgroups or \"no_bias\" == \"bias\" or portableWideExecution", "normResourcesFit", "rowDispatchFits"], "derive": { "scalar": "\"f16\"", "vectorScalar": "\"vec4<f16>\"", "hasBias": "\"no_bias\" == \"bias\"", "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize / 4" }, "when": ["f16_beta_bias_output_only_contract", "vec4Aligned", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"], "derive": { "vectorScalar": "\"vec4<f16>\"", "HIDDEN_LEN": "hiddenSize / 4" }, "passes": [ { "id": "main",1 unmodified line "shader": "norm-skip-row-vec4.wgsl.jinja", "derive": { "simplified": false, "hasBias": "\"no_bias\" == \"bias\"", "hasBeta": true, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "usesF16Spec": true, "hidden": "hiddenSize", "hiddenVec": "hiddenSize / 4", "wg": "skipWgVec4", "vecType": "\"vec4<f16>\"", "useSubgroups": "hasSubgroups" }, "bindings": ["input", "skip", "gamma", "beta", "output", "params_2"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input", "skip", "gamma", "beta", "bias", "output", "params_main"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 } } ] }, { "id": "beta_no_bias_output_only_row_f16", "id": "beta_bias_output_only_row_f16", "priority": 10, "when": ["f16_beta_no_bias_output_only_contract", "normResourcesFit", "rowDispatchFits"], "when": ["f16_beta_bias_output_only_contract", "normResourcesFit", "rowDispatchFits", "hiddenSize != 1", "not present.meanT and not present.invStdT"], "derive": { "simplified": false, "useSubgroups": "hasSubgroups", "hasBeta": true, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": false, "hasBias": "\"no_bias\" == \"bias\"", "useSubgroups": "hasSubgroups", "scalar": "\"f16\"", "usesF16": true, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize" },2 unmodified lines "id": "main", "name": "SkipLayerNormalization.Row.F16", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_2", "skip_2", "gamma_2", "beta_2", "output_2", "params_3"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input_main", "skip_main", "bias_main", "gamma_main", "beta_main", "output_main", "params__uniform"], "dispatch": { "x": "min(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "y": "ceilDiv(ceilDiv((rowCount * (1 if hiddenSize == 1 else skipWg)), (skipWg)), 65535)", "z": 1 } } ] }, { "id": "beta_bias_output_only_vec4_f16", "priority": 20, "when": ["f16_beta_bias_output_only_contract", "vec4Aligned", "hasSubgroups or \"bias\" == \"bias\" or portableWideExecution", "normResourcesFit", "rowDispatchFits"], "id": "stats_mean_plain", "when": ["statsContract", "present.meanT", "not present.invStdT", "not present.biasT", "not present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "scalar": "\"f16\"", "vectorScalar": "\"vec4<f16>\"", "hasBias": "\"bias\" == \"bias\"", "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize / 4" "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "name": "SkipLayerNormalization.Vec4.F16", "shader": "norm-skip-row-vec4.wgsl.jinja", "derive": { "simplified": false, "hasBias": "\"bias\" == \"bias\"", "hasBeta": true, "writeResidualSum": false, "usesF16Spec": true, "hidden": "hiddenSize", "hiddenVec": "hiddenSize / 4", "wg": "skipWgVec4", "vecType": "\"vec4<f16>\"", "useSubgroups": "hasSubgroups" }, "bindings": ["input", "skip", "gamma", "beta", "bias", "output", "params_2"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "output_main", "mean", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ] ], "intermediates": [] }, { "id": "beta_bias_output_only_row_f16", "priority": 10, "when": ["f16_beta_bias_output_only_contract", "normResourcesFit", "rowDispatchFits"], "id": "stats_mean_residual", "when": ["statsContract", "present.meanT", "not present.invStdT", "not present.biasT", "not present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "useSubgroups": "hasSubgroups", "hasBeta": true, "writeResidualSum": false, "hasBias": "\"bias\" == \"bias\"", "scalar": "\"f16\"", "usesF16": true, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize" "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "name": "SkipLayerNormalization.Row.F16", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_2", "skip_2", "bias_2", "gamma_2", "beta_2", "output_2", "params_3"], "dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }, "subgroupCollectivesWidth": "portable" "bindings": ["input_main", "skip_main", "gamma_main", "input_skip_bias_sum_main", "output_main", "mean", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ] ], "intermediates": [] }, { "id": "stats_mean_beta", "when": ["statsContract", "present.meanT", "not present.invStdT", "not present.biasT", "present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "beta_main", "output_main", "mean", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_mean_beta_residual", "when": ["statsContract", "present.meanT", "not present.invStdT", "not present.biasT", "present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "beta_main", "input_skip_bias_sum_main", "output_main", "mean", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_mean_bias", "when": ["statsContract", "present.meanT", "not present.invStdT", "present.biasT", "not present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "output_main", "mean", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_mean_bias_residual", "when": ["statsContract", "present.meanT", "not present.invStdT", "present.biasT", "not present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "input_skip_bias_sum_main", "output_main", "mean", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_mean_bias_beta", "when": ["statsContract", "present.meanT", "not present.invStdT", "present.biasT", "present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "beta_main", "output_main", "mean", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_mean_bias_beta_residual", "when": ["statsContract", "present.meanT", "not present.invStdT", "present.biasT", "present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "beta_main", "input_skip_bias_sum_main", "output_main", "mean", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_inv_plain", "when": ["statsContract", "not present.meanT", "present.invStdT", "not present.biasT", "not present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "output_main", "inv_std_var", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_inv_residual", "when": ["statsContract", "not present.meanT", "present.invStdT", "not present.biasT", "not present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "input_skip_bias_sum_main", "output_main", "inv_std_var", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_inv_beta", "when": ["statsContract", "not present.meanT", "present.invStdT", "not present.biasT", "present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "beta_main", "output_main", "inv_std_var", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_inv_beta_residual", "when": ["statsContract", "not present.meanT", "present.invStdT", "not present.biasT", "present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "beta_main", "input_skip_bias_sum_main", "output_main", "inv_std_var", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_inv_bias", "when": ["statsContract", "not present.meanT", "present.invStdT", "present.biasT", "not present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "output_main", "inv_std_var", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_inv_bias_residual", "when": ["statsContract", "not present.meanT", "present.invStdT", "present.biasT", "not present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "input_skip_bias_sum_main", "output_main", "inv_std_var", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_inv_bias_beta", "when": ["statsContract", "not present.meanT", "present.invStdT", "present.biasT", "present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "beta_main", "output_main", "inv_std_var", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_inv_bias_beta_residual", "when": ["statsContract", "not present.meanT", "present.invStdT", "present.biasT", "present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": false }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "beta_main", "input_skip_bias_sum_main", "output_main", "inv_std_var", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } } ], "intermediates": [] }, { "id": "stats_both_plain", "when": ["statsContract", "present.meanT", "present.invStdT", "not present.biasT", "not present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": true }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "output_main", "row_stats", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } }, { "id": "statistics", "shader": "norm-stats-copy.wgsl.jinja", "derive": { "workgroupSize": 64 }, "bindings": ["row_stats_read", "mean", "inv_std_var", "params_stats"], "dispatch": { "x": "min(ceilDiv((rowCount), (workgroupSize)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (workgroupSize)), 65535)", "z": 1 } } ], "intermediates": [{ "id": "rowStats", "dtype": "float32", "shape": "[rowCount, 2]" }] }, { "id": "stats_both_residual", "when": ["statsContract", "present.meanT", "present.invStdT", "not present.biasT", "not present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": true }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "input_skip_bias_sum_main", "output_main", "row_stats", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } }, { "id": "statistics", "shader": "norm-stats-copy.wgsl.jinja", "derive": { "workgroupSize": 64 }, "bindings": ["row_stats_read", "mean", "inv_std_var", "params_stats"], "dispatch": { "x": "min(ceilDiv((rowCount), (workgroupSize)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (workgroupSize)), 65535)", "z": 1 } } ], "intermediates": [{ "id": "rowStats", "dtype": "float32", "shape": "[rowCount, 2]" }] }, { "id": "stats_both_beta", "when": ["statsContract", "present.meanT", "present.invStdT", "not present.biasT", "present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": true }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "beta_main", "output_main", "row_stats", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } }, { "id": "statistics", "shader": "norm-stats-copy.wgsl.jinja", "derive": { "workgroupSize": 64 }, "bindings": ["row_stats_read", "mean", "inv_std_var", "params_stats"], "dispatch": { "x": "min(ceilDiv((rowCount), (workgroupSize)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (workgroupSize)), 65535)", "z": 1 } } ], "intermediates": [{ "id": "rowStats", "dtype": "float32", "shape": "[rowCount, 2]" }] }, { "id": "stats_both_beta_residual", "when": ["statsContract", "present.meanT", "present.invStdT", "not present.biasT", "present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": true }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "beta_main", "input_skip_bias_sum_main", "output_main", "row_stats", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } }, { "id": "statistics", "shader": "norm-stats-copy.wgsl.jinja", "derive": { "workgroupSize": 64 }, "bindings": ["row_stats_read", "mean", "inv_std_var", "params_stats"], "dispatch": { "x": "min(ceilDiv((rowCount), (workgroupSize)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (workgroupSize)), 65535)", "z": 1 } } ], "intermediates": [{ "id": "rowStats", "dtype": "float32", "shape": "[rowCount, 2]" }] }, { "id": "stats_both_bias", "when": ["statsContract", "present.meanT", "present.invStdT", "present.biasT", "not present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": true }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "output_main", "row_stats", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } }, { "id": "statistics", "shader": "norm-stats-copy.wgsl.jinja", "derive": { "workgroupSize": 64 }, "bindings": ["row_stats_read", "mean", "inv_std_var", "params_stats"], "dispatch": { "x": "min(ceilDiv((rowCount), (workgroupSize)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (workgroupSize)), 65535)", "z": 1 } } ], "intermediates": [{ "id": "rowStats", "dtype": "float32", "shape": "[rowCount, 2]" }] }, { "id": "stats_both_bias_residual", "when": ["statsContract", "present.meanT", "present.invStdT", "present.biasT", "not present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": true }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "input_skip_bias_sum_main", "output_main", "row_stats", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } }, { "id": "statistics", "shader": "norm-stats-copy.wgsl.jinja", "derive": { "workgroupSize": 64 }, "bindings": ["row_stats_read", "mean", "inv_std_var", "params_stats"], "dispatch": { "x": "min(ceilDiv((rowCount), (workgroupSize)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (workgroupSize)), 65535)", "z": 1 } } ], "intermediates": [{ "id": "rowStats", "dtype": "float32", "shape": "[rowCount, 2]" }] }, { "id": "stats_both_bias_beta", "when": ["statsContract", "present.meanT", "present.invStdT", "present.biasT", "present.betaT", "not present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": true }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "beta_main", "output_main", "row_stats", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } }, { "id": "statistics", "shader": "norm-stats-copy.wgsl.jinja", "derive": { "workgroupSize": 64 }, "bindings": ["row_stats_read", "mean", "inv_std_var", "params_stats"], "dispatch": { "x": "min(ceilDiv((rowCount), (workgroupSize)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (workgroupSize)), 65535)", "z": 1 } } ], "intermediates": [{ "id": "rowStats", "dtype": "float32", "shape": "[rowCount, 2]" }] }, { "id": "stats_both_bias_beta_residual", "when": ["statsContract", "present.meanT", "present.invStdT", "present.biasT", "present.betaT", "present.residualT", "normResourcesFit", "rowDispatchFits"], "derive": { "simplified": false, "hasBias": "present.biasT", "hasBeta": "present.betaT", "writeResidualSum": "present.residualT", "writeMean": "present.meanT", "writeInvStd": "present.invStdT", "scalar": "dtypes.T", "useSubgroups": false, "workgroupSize": "skipWg", "HIDDEN_LEN": "hiddenSize", "packedStatistics": true }, "passes": [ { "id": "main", "shader": "norm-skip-row.wgsl.jinja", "bindings": ["input_main", "skip_main", "gamma_main", "bias_main", "beta_main", "input_skip_bias_sum_main", "output_main", "row_stats", "params__uniform"], "dispatch": { "x": "min(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "y": "ceilDiv(ceilDiv(rowCount, skipWg) if hiddenSize == 1 else rowCount, 65535)", "z": 1 } }, { "id": "statistics", "shader": "norm-stats-copy.wgsl.jinja", "derive": { "workgroupSize": 64 }, "bindings": ["row_stats_read", "mean", "inv_std_var", "params_stats"], "dispatch": { "x": "min(ceilDiv((rowCount), (workgroupSize)), 65535)", "y": "ceilDiv(ceilDiv((rowCount), (workgroupSize)), 65535)", "z": 1 } } ], "intermediates": [{ "id": "rowStats", "dtype": "float32", "shape": "[rowCount, 2]" }] } ]}123345678910111213141011121314151617171819192021222324252627282930313233343529303637333438394041423843444546474849505152535455565758596061626364656667686970{ "name": "com.microsoft.SkipLayerNormalization", "id": "_com_microsoft_skiplayernormalization_webgpu_28a934b", "id": "_com_microsoft_skiplayernormalization_webgpu_a30f1f2", "version": 1, "license": "Apache-2.0", "backend": { "type": "webgpu" }, "digest": { "algorithm": "sha256", "files": { "bench.json": "dZADuGnHvG3kWGPS0BGgmikuwdi16tD/Sk4HbGC9UV0=", "manifest.json": "G6ZofqPdSuhkAxEuuKIlW4fQ/fCsDwxEzafKwVqGEY8=", "norm-skip-row-vec4.wgsl.jinja": "bH8L9BYJ/3XQXE2zP8kvZc4wlhAbcAolI4/p0xXskzM=", "norm-skip-row.wgsl.jinja": "aERQfDDXx6lwKuyahwcemgFllRSq46egf2++7f6bNtA=", "test.json": "K+KtXhWTSxbRlFwFfszdd1YKz9JnAOuDZ9ebLg7Y8w0=" "bench.json": "cVSe9BmYyynkTmGaCfti3+3as2tY8s7SiHcDUGZXadQ=", "manifest.json": "eBeukaRPaePto8cDuxf/pVi95UUFHU+jR4Tcc4/FFh4=", "norm-skip-row-vec4.wgsl.jinja": "hpoa1+W36ADP2AlqvZAoWFHCZPTBrUIlgVIQXE98oTE=", "norm-skip-row.wgsl.jinja": "LOw1CZFwolmaeaXpWSTi8ToiXzTfvJDoaapF2N6a0x4=", "norm-stats-copy.wgsl.jinja": "4PNrRNFbMWP9csH7RrxSvJuAGSn5aDfZZPw/IZEVmjU=", "test.json": "upshAVlCpYOJn3G1M4TGhznjHzx8ybo8uae8zkB932s=" } }, "provenance": { "kernel": { "sha": "91d990483a174128daf7673f3f37a7c890493ae1", "dirty": false } }, "provenance": { "kernel": { "sha": "6fdf6301e2bbcc2f03bf1eaf493b7ad55ef33afc", "dirty": false } }, "webgpu": { "manifestSpec": "2.0", "manifestSpec": "2.1", "variants": { "hidden1_f32_no_beta": ["norm-skip-row.wgsl.jinja"], "hidden1_f32_beta": ["norm-skip-row.wgsl.jinja"], "hidden1_f16_no_beta": ["norm-skip-row.wgsl.jinja"], "hidden1_f16_beta": ["norm-skip-row.wgsl.jinja"], "beta_output_only_vec4_broadcast": ["norm-skip-row-vec4.wgsl.jinja"], "beta_bias_vec4": ["norm-skip-row-vec4.wgsl.jinja"], "beta_bias_row": ["norm-skip-row.wgsl.jinja"], "beta_no_bias_vec4": ["norm-skip-row-vec4.wgsl.jinja"], "beta_no_bias_row": ["norm-skip-row.wgsl.jinja"], "beta_bias_vec4_f16": ["norm-skip-row-vec4.wgsl.jinja"], "no_beta_output_only_vec4": ["norm-skip-row-vec4.wgsl.jinja"], "no_beta_output_only_row": ["norm-skip-row.wgsl.jinja"], "no_beta_output_only_vec4_f16": ["norm-skip-row-vec4.wgsl.jinja"], "no_beta_output_only_row_f16": ["norm-skip-row.wgsl.jinja"], "beta_no_bias_vec4": ["norm-skip-row-vec4.wgsl.jinja"], "beta_no_bias_row": ["norm-skip-row.wgsl.jinja"], "beta_no_bias_output_only_vec4": ["norm-skip-row-vec4.wgsl.jinja"], "beta_no_bias_output_only_row": ["norm-skip-row.wgsl.jinja"], "beta_bias_output_only_vec4": ["norm-skip-row-vec4.wgsl.jinja"], "beta_bias_output_only_row": ["norm-skip-row.wgsl.jinja"], "beta_no_bias_output_only_vec4_f16": ["norm-skip-row-vec4.wgsl.jinja"], "beta_no_bias_output_only_row_f16": ["norm-skip-row.wgsl.jinja"], "beta_bias_output_only_vec4": ["norm-skip-row-vec4.wgsl.jinja"], "beta_bias_output_only_row": ["norm-skip-row.wgsl.jinja"], "beta_bias_output_only_vec4_f16": ["norm-skip-row-vec4.wgsl.jinja"], "beta_bias_output_only_row_f16": ["norm-skip-row.wgsl.jinja"] "beta_bias_output_only_row_f16": ["norm-skip-row.wgsl.jinja"], "stats_mean_plain": ["norm-skip-row.wgsl.jinja"], "stats_mean_residual": ["norm-skip-row.wgsl.jinja"], "stats_mean_beta": ["norm-skip-row.wgsl.jinja"], "stats_mean_beta_residual": ["norm-skip-row.wgsl.jinja"], "stats_mean_bias": ["norm-skip-row.wgsl.jinja"], "stats_mean_bias_residual": ["norm-skip-row.wgsl.jinja"], "stats_mean_bias_beta": ["norm-skip-row.wgsl.jinja"], "stats_mean_bias_beta_residual": ["norm-skip-row.wgsl.jinja"], "stats_inv_plain": ["norm-skip-row.wgsl.jinja"], "stats_inv_residual": ["norm-skip-row.wgsl.jinja"], "stats_inv_beta": ["norm-skip-row.wgsl.jinja"], "stats_inv_beta_residual": ["norm-skip-row.wgsl.jinja"], "stats_inv_bias": ["norm-skip-row.wgsl.jinja"], "stats_inv_bias_residual": ["norm-skip-row.wgsl.jinja"], "stats_inv_bias_beta": ["norm-skip-row.wgsl.jinja"], "stats_inv_bias_beta_residual": ["norm-skip-row.wgsl.jinja"], "stats_both_plain": ["norm-skip-row.wgsl.jinja", "norm-stats-copy.wgsl.jinja"], "stats_both_residual": ["norm-skip-row.wgsl.jinja", "norm-stats-copy.wgsl.jinja"], "stats_both_beta": ["norm-skip-row.wgsl.jinja", "norm-stats-copy.wgsl.jinja"], "stats_both_beta_residual": ["norm-skip-row.wgsl.jinja", "norm-stats-copy.wgsl.jinja"], "stats_both_bias": ["norm-skip-row.wgsl.jinja", "norm-stats-copy.wgsl.jinja"], "stats_both_bias_residual": ["norm-skip-row.wgsl.jinja", "norm-stats-copy.wgsl.jinja"], "stats_both_bias_beta": ["norm-skip-row.wgsl.jinja", "norm-stats-copy.wgsl.jinja"], "stats_both_bias_beta_residual": ["norm-skip-row.wgsl.jinja", "norm-stats-copy.wgsl.jinja"] } }}1234567823456711128141516171819202122910111213282930313233141536373839404142434445464748491617181920{% macro wgsl_tree_fold_stmt(a, op, idx, svar) %}{% if op == "max" %}{{ a }}[{{ idx }}] = max({{ a }}[{{ idx }}], {{ a }}[{{ idx }} + {{ svar }}]);{%- else %}{{ a }}[{{ idx }}] = {{ a }}[{{ idx }}] + {{ a }}[{{ idx }} + {{ svar }}];{%- endif %}{% endmacro %}{% macro wgsl_tree_fold(arrays, op="add", idx="lid", wg="WORKGROUP_SIZE", svar="stride", typed=false, form="tail", breakInline=false, bodyInline=false, barrierFirst=false) %}{% if op == "max" or op == "min" %}{{ a }}[{{ idx }}] = {{ op }}({{ a }}[{{ idx }}], {{ a }}[{{ idx }} + {{ svar }}]);{% else %}{{ a }}[{{ idx }}] = {{ a }}[{{ idx }}] {{ "*" if op == "prod" else "+" }} {{ a }}[{{ idx }} + {{ svar }}];{% endif %}{% endmacro %}{% macro wgsl_tree_fold(arrays, op="add", idx="lid", wg="WORKGROUP_SIZE", svar="stride", typed=false, form="tail", breakInline=false, bodyInline=false, barrierFirst=false, reuse=false) %} var {{ svar }}{{ ": u32 " if typed else " " }}= {{ wg }} / 2u; loop {{% if form == "head" %}{% if breakInline %} if ({{ svar }} == 0u) { break; }{% else %} if ({{ svar }} == 0u) { break; }{% endif %}{% endif %}{% if bodyInline %} if ({{ idx }} < {{ svar }}) { {{ wgsl_tree_fold_stmt(arrays[0], op, idx, svar) }} }{% else %} if ({{ idx }} < {{ svar }}) {{% for a in arrays %} {{ wgsl_tree_fold_stmt(a, op, idx, svar) }}{% endfor %} }{% endif %}{% if form == "head" %}{% if barrierFirst %} workgroupBarrier(); {{ svar }} = {{ svar }} / 2u;{% else %} {{ svar }} = {{ svar }} / 2u; workgroupBarrier();{% endif %}{% else %} workgroupBarrier(); if ({{ svar }} == 1u) { break; } {{ svar }} = {{ svar }} / 2u;{% endif %} }{%- endmacro %}{% set broadcastSkip = broadcastSkip is defined and broadcastSkip %}{% set useSubgroups = useSubgroups %}{% if usesF16Spec %}enable f16;{% endif %} }{% endmacro %}{% set broadcastSkip = broadcastSkip is defined and broadcastSkip %}{% if useSubgroups %}enable subgroups;{% endif %}1234567823456711121314891018192021221112131415282930311633343536371739404142434445464748181920215051522223242526582728293026 unmodified lines5758596061926263646 unmodified lines717273105747576777879111112113808182838485868788896 unmodified lines9697989910010110210310410510610710810922 unmodified lines132133134135136137138139140141142143144145{% macro wgsl_tree_fold_stmt(a, op, idx, svar) %}{% if op == "max" %}{{ a }}[{{ idx }}] = max({{ a }}[{{ idx }}], {{ a }}[{{ idx }} + {{ svar }}]);{%- else %}{{ a }}[{{ idx }}] = {{ a }}[{{ idx }}] + {{ a }}[{{ idx }} + {{ svar }}];{%- endif %}{% endmacro %}{% macro wgsl_tree_fold(arrays, op="add", idx="lid", wg="WORKGROUP_SIZE", svar="stride", typed=false, form="tail", breakInline=false, bodyInline=false, barrierFirst=false) %}{% if op == "max" or op == "min" %}{{ a }}[{{ idx }}] = {{ op }}({{ a }}[{{ idx }}], {{ a }}[{{ idx }} + {{ svar }}]);{% else %}{{ a }}[{{ idx }}] = {{ a }}[{{ idx }}] {{ "*" if op == "prod" else "+" }} {{ a }}[{{ idx }} + {{ svar }}];{% endif %}{% endmacro %}{% macro wgsl_tree_fold(arrays, op="add", idx="lid", wg="WORKGROUP_SIZE", svar="stride", typed=false, form="tail", breakInline=false, bodyInline=false, barrierFirst=false, reuse=false) %} var {{ svar }}{{ ": u32 " if typed else " " }}= {{ wg }} / 2u; loop {{% if form == "head" %}{% if breakInline %} if ({{ svar }} == 0u) { break; }{% else %} if ({{ svar }} == 0u) { break; }{% endif %}{% endif %}{% if bodyInline %} if ({{ idx }} < {{ svar }}) { {{ wgsl_tree_fold_stmt(arrays[0], op, idx, svar) }} }{% else %} if ({{ idx }} < {{ svar }}) {{% for a in arrays %} {{ wgsl_tree_fold_stmt(a, op, idx, svar) }}{% endfor %} }{% endif %}{% if form == "head" %}{% if barrierFirst %} workgroupBarrier(); {{ svar }} = {{ svar }} / 2u;{% else %} {{ svar }} = {{ svar }} / 2u; workgroupBarrier();{% endif %}{% else %} workgroupBarrier(); if ({{ svar }} == 1u) { break; } {{ svar }} = {{ svar }} / 2u;{% endif %} }{%- endmacro %}
/* One workgroup normalizes each row of residual = input + skip, with an * optional bias. */ }{% endmacro %}/* Normalize residual = input + skip, with an optional bias. Reductions use * one workgroup per row; closed-form one-element rows use one invocation. */{% set degenerateRow = (not simplified) and hiddenSize == 1 %}{% if usesF16 %}enable f16;{% endif %}{% if useSubgroups and not degenerateRow %}enable subgroups;{% endif %}{{ env.wgsl.resourceDeclarations }}
{% if not degenerateRow or writeResidualSum %}{% if not degenerateRow or writeResidualSum or (writeMean is defined and writeMean) %}const HIDDEN: u32 = {{ hiddenSize }}u;{% endif %}const WG: u32 = {{ workgroupSize }}u;26 unmodified lines}{% endif %}{% endif %}{% if not degenerateRow or writeResidualSum or (writeMean is defined and writeMean) %}
{% if not degenerateRow or writeResidualSum %}fn residual_value(row: u32, d: u32) -> f32 { let index = row * HIDDEN + d; var value = f32(input[index]) + f32(skip[index]);6 unmodified lines
@compute @workgroup_size(WG, 1, 1)fn main( @builtin(workgroup_id) wg: vec3<u32>{% if not degenerateRow %}, @builtin({{ "global_invocation_id" if degenerateRow else "workgroup_id" }}) {{ "gid" if degenerateRow else "wg" }}: vec3<u32>{% if not degenerateRow %}, @builtin(local_invocation_id) lid: vec3<u32>{% endif %}{% if useSubgroups and not degenerateRow %}, @builtin(subgroup_invocation_id) sg_lane: u32, @builtin(subgroup_id) sg_id: u32, @builtin(num_subgroups) num_sg: u32{% endif %}) { // 2D-folded row index: wg.y carries the high bits past the per-axis dispatch fold width. // Reduces to wg.x when the dispatch does not fold; // the row >= params.rows guard drops the over-dispatched tail. // Fold the row grid across workgroups; independent rows also include the // invocation offset. The bounds guard drops the final dispatch tail.{% if degenerateRow %} let row = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * WG;{% else %} let row = wg.x + wg.y * {{ DISPATCH_FOLD_WIDTH }}u;{% endif %} if (row >= params.rows) { return; }6 unmodified lines // the variance are exactly zero and the output reduces to beta. The closed // form avoids computing that zero by subtracting two equal rounded values. let row_inv = inverseSqrt(params.epsilon);{% if packedStatistics is defined and packedStatistics %} row_stats[row] = vec2<f32>(residual_value(row, 0u), row_inv);{% elif writeMean is defined and writeMean %} mean[row] = residual_value(row, 0u);{% endif %}{% if writeInvStd is defined and writeInvStd and not (packedStatistics is defined and packedStatistics) %} inv_std_var[row] = row_inv;{% endif %}{% if writeResidualSum %} let residual = residual_value(row, 0u); input_skip_bias_sum[row] = {{ scalar }}(residual);22 unmodified lines let row_mean = shift + mean_delta; let variance = max(totals.y / f32(HIDDEN) - mean_delta * mean_delta, 0.0); let row_inv = inverseSqrt(variance + params.epsilon);{% if packedStatistics is defined and packedStatistics %} if (tid == 0u) { row_stats[row] = vec2<f32>(row_mean, row_inv); }{% elif writeMean is defined and writeMean %} if (tid == 0u) { mean[row] = row_mean; }{% endif %}{% if writeInvStd is defined and writeInvStd and not (packedStatistics is defined and packedStatistics) %} if (tid == 0u) { inv_std_var[row] = row_inv; }{% endif %} for (var d = tid; d < HIDDEN; d = d + WG) { let index = row * HIDDEN + d; let residual = residual_value(row, d);123456789101112131415{% macro flat_index_2d(workgroupSize, name="i", bound="params.count", guardInline=false) %}{% set wgTerm = workgroupSize ~ "u" if workgroupSize is number else workgroupSize %} // 2D-folded flat index: gid.y carries the high bits past the dispatch's // per-axis workgroup fold width. let {{ name }} = gid.x + gid.y * {{ DISPATCH_FOLD_WIDTH }}u * {{ wgTerm }}; if ({{ name }} >= {{ bound }}) { return; }{% endmacro %}{{ env.wgsl.resourceDeclarations }}// Separate optional outputs keep the reduction within eight storage bindings.@compute @workgroup_size({{ workgroupSize }})fn main(@builtin(global_invocation_id) gid: vec3<u32>) {{{ flat_index_2d(workgroupSize, "row", "params.rows", guardInline=true) }} let stats = row_stats[row]; mean[row] = stats.x; inv_std_var[row] = stats.y;}475 unmodified lines47647747847947948048148248 unmodified lines531532533534534535536537634 unmodified lines1172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925475 unmodified lines { "name": "no_beta_output_only_hidden6_unaligned_row", "provenance": { "notes": "Beta and optional outputs are omitted, and hidden size 6 is not divisible by four, selecting the scalar no-beta output-only row path on every tier." "notes": "Beta and optional outputs are omitted; hidden size six exercises a non-four-aligned row." }, "attrs": { "epsilon": 0.00001 }, "inputs": {48 unmodified lines { "name": "beta_no_bias_output_only_hidden6_unaligned_row", "provenance": { "notes": "Beta is present, bias and optional outputs are omitted, and hidden size 6 selects the scalar output-only row path on every tier." "notes": "Beta is present, bias and optional outputs are omitted, and hidden size 6 leaves a partial four-element storage group." }, "attrs": { "epsilon": 0.00001 }, "inputs": {634 unmodified lines } }, "outputs": { "outputT": { "dtype": "float16", "shape": [3, 8], "tolerance": 0.002 } } }, { "name": "independent_rows_float32_257x1_option0_wgdefault_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [257, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float32", "shape": [257, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [257, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float32_257x1_option1_wgdefault_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [257, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float32", "shape": [257, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.25] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [257, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float32_257x1_option2_wgdefault_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [257, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float32", "shape": [257, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [257, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float32_3x31x1_option2_wg1_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "tunables": { "MAX_WORKGROUP_SIZE": 1 }, "inputs": { "inputT": { "dtype": "float32", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float32", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [3, 31, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float32_3x31x1_option2_wg8_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "tunables": { "MAX_WORKGROUP_SIZE": 8 }, "inputs": { "inputT": { "dtype": "float32", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float32", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [3, 31, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float32_3x31x1_option2_wg64_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "tunables": { "MAX_WORKGROUP_SIZE": 64 }, "inputs": { "inputT": { "dtype": "float32", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float32", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [3, 31, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float32_3x31x1_option2_wg128_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "tunables": { "MAX_WORKGROUP_SIZE": 128 }, "inputs": { "inputT": { "dtype": "float32", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float32", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [3, 31, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float32_524289x1_option3_wg8_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "tunables": { "MAX_WORKGROUP_SIZE": 8 }, "inputs": { "inputT": { "dtype": "float32", "shape": [524289, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float32", "shape": [524289, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [524289, 1], "tolerance": 0, "allowNaN": false }, "residualT": { "dtype": "float32", "shape": [524289, 1], "tolerance": 0 } } }, { "name": "independent_rows_float32_257x1_option2_wgdefault_epsilon0", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0 }, "inputs": { "inputT": { "dtype": "float32", "shape": [257, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float32", "shape": [257, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [257, 1], "tolerance": 0, "allowNaN": true } } }, { "name": "independent_rows_float16_257x1_option0_wgdefault_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [257, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float16", "shape": [257, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [1.125] } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [257, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float16_257x1_option1_wgdefault_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [257, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float16", "shape": [257, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [-0.25] } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [257, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float16_257x1_option2_wgdefault_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [257, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float16", "shape": [257, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [257, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float16_3x31x1_option2_wg1_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "tunables": { "MAX_WORKGROUP_SIZE": 1 }, "inputs": { "inputT": { "dtype": "float16", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float16", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [3, 31, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float16_3x31x1_option2_wg8_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "tunables": { "MAX_WORKGROUP_SIZE": 8 }, "inputs": { "inputT": { "dtype": "float16", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float16", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [3, 31, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float16_3x31x1_option2_wg64_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "tunables": { "MAX_WORKGROUP_SIZE": 64 }, "inputs": { "inputT": { "dtype": "float16", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float16", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [3, 31, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float16_3x31x1_option2_wg128_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "tunables": { "MAX_WORKGROUP_SIZE": 128 }, "inputs": { "inputT": { "dtype": "float16", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float16", "shape": [3, 31, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [3, 31, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float16_524289x1_option2_wg8_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "tunables": { "MAX_WORKGROUP_SIZE": 8 }, "inputs": { "inputT": { "dtype": "float16", "shape": [524289, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float16", "shape": [524289, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [524289, 1], "tolerance": 0, "allowNaN": false } } }, { "name": "independent_rows_float16_257x1_option2_wgdefault_epsilon0", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0 }, "inputs": { "inputT": { "dtype": "float16", "shape": [257, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float16", "shape": [257, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float16", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [257, 1], "tolerance": 0, "allowNaN": true } } }, { "name": "independent_rows_float32_257x1_option3_wgdefault_epsilon0.00001", "provenance": { "notes": "One-element normalization has an intrinsically uniform result. Uniform inputs pin its closed-form value, workgroup tails, optional outputs, and epsilon behavior; the GPU row-coverage test checks poisoned outputs and varying residuals separately." }, "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [257, 1], "data": { "kind": "constant", "value": 1.25 } }, "skipT": { "dtype": "float32", "shape": [257, 1], "data": { "kind": "constant", "value": 0.5 } }, "gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [1.125] } }, "betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-0.25] } }, "biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.125] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [257, 1], "tolerance": 0, "allowNaN": false }, "residualT": { "dtype": "float32", "shape": [257, 1], "tolerance": 0 } } }, { "name": "ort_skip_layer_norm_large_magnitude_row", "attrs": { "epsilon": 1e-12 }, "inputs": { "inputT": { "dtype": "float32", "shape": [1, 4], "data": { "kind": "values", "values": [10000.0, 10001.0, 9999.0, 10000.0] } }, "skipT": { "dtype": "float32", "shape": [1, 4], "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] } }, "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, 1.0, 1.0, 1.0] } }, "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [0.0, 0.0, 0.0, 0.0] } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [1, 4], "tolerance": 0.0001 } } }, { "name": "stats_mean_plain", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_mean_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001 } } }, { "name": "stats_mean_beta", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "betaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_mean_beta_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "betaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001 } } }, { "name": "stats_mean_bias", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_mean_bias_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002 } } }, { "name": "stats_mean_bias_beta", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } }, "betaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_mean_bias_beta_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } }, "betaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002 } } }, { "name": "stats_inv_plain", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_inv_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001 } } }, { "name": "stats_inv_beta", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "betaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_inv_beta_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "betaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001 } } }, { "name": "stats_inv_bias", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_inv_bias_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002 } } }, { "name": "stats_inv_bias_beta", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } }, "betaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_inv_bias_beta_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } }, "betaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002 } } }, { "name": "stats_both_plain", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_both_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001 } } }, { "name": "stats_both_beta", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "betaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_both_beta_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float32", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "betaT": { "dtype": "float32", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001, "relTolerance": 0.00001 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float32", "shape": [2, 3, 5], "tolerance": 0.00001 } } }, { "name": "stats_both_bias", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_both_bias_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002 } } }, { "name": "stats_both_bias_beta", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } }, "betaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 } } }, { "name": "stats_both_bias_beta_residual", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [2, 3, 5], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } }, "betaT": { "dtype": "float16", "shape": [5], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002, "relTolerance": 0.002 }, "meanT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [2, 3, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float16", "shape": [2, 3, 5], "tolerance": 0.002 } } }, { "name": "ort_saved_statistics", "provenance": { "source": "onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc", "test": "SkipLayerNormStatistics" }, "attrs": { "epsilon": 1e-12 }, "inputs": { "inputT": { "dtype": "float32", "shape": [1, 1, 4], "data": { "kind": "values", "values": [10000.0, 10001.0, 9999.0, 10000.0] } }, "skipT": { "dtype": "float32", "shape": [1, 1, 4], "data": { "kind": "constant", "value": 0.0 } }, "gammaT": { "dtype": "float32", "shape": [4], "data": { "kind": "constant", "value": 1.0 } }, "betaT": { "dtype": "float32", "shape": [4], "data": { "kind": "constant", "value": 0.0 } } }, "outputs": { "outputT": { "dtype": "float32", "shape": [1, 1, 4], "tolerance": 0.000001, "data": { "kind": "values", "values": [0.0, 1.4142135, -1.4142135, 0.0] } }, "meanT": { "dtype": "float32", "shape": [1, 1, 1], "data": { "kind": "values", "values": [10000.0] } }, "invStdT": { "dtype": "float32", "shape": [1, 1, 1], "tolerance": 0.000001, "data": { "kind": "values", "values": [1.4142135] } } } }, { "name": "stats_single_element_row", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [1, 1, 1], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [1, 1, 1], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [1], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [1, 1, 1], "tolerance": 0.002, "relTolerance": 0.002 }, "meanT": { "dtype": "float32", "shape": [1, 1, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "invStdT": { "dtype": "float32", "shape": [1, 1, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float16", "shape": [1, 1, 1], "tolerance": 0.002 } } }, { "name": "stats_single_element_mean", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [1, 1, 1], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [1, 1, 1], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [1], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [1, 1, 1], "tolerance": 0.002, "relTolerance": 0.002 }, "meanT": { "dtype": "float32", "shape": [1, 1, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float16", "shape": [1, 1, 1], "tolerance": 0.002 } } }, { "name": "stats_single_element_inverse", "attrs": { "epsilon": 0.00001 }, "inputs": { "inputT": { "dtype": "float16", "shape": [1, 1, 1], "data": { "kind": "linspace", "start": -2.0, "end": 3.0 } }, "skipT": { "dtype": "float16", "shape": [1, 1, 1], "data": { "kind": "linspace", "start": 0.4, "end": -0.7 } }, "gammaT": { "dtype": "float16", "shape": [1], "data": { "kind": "linspace", "start": 0.5, "end": 1.5 } }, "biasT": { "dtype": "float16", "shape": [1], "data": { "kind": "linspace", "start": -0.2, "end": 0.3 } }, "betaT": { "dtype": "float16", "shape": [1], "data": { "kind": "linspace", "start": 0.2, "end": -0.3 } } }, "outputs": { "outputT": { "dtype": "float16", "shape": [1, 1, 1], "tolerance": 0.002, "relTolerance": 0.002 }, "invStdT": { "dtype": "float32", "shape": [1, 1, 1], "tolerance": 0.00001, "relTolerance": 0.00001 }, "residualT": { "dtype": "float16", "shape": [1, 1, 1], "tolerance": 0.002 } } } ]}README.md+40-3
build/webgpu/bench.json+121
build/webgpu/manifest.json+1136-248
build/webgpu/metadata.json+42-13
build/webgpu/norm-skip-row-vec4.wgsl.jinja+6-38
build/webgpu/norm-skip-row.wgsl.jinja+32-44
build/webgpu/norm-stats-copy.wgsl.jinjaAdded+15
build/webgpu/test.json+750-2