sync 4385228f788d
Browse filesFiles changed (8)
53 unmodified lines5455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112253 unmodified linesOne 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 requirementsSome implementation variants require `shader-f16`. These are route-specific capabilities, not package-wide requirements; availability also depends on the request shape and dtype.## Files- [`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 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.3```Required output shapes and logical data types are inferred from the supplied inputs and attributes; result tensors are allocated automatically.The `version: 1` option selects the published kernel contract; it is independent of any operator opset, contrib `since_version`, or model version.It follows the `v1` branch as fixes land. To pin exact artifact bytes, pass a 40-character commit `revision` instead of `version`.Replace each `*Data` placeholder with a typed array containing the corresponding input data.```jsimport { getKernel } from "@huggingface/kernels";const kernel = await getKernel("webgpu-kernels/com.microsoft.SkipLayerNormalization", { version: 1 });const { outputT } = await kernel({inputT: { data: inputTData, shape: [2, 4] },skipT: { data: skipTData, shape: [2, 4] },gammaT: { data: gammaTData, shape: [4] },});```53 unmodified lines54555657585960616263646566676869707172737475767778798081828384858687888990919293949596979853 unmodified linesOne implementation is selected per call from the device capabilities, the request shapes and the dtypes; these notes say what each one covers.- `row` — One workgroup reduces each row; one-element rows instead run one invocation each and classify the rounded input-plus-skip residual and scale before using their closed-form epilogue.- `stats` — Row normalization that also returns the requested statistics; when both are requested the row pass packs them and a second pass copies them out.## Files- [`metadata.json`](https://huggingface.co/kernels/webgpu-kernels/com.microsoft.SkipLayerNormalization/blob/v1/build/webgpu/metadata.json) — kernel metadata (id, file digests, manifest spec, provenance)- [`manifest.json`](https://huggingface.co/kernels/webgpu-kernels/com.microsoft.SkipLayerNormalization/blob/v1/build/webgpu/manifest.json) — the op contract (source of truth)- [`test.json`](https://huggingface.co/kernels/webgpu-kernels/com.microsoft.SkipLayerNormalization/blob/v1/build/webgpu/test.json) — correctness cases- [`bench.json`](https://huggingface.co/kernels/webgpu-kernels/com.microsoft.SkipLayerNormalization/blob/v1/build/webgpu/bench.json) — benchmark cases- [`norm-skip-row-vec4.wgsl.jinja`](https://huggingface.co/kernels/webgpu-kernels/com.microsoft.SkipLayerNormalization/blob/v1/build/webgpu/norm-skip-row-vec4.wgsl.jinja)- [`norm-skip-row.wgsl.jinja`](https://huggingface.co/kernels/webgpu-kernels/com.microsoft.SkipLayerNormalization/blob/v1/build/webgpu/norm-skip-row.wgsl.jinja)- [`norm-stats-copy.wgsl.jinja`](https://huggingface.co/kernels/webgpu-kernels/com.microsoft.SkipLayerNormalization/blob/v1/build/webgpu/norm-stats-copy.wgsl.jinja)## Use with `@huggingface/kernels````shnpm install --save-exact @huggingface/kernels@0.0.1-preview.4```Paste the example into a browser app that resolves npm imports. Serve the app over HTTPS or localhost with WebGPU available.Required output shapes and logical data types are inferred from the supplied inputs and attributes; result tensors are allocated automatically.The `version: 1` option selects the published kernel contract; it is independent of any operator opset, contrib `since_version`, or model version.It follows the `v1` branch as fixes land. To pin exact artifact bytes, pass a 40-character commit `revision` instead of `version`.```jsimport { getKernel } from "@huggingface/kernels";const kernel = await getKernel("webgpu-kernels/com.microsoft.SkipLayerNormalization", { version: 1 });const inputTData = Float32Array.of(0.8, -0.5, 0, 1, 0.5, 0.2, 0.3, -0.6);const skipTData = Float32Array.of(0.1, -0.2, 0.3, 1, 0.5, 0.1, 0.4, 1.6);const gammaTData = Float32Array.of(0.3, 0.2, 4, 2.2);const { outputT } = await kernel({inputT: { data: inputTData, shape: [2, 4] },skipT: { data: skipTData, shape: [2, 4] },gammaT: { data: gammaTData, shape: [4] },});console.log({ outputT });```
136 unmodified lines137138139140141142143144145146147148149150151152153154155156157158159136 unmodified lines},"bench": { "metrics": [{ "type": "bandwidth", "value": "4 * (4 * args.rows * args.hidden + 2 * args.hidden)" }] }},{"name": "skip-layernorm-f32-4096x768-hidden768-aligned","preset": "model","vars": { "rows": 4096, "hidden": 768 },"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": { "shape": [4096, 768], "dtype": "float32", "dist": "normal", "seed": 413, "scale": 0.2 },"skipT": { "shape": [4096, 768], "dtype": "float32", "dist": "normal", "seed": 414, "scale": 0.2 },"gammaT": { "shape": [768], "dtype": "float32", "dist": "uniform", "seed": 415, "scale": 0.1, "offset": 1 },"betaT": { "shape": [768], "dtype": "float32", "dist": "normal", "seed": 416, "scale": 0.1 }},"outputs": {"outputT": { "shape": [4096, 768], "dtype": "float32" },"residualT": { "shape": [4096, 768], "dtype": "float32" }},"bench": { "metrics": [{ "type": "bandwidth", "value": "4 * (4 * args.rows * args.hidden + 2 * args.hidden)" }] }},{"name": "skip-layernorm-f32-rows1-hidden4096-decode","preset": "model",136 unmodified lines137138139140141142136 unmodified lines},"bench": { "metrics": [{ "type": "bandwidth", "value": "4 * (4 * args.rows * args.hidden + 2 * args.hidden)" }] }},{"name": "skip-layernorm-f32-rows1-hidden4096-decode","preset": "model",
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553{"domain": "com.microsoft","name": "SkipLayerNormalization","sinceVersion": 1,"inputs": {"inputT": { "onnx": "input", "dtype": "T" },"skipT": { "onnx": "skip", "dtype": "T" },"gammaT": { "onnx": "gamma", "dtype": "T", "rank": 1 },"betaT": { "onnx": "beta", "dtype": "T", "rank": 1, "optional": true },"biasT": { "onnx": "bias", "dtype": "T", "rank": 1, "optional": true }},"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","rank": "ranks.inputT","optional": true,"shape": "shapes.inputT"}},"attributes": { "epsilon": { "default": 9.999999960041972e-13 } },"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)) 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))))","rowDispatchFits": "rowCount <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) * min(device.limits.maxComputeWorkgroupsPerDimension, 65535)","normResourcesFit": "skipWg * 8 <= device.limits.maxComputeWorkgroupStorageSize and skipWgVec4 * 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","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","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)","f32_no_beta_output_contract": "coreContract and outputOnlyContract and noBetaContract and f32MainDtypes and not present.biasT","f32_beta_no_bias_output_only_contract": "coreContract and outputOnlyContract and betaContract and f32MainDtypes and not present.biasT and tensorDtypes.betaT == \"float32\"","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)","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", "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","struct": [{ "name": "rows", "type": "u32", "value": "rowCount" },{"name": "rowStride","type": "u32","value": "max(1, min(rowCount, min(device.limits.maxComputeWorkgroupsPerDimension, 65535)))"},{ "name": "epsilon", "type": "f32", "value": "attrs.epsilon" }]},"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","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", "not present.meanT and not present.invStdT"],"derive": { "vectorScalar": "\"vec4<f32>\"", "HIDDEN_LEN": "broadcastHiddenSize / 4" },"passes": [{"id": "main","name": "SkipLayerNormalization.BroadcastSkip","shader": "norm-skip-row-vec4.wgsl.jinja","derive": {"simplified": false,"hasBias": false,"hasBeta": true,"writeResidualSum": false,"broadcastSkip": true,"hidden": "broadcastHiddenSize","hiddenVec": "broadcastHiddenSize / 4","wg": "broadcastSkipWgVec4","vecType": "\"vec4<f32>\"","useSubgroups": "hasSubgroups"},"bindings": ["input","skip","gamma","beta","output",{"name": "params","struct": [{ "name": "rows", "type": "u32", "value": "dim(shapes.inputT, 0) * dim(shapes.inputT, 1)" },{"name": "rowStride","type": "u32","value": "max(1, min(broadcastRows, min(device.limits.maxComputeWorkgroupsPerDimension, 65535)))"},{ "name": "epsilon", "type": "f32", "value": "attrs.epsilon" },{ "name": "skipRows", "type": "u32", "value": "numel(shapes.skipT) / broadcastHiddenSize" }]}],"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", "not present.meanT and not present.invStdT"],"derive": { "vectorScalar": "\"vec4<f32>\"", "hasBias": "\"bias\" == \"bias\"", "HIDDEN_LEN": "hiddenSize / 4" },"passes": [{"id": "normalize","name": "SkipLayerNormalization.Vec4.Normalize","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", "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", "not present.meanT and not present.invStdT"],"derive": {"simplified": false,"useSubgroups": "hasSubgroups","hasBeta": true,"writeResidualSum": true,"hasBias": "\"bias\" == \"bias\"","scalar": "\"f32\"","workgroupSize": "skipWg","HIDDEN_LEN": "hiddenSize"},"passes": [{"id": "normalize","name": "SkipLayerNormalization.Row.Normalize","shader": "norm-skip-row.wgsl.jinja","derive": { "writeResidualSum": true },"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", "not present.meanT and not present.invStdT"],"derive": { "vectorScalar": "\"vec4<f16>\"", "HIDDEN_LEN": "hiddenSize / 4" },"passes": [{"id": "main","name": "SkipLayerNormalization.Vec4","shader": "norm-skip-row-vec4.wgsl.jinja","derive": {"simplified": false,"hasBias": true,"hasBeta": true,"writeResidualSum": 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_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", "not present.meanT and not present.invStdT"],"derive": { "vectorScalar": "\"vec4<f32>\"", "HIDDEN_LEN": "hiddenSize / 4" },"passes": [{"id": "main","name": "SkipLayerNormalization.NoBetaOutputOnly.Vec4","shader": "norm-skip-row-vec4.wgsl.jinja","derive": {"simplified": 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", "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", "hiddenSize != 1", "not present.meanT and not present.invStdT"],"derive": {"simplified": false,"hasBias": "present.biasT","hasBeta": "present.betaT","writeResidualSum": false,"useSubgroups": "hasSubgroups","scalar": "\"f32\"","workgroupSize": "skipWg","HIDDEN_LEN": "hiddenSize"},"passes": [{"id": "main","name": "SkipLayerNormalization.NoBetaOutputOnly.Row","shader": "norm-skip-row.wgsl.jinja","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", "not present.meanT and not present.invStdT"],"derive": { "vectorScalar": "\"vec4<f16>\"", "HIDDEN_LEN": "hiddenSize / 4" },"passes": [{"id": "main","name": "SkipLayerNormalization.NoBetaOutputOnly.Vec4.F16","shader": "norm-skip-row-vec4.wgsl.jinja","derive": {"simplified": false,"hasBias": "present.biasT","hasBeta": "present.betaT","writeResidualSum": false,"hidden": "hiddenSize","hiddenVec": "hiddenSize / 4","wg": "skipWgVec4","vecType": "\"vec4<f16>\"","useSubgroups": "hasSubgroups"},"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", "hiddenSize != 1", "not present.meanT and not present.invStdT"],"derive": {"simplified": false,"hasBias": "present.biasT","hasBeta": "present.betaT","writeResidualSum": false,"useSubgroups": "hasSubgroups","scalar": "\"f16\"","workgroupSize": "skipWg","HIDDEN_LEN": "hiddenSize"},"passes": [{"id": "main","name": "SkipLayerNormalization.NoBetaOutputOnly.Row.F16","shader": "norm-skip-row.wgsl.jinja","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_output_only_vec4","priority": 20,"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","name": "SkipLayerNormalization.Vec4","shader": "norm-skip-row-vec4.wgsl.jinja","derive": {"simplified": 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", "params_main"],"dispatch": { "x": "min(rowCount, 65535)", "y": "ceilDiv(rowCount, 65535)", "z": 1 }}]},{"id": "beta_no_bias_output_only_row","priority": 10,"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","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", "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","priority": 20,"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.F16","shader": "norm-skip-row-vec4.wgsl.jinja","derive": {"simplified": false,"hasBias": "present.biasT","hasBeta": "present.betaT","writeResidualSum": false,"hidden": "hiddenSize","hiddenVec": "hiddenSize / 4","wg": "skipWgVec4","vecType": "\"vec4<f16>\"","useSubgroups": "hasSubgroups"},"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_f16","priority": 10,"when": ["f16_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","scalar": "\"f16\"","workgroupSize": "skipWg","HIDDEN_LEN": "hiddenSize"},"passes": [{"id": "main","name": "SkipLayerNormalization.Row.F16","shader": "norm-skip-row.wgsl.jinja","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", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"],"derive": { "vectorScalar": "\"vec4<f32>\"", "HIDDEN_LEN": "hiddenSize / 4" },"passes": [{"id": "main","name": "SkipLayerNormalization.Vec4","shader": "norm-skip-row-vec4.wgsl.jinja","derive": {"simplified": 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", "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", "hiddenSize != 1", "not present.meanT and not present.invStdT"],"derive": {"simplified": false,"hasBias": "present.biasT","hasBeta": "present.betaT","writeResidualSum": false,"useSubgroups": "hasSubgroups","scalar": "\"f32\"","workgroupSize": "skipWg","HIDDEN_LEN": "hiddenSize"},"passes": [{"id": "main","name": "SkipLayerNormalization.Row","shader": "norm-skip-row.wgsl.jinja","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", "normResourcesFit", "rowDispatchFits", "not present.meanT and not present.invStdT"],"derive": { "vectorScalar": "\"vec4<f16>\"", "HIDDEN_LEN": "hiddenSize / 4" },"passes": [{"id": "main","name": "SkipLayerNormalization.Vec4.F16","shader": "norm-skip-row-vec4.wgsl.jinja","derive": {"simplified": false,"hasBias": "present.biasT","hasBeta": "present.betaT","writeResidualSum": false,"hidden": "hiddenSize","hiddenVec": "hiddenSize / 4","wg": "skipWgVec4","vecType": "\"vec4<f16>\"","useSubgroups": "hasSubgroups"},"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_f16","priority": 10,"when": ["f16_beta_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","scalar": "\"f16\"","workgroupSize": "skipWg","HIDDEN_LEN": "hiddenSize"},"passes": [{"id": "main","name": "SkipLayerNormalization.Row.F16","shader": "norm-skip-row.wgsl.jinja","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": "stats_mean_plain","when": ["statsContract", "present.meanT", "not 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", "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_residual","when": ["statsContract", "present.meanT", "not 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", "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]" }]}]}1{"domain":"com.microsoft","name":"SkipLayerNormalization","sinceVersion":1,"inputs":{"inputT":{"onnx":"input","dtype":"T"},"skipT":{"onnx":"skip","dtype":"T"},"gammaT":{"onnx":"gamma","dtype":"T","rank":1},"betaT":{"onnx":"beta","dtype":"T","rank":1,"optional":true},"biasT":{"onnx":"bias","dtype":"T","rank":1,"optional":true}},"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","rank":"ranks.inputT","optional":true,"shape":"shapes.inputT"}},"attributes":{"epsilon":{"default":9.999999960041972e-13}},"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)) 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))))","rowDispatchFits":"rowCount <= min(device.limits.maxComputeWorkgroupsPerDimension, 65535) * min(device.limits.maxComputeWorkgroupsPerDimension, 65535)","normResourcesFit":"skipWg * 8 <= device.limits.maxComputeWorkgroupStorageSize and skipWgVec4 * 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","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","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","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))","fusedContract":"coreContract and (f32MainDtypes or (hasF16 and f16MainDtypes)) and (not present.betaT or (ranks.betaT == 1 and dim(shapes.betaT, 0) == hiddenSize and tensorDtypes.betaT == tensorDtypes.inputT)) and (not present.biasT or (present.betaT and ranks.biasT == 1 and dim(shapes.biasT, 0) == hiddenSize and tensorDtypes.biasT == tensorDtypes.inputT)) and (outputOnlyContract or (present.betaT and residualOutputContract and (f32ResidualDtypes or f16ResidualDtypes)))","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","elementType":"$vectorScalar"},"skip":{"arg":"skipT","elementType":"$vectorScalar"},"gamma":{"arg":"gammaT","elementType":"$vectorScalar","length":"$HIDDEN_LEN"},"beta":{"arg":"betaT","elementType":"$vectorScalar","length":"$HIDDEN_LEN","when":"present.betaT"},"output":{"arg":"outputT","elementType":"$vectorScalar"},"bias_before_gamma":{"arg":"biasT","name":"bias","elementType":"$vectorScalar","length":"$HIDDEN_LEN","when":"present.biasT and present.residualT"},"bias_after_beta":{"arg":"biasT","name":"bias","elementType":"$vectorScalar","length":"$HIDDEN_LEN","when":"present.biasT and not present.residualT"},"input_skip_bias_sum":{"arg":"residualT","elementType":"$vectorScalar","when":"present.residualT"},"params_main":{"name":"params","struct":[{"name":"rows","type":"u32","value":"rowCount"},{"name":"rowStride","type":"u32","value":"max(1, min(rowCount, min(device.limits.maxComputeWorkgroupsPerDimension, 65535)))"},{"name":"epsilon","type":"f32","value":"attrs.epsilon"}]},"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","when":"present.biasT"},"gamma_main":{"arg":"gammaT","name":"gamma","elementType":"$scalar","length":"$HIDDEN_LEN"},"beta_main":{"arg":"betaT","name":"beta","elementType":"$scalar","length":"$HIDDEN_LEN","when":"present.betaT"},"output_main":{"arg":"outputT","name":"output","elementType":"$scalar"},"input_skip_bias_sum_main":{"arg":"residualT","name":"input_skip_bias_sum","elementType":"$scalar","when":"present.residualT"},"params__uniform":{"name":"params","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"},"mean_main":{"arg":"meanT","name":"mean","elementType":"f32","when":"present.meanT and not present.invStdT"},"inv_std_var_main":{"arg":"invStdT","name":"inv_std_var","elementType":"f32","when":"present.invStdT and not present.meanT"},"row_stats":{"scratch":"rowStats","elementType":"vec2<f32>","when":"present.meanT and present.invStdT"},"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":"row","priority":10,"when":["fusedContract","f32MainDtypes or not present.residualT","normResourcesFit","rowDispatchFits","not statsRequested"],"derive":{"simplified":false,"useSubgroups":"hasSubgroups","hasBeta":"present.betaT","hasBias":"present.biasT","writeResidualSum":"present.residualT","scalar":"dtypes.T","workgroupSize":"skipWg","HIDDEN_LEN":"hiddenSize"},"passes":[{"id":"main","name":"SkipLayerNormalization.Row","shader":"norm-skip-row.wgsl.jinja","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_output_only_vec4_broadcast","priority":19,"when":["broadcastOutputOnlyContract","broadcastResourcesFit","broadcastDispatchFits","not present.meanT and not present.invStdT"],"derive":{"vectorScalar":"\"vec4<f32>\"","HIDDEN_LEN":"broadcastHiddenSize / 4"},"passes":[{"id":"main","name":"SkipLayerNormalization.BroadcastSkip","shader":"norm-skip-row-vec4.wgsl.jinja","derive":{"simplified":false,"hasBias":false,"hasBeta":true,"writeResidualSum":false,"broadcastSkip":true,"hidden":"broadcastHiddenSize","hiddenVec":"broadcastHiddenSize / 4","wg":"broadcastSkipWgVec4","vecType":"\"vec4<f32>\"","useSubgroups":"hasSubgroups"},"bindings":["input","skip","gamma","beta","output",{"name":"params","struct":[{"name":"rows","type":"u32","value":"dim(shapes.inputT, 0) * dim(shapes.inputT, 1)"},{"name":"rowStride","type":"u32","value":"max(1, min(broadcastRows, min(device.limits.maxComputeWorkgroupsPerDimension, 65535)))"},{"name":"epsilon","type":"f32","value":"attrs.epsilon"},{"name":"skipRows","type":"u32","value":"numel(shapes.skipT) / broadcastHiddenSize"}]}],"dispatch":{"x":"min(broadcastRows, 65535)","y":"ceilDiv(broadcastRows, 65535)","z":1}}]},{"id":"vec4","priority":20,"when":["fusedContract","vec4Aligned","f32MainDtypes or present.biasT or not present.residualT","present.biasT or not present.betaT or hasSubgroups or portableWideExecution","normResourcesFit","rowDispatchFits","not statsRequested"],"derive":{"vectorScalar":"\"vec4<f16>\" if dtypes.T == \"f16\" else \"vec4<f32>\"","HIDDEN_LEN":"hiddenSize / 4"},"passes":[{"id":"main","name":"SkipLayerNormalization.Vec4","shader":"norm-skip-row-vec4.wgsl.jinja","derive":{"simplified":false,"hasBias":"present.biasT","hasBeta":"present.betaT","writeResidualSum":"present.residualT","hidden":"hiddenSize","hiddenVec":"hiddenSize / 4","wg":"skipWgVec4","vecType":"vectorScalar","useSubgroups":"hasSubgroups"},"bindings":["input","skip","bias_before_gamma","gamma","beta","bias_after_beta","output","input_skip_bias_sum","params_main"],"dispatch":{"x":"min(rowCount, 65535)","y":"ceilDiv(rowCount, 65535)","z":1}}]},{"id":"stats","when":["statsContract","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":"present.meanT and present.invStdT"},"intermediates":[{"id":"rowStats","dtype":"float32","shape":"[rowCount, 2]"}],"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_main","inv_std_var_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}},{"repeat":{"index":"statsCopy","count":"1 if present.meanT and present.invStdT else 0"},"passes":[{"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}}]}]}]}
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970{"name": "com.microsoft.SkipLayerNormalization","id": "_com_microsoft_skiplayernormalization_webgpu_a30f1f2","version": 1,"license": "Apache-2.0","backend": { "type": "webgpu" },"digest": {"algorithm": "sha256","files": {"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": "6fdf6301e2bbcc2f03bf1eaf493b7ad55ef33afc", "dirty": false } },"webgpu": {"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_output_only_vec4": ["norm-skip-row-vec4.wgsl.jinja"],"beta_no_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"],"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"]}}}1{"name":"com.microsoft.SkipLayerNormalization","id":"_com_microsoft_skiplayernormalization_webgpu_4e77e0d","version":1,"license":"Apache-2.0","backend":{"type":"webgpu"},"digest":{"algorithm":"sha256","files":{"bench.json":"SWSQFoxcME16BoI46yhBO4WH7c+z3Sgw6IifTc/vS4Y=","manifest.json":"2HMasjYK8IQoX3ktVwQyyUHTGfHyx0IkbhI0iw7P7/Q=","norm-skip-row-vec4.wgsl.jinja":"x2hFBTHo8BUEpvPp24SDSWk2vmM2vKBtPCNDwwPoPJI=","norm-skip-row.wgsl.jinja":"7nDNFUalZu/QwY/29E0y9NlKZnYCJEkI+BAtm/HTzVc=","norm-stats-copy.wgsl.jinja":"Dss4qJTpAPjQtVp3OvI/LEbiAW/QNXb6aUPDp/7s9v8=","test.json":"qlIirchgkSYwzWTqjp2eXOvTyJgnYtMptlBuTkFVePM="}},"provenance":{"kernel":{"sha":"4385228f788ddaa1bd7aec6a80a20f3ddffd8011","dirty":false}},"webgpu":{"manifestSpec":"2.2"}}
1 unmodified line23456789101114 unmodified lines262728293031323334353637383940414243444546474849505113 unmodified lines65666768697071727319 unmodified lines939495969798991 unmodified line{% 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 ({{ svar }} == 0u) { break; }if ({{ idx }} < {{ svar }}) {{% for a in arrays %}{{ wgsl_tree_fold_stmt(a, op, idx, svar) }}14 unmodified linesvar<workgroup> sg_partials: array<vec2<f32>, WG>;fn reduce_pair(value: vec2<f32>{% if useSubgroups %}, sg_lane: u32, sg_id: u32, num_sg: u32{% else %}, tid: u32{% endif %}) -> vec2<f32> {{% if useSubgroups %}let s = vec2<f32>(subgroupAdd(value.x), subgroupAdd(value.y));if (num_sg == 1u) {return s;}if (sg_lane == 0u) {sg_partials[sg_id] = s;}workgroupBarrier();var total = vec2<f32>(0.0, 0.0);for (var i = 0u; i < num_sg; i = i + 1u) {total = total + sg_partials[i];}return total;{% else %}// No-subgroup tier: workgroup barrier tree-reduction (WG is a power of two).sg_partials[tid] = value;workgroupBarrier();{{ wgsl_tree_fold(["sg_partials"], idx="tid", wg="WG", form="head", breakInline=true) }}return sg_partials[0];{% endif %}}13 unmodified linesfn main(@builtin(workgroup_id) wg_id: vec3<u32>,@builtin(local_invocation_id) lid: vec3<u32>{% if useSubgroups %},@builtin(subgroup_invocation_id) sg_lane: u32,@builtin(subgroup_id) sg_id: u32,@builtin(num_subgroups) num_sg: u32{% endif %}) {let row = wg_id.x + wg_id.y * params.rowStride;if (row >= params.rows) {19 unmodified linesacc.y = acc.y + dot(d, d);}let totals = reduce_pair(acc{% if useSubgroups %}, sg_lane, sg_id, num_sg{% else %}, tid{% endif %});let mean_d = totals.x / f32(HIDDEN);let variance = max(totals.y / f32(HIDDEN) - mean_d * mean_d, 0.0);let row_inv = inverseSqrt(variance + params.epsilon);1 unmodified line234567891011121314 unmodified lines2829303132333435363738394041424344454647484950515253545556575813 unmodified lines72737475767778798019 unmodified lines1001011021031041051061 unmodified line{% 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", barrierFirst=false, reuse=false) %}var {{ svar }}{{ ": u32 " if typed else " " }}= {{ wg }} / 2u;loop {if ({{ svar }} == 0u) {break;}if ({{ idx }} < {{ svar }}) {{% for a in arrays %}{{ wgsl_tree_fold_stmt(a, op, idx, svar) }}14 unmodified linesvar<workgroup> sg_partials: array<vec2<f32>, WG>;fn reduce_pair(value: vec2<f32>{% if useSubgroups %}, sg_id: u32, num_sg: u32, sg_size: u32{% else %}, tid: u32{% endif %}) -> vec2<f32> {{% if useSubgroups %}let s = vec2<f32>(subgroupAdd(value.x), subgroupAdd(value.y));// Chrome on Qualcomm Adreno reports num_subgroups = 1 for a workgroup that spans several subgroups.// The reported subgroup count can be too low. Raise it to the fewest subgroups the workgroup can occupy, so an// under-reported count can neither take the one-subgroup return nor cut the fold short; a conformant count// always wins.let fold_count = max(num_sg, (WG + sg_size - 1u) >> firstTrailingBit(sg_size));if (fold_count == 1u) {return s;}if (subgroupElect()) {sg_partials[sg_id] = s;}workgroupBarrier();var total = vec2<f32>(0.0, 0.0);for (var i = 0u; i < fold_count; i = i + 1u) {total = total + sg_partials[i];}return total;{% else %}// Without subgroups: workgroup barrier tree-reduction (WG is a power of two).sg_partials[tid] = value;workgroupBarrier();{{ wgsl_tree_fold(["sg_partials"], idx="tid", wg="WG", form="head") }}return sg_partials[0];{% endif %}}13 unmodified linesfn main(@builtin(workgroup_id) wg_id: vec3<u32>,@builtin(local_invocation_id) lid: vec3<u32>{% if useSubgroups %},@builtin(subgroup_id) sg_id: u32,@builtin(num_subgroups) num_sg: u32,@builtin(subgroup_size) sg_size: u32{% endif %}) {let row = wg_id.x + wg_id.y * params.rowStride;if (row >= params.rows) {19 unmodified linesacc.y = acc.y + dot(d, d);}let totals = reduce_pair(acc{% if useSubgroups %}, sg_id, num_sg, sg_size{% else %}, tid{% endif %});let mean_d = totals.x / f32(HIDDEN);let variance = max(totals.y / f32(HIDDEN) - mean_d * mean_d, 0.0);let row_inv = inverseSqrt(variance + params.epsilon);
1 unmodified line234567815 unmodified lines24252627282930313233343536373839404142434445464748497 unmodified lines575859606162633 unmodified lines67686970717273747576777879808110 unmodified lines92939495969798991001011021031041051061071081091101111121131141158 unmodified lines1241251261271281291301 unmodified line{% 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 ({{ svar }} == 0u) {15 unmodified lines{% endif %}{{ env.wgsl.resourceDeclarations }}{% if not degenerateRow or writeResidualSum or (writeMean is defined and writeMean) %}const HIDDEN: u32 = {{ hiddenSize }}u;{% endif %}const WG: u32 = {{ workgroupSize }}u;{% if not degenerateRow %}var<workgroup> pair_partial: array<vec2<f32>, WG>;{% if useSubgroups %}fn reduce_pair(value: vec2<f32>, sg_lane: u32, sg_id: u32, num_sg: u32) -> vec2<f32> {let s = vec2<f32>(subgroupAdd(value.x), subgroupAdd(value.y));if (num_sg == 1u) {return s;}if (sg_lane == 0u) {pair_partial[sg_id] = s;}workgroupBarrier();var total = vec2<f32>(0.0, 0.0);for (var i = 0u; i < num_sg; i = i + 1u) {total = total + pair_partial[i];}return total;7 unmodified lines}{% endif %}{% endif %}{% if not degenerateRow or writeResidualSum or (writeMean is defined and writeMean) %}fn residual_value(row: u32, d: u32) -> f32 {let index = row * HIDDEN + d;3 unmodified lines{% endif %}return value;}{% endif %}@compute @workgroup_size(WG, 1, 1)fn main(@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 %}) {// Fold the row grid across workgroups; independent rows also include the// invocation offset. The bounds guard drops the final dispatch tail.10 unmodified lines{% endif %}{% if degenerateRow %}// HIDDEN == 1: the row's mean is its only element, so the centered value and// 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);{% endif %}// 0.0 * row_inv keeps the IEEE result when epsilon == 0 makes row_inv +Inf.output[row] = {{ scalar }}(0.0 * row_inv * f32(gamma[0]){% if hasBeta %} + f32(beta[0]){% endif %});{% else %}// Shifted moments: accumulating (x - x[0], (x - x[0])^2) keeps the sums8 unmodified lines}{% if useSubgroups %}let totals = reduce_pair(acc, sg_lane, sg_id, num_sg);{% else %}let totals = reduce_pair(acc, tid);{% endif %}1 unmodified line234567815 unmodified lines24252627282930313233343536373839404142434445464748495051527 unmodified lines6061626364653 unmodified lines697071727374757677787980818210 unmodified lines939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391408 unmodified lines1491501511521531541551 unmodified line{% 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", barrierFirst=false, reuse=false) %}var {{ svar }}{{ ": u32 " if typed else " " }}= {{ wg }} / 2u;loop {if ({{ svar }} == 0u) {15 unmodified lines{% endif %}{{ env.wgsl.resourceDeclarations }}const HIDDEN: u32 = {{ hiddenSize }}u;const WG: u32 = {{ workgroupSize }}u;{% if not degenerateRow %}var<workgroup> pair_partial: array<vec2<f32>, WG>;{% if useSubgroups %}fn reduce_pair(value: vec2<f32>, sg_id: u32, num_sg: u32, sg_size: u32) -> vec2<f32> {let s = vec2<f32>(subgroupAdd(value.x), subgroupAdd(value.y));// Chrome on Qualcomm Adreno reports num_subgroups = 1 for a workgroup that spans several subgroups.// The reported subgroup count can be too low. Raise it to the fewest subgroups the workgroup can occupy, so an// under-reported count can neither take the one-subgroup return nor cut the fold short; a conformant count// always wins.let fold_count = max(num_sg, (WG + sg_size - 1u) >> firstTrailingBit(sg_size));if (fold_count == 1u) {return s;}if (subgroupElect()) {pair_partial[sg_id] = s;}workgroupBarrier();var total = vec2<f32>(0.0, 0.0);for (var i = 0u; i < fold_count; i = i + 1u) {total = total + pair_partial[i];}return total;7 unmodified lines}{% endif %}{% endif %}fn residual_value(row: u32, d: u32) -> f32 {let index = row * HIDDEN + d;3 unmodified lines{% endif %}return value;}@compute @workgroup_size(WG, 1, 1)fn main(@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_id) sg_id: u32,@builtin(num_subgroups) num_sg: u32,@builtin(subgroup_size) sg_size: u32{% endif %}) {// Fold the row grid across workgroups; independent rows also include the// invocation offset. The bounds guard drops the final dispatch tail.10 unmodified lines{% endif %}{% if degenerateRow %}// A one-element row has zero variance only when its rounded residual is// finite. Classify before using the closed form; invalid rows retain NaN.let residual = residual_value(row, 0u);let residual_bits = bitcast<u32>(residual);let residual_nonfinite = (residual_bits & 0x7f800000u) == 0x7f800000u;let epsilon_bits = bitcast<u32>(params.epsilon);let epsilon_zero = (epsilon_bits & 0x7fffffffu) == 0u;var row_inv = 0.0;if (residual_nonfinite) {row_inv = bitcast<f32>(residual_bits | 0x7fc00000u);} else if (epsilon_zero) {row_inv = bitcast<f32>((epsilon_bits & 0x7fffffffu) | 0x7f800000u);} else if (epsilon_bits == 0x7f800000u) {row_inv = 0.0;} else {row_inv = inverseSqrt(params.epsilon);}{% if packedStatistics is defined and packedStatistics %}row_stats[row] = vec2<f32>(residual, row_inv);{% elif writeMean is defined and writeMean %}mean[row] = residual;{% endif %}{% if writeInvStd is defined and writeInvStd and not (packedStatistics is defined and packedStatistics) %}inv_std_var[row] = row_inv;{% endif %}{% if writeResidualSum %}input_skip_bias_sum[row] = {{ scalar }}(residual);{% endif %}let gamma_value = f32(gamma[0]);let gamma_nonfinite = (bitcast<u32>(gamma_value) & 0x7f800000u) == 0x7f800000u;{% if hasBeta %}let beta_value = f32(beta[0]);let beta_nan = (bitcast<u32>(beta_value) & 0x7fffffffu) > 0x7f800000u;{% endif %}if (residual_nonfinite || epsilon_zero || gamma_nonfinite{% if hasBeta %} || beta_nan{% endif %}) {output[row] = {{ scalar }}(bitcast<f32>(epsilon_bits | 0x7fc00000u));return;}// Finite residual and scale: the output is 0 * inv * gamma, plus beta when// present, which keeps an infinite beta and the sign of a zero result.output[row] = {{ scalar }}(0.0 * row_inv * gamma_value{% if hasBeta %} + beta_value{% endif %});{% else %}// Shifted moments: accumulating (x - x[0], (x - x[0])^2) keeps the sums8 unmodified lines}{% if useSubgroups %}let totals = reduce_pair(acc, sg_id, num_sg, sg_size);{% else %}let totals = reduce_pair(acc, tid);{% endif %}
1234567891011121314{% 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;1234567891011121314151617{% macro flat_index_2d(workgroupSize, name="i", bound="params.count") %}{% 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") }}let stats = row_stats[row];mean[row] = stats.x;inv_std_var[row] = stats.y;
12345678137 unmodified lines146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189100 unmodified lines29029129229329429529629729829924 unmodified lines32432532632732832933087 unmodified lines41841942042142242342420 unmodified lines445446447448449450451143 unmodified lines59559659759859960060160260335 unmodified lines63964064164264364464553 unmodified lines69970070170270370470570670760 unmodified lines768769770771772773774159 unmodified lines93493593693793893994094194225 unmodified lines96896997097197297397458 unmodified lines1033103410351036103710381039109 unmodified lines11491150115111521153115411551156115718 unmodified lines11761177117811791180118111826 unmodified lines11891190119111921193119411957 unmodified lines12031204120512061207120812098 unmodified lines12181219122012211222122312249 unmodified lines12341235123612371238123912409 unmodified lines12501251125212531254125512569 unmodified lines12661267126812691270127112729 unmodified lines128212831284128512861287128812 unmodified lines13011302130313041305130613078 unmodified lines13161317131813191320132113226 unmodified lines13291330133113321333133413357 unmodified lines13431344134513461347134813498 unmodified lines13581359136013611362136313649 unmodified lines13741375137613771378137913809 unmodified lines13901391139213931394139513969 unmodified lines14061407140814091410141114129 unmodified lines14221423142414251426142714289 unmodified lines14381439144014411442144314448 unmodified lines1453145414551456145714581459{"fixtureArrays": {"ort_batch2_bias_flattened_tokens_input_skipT": [0.1, -0.2, 0.3, 1, 0.5, 0.1, 0.4, 1.6, 1.8, -0.3, 0, 1, -0.5, 0.4, 0.8, -0.6],"ort_batch2_flattened_tokens_input_inputT": [0.8, -0.5, 0, 1, 0.5, 0.2, 0.3, -0.6, 0.8, -0.5, 0, 1, 0.5, 0.2, 0.3, -0.6],"ort_batch2_skip_broadcast_no_batch_size_output_outputT": [0.2843385934829712, -0.17090578377246857, -0.9289716482162476, 4.692415237426758, 0.4611165225505829, -0.21333980560302734, -0.29631003737449646, 3.5148544311523438, 0.2843385934829712, -0.17090578377246857, -0.9289716482162476, 4.692415237426758, 0.4611165225505829, -0.21333980560302734, -0.29631003737449646, 3.5148544311523438]},"cases": [{137 unmodified lines"name": "hidden_size_one_bias_path","attrs": { "epsilon": 0.00001 },"inputs": {"inputT": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [2.0, -4.0, 0.5] } },"skipT": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [3.0, 1.0, -0.5] } },"gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [7.0] } },"betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-2.0] } },"biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.25] } }},"outputs": {"outputT": { "dtype": "float32", "shape": [3, 1], "tolerance": 0.000001 },"residualT": { "dtype": "float32", "shape": [3, 1], "tolerance": 0.000001 }}},{"name": "hidden_size_one_bias_output_only","provenance": {"notes": "Pins the scalar hidden-size-one closed form when the optional residual sum is not requested."},"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": { "dtype": "float32", "shape": [1, 1], "data": { "kind": "values", "values": [2.0] } },"skipT": { "dtype": "float32", "shape": [1, 1], "data": { "kind": "values", "values": [3.0] } },"gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [7.0] } },"betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-2.0] } },"biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.25] } }},"outputs": { "outputT": { "dtype": "float32", "shape": [1, 1], "tolerance": 0.000001 } }},{"name": "hidden_size_one_no_beta_output_only","provenance": {"notes": "Pins the supported no-beta hidden-size-one closed form: every centered value is zero, so the output is zero."},"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": { "dtype": "float32", "shape": [1, 1], "data": { "kind": "values", "values": [2.0] } },"skipT": { "dtype": "float32", "shape": [1, 1], "data": { "kind": "values", "values": [3.0] } },"gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [7.0] } }},"outputs": { "outputT": { "dtype": "float32", "shape": [1, 1], "tolerance": 0.000001 } }},{"name": "hidden_size_one_bias_rows65535_dispatch_edge",100 unmodified lines"inputT": {"dtype": "float32","shape": [4, 4],"data": {"kind": "values","values": [0.7, -0.4, -0.2, 1.2, 0.4, 0.3, 0.1, -0.4, 0.7, -0.4, -0.2, 1.2, 0.4, 0.3, 0.1, -0.4]}},"skipT": {"dtype": "float32",24 unmodified lines"inputT": {"dtype": "float32","shape": [4, 4],"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_batch2_flattened_tokens_input_inputT" } }},"skipT": {"dtype": "float32",87 unmodified lines"inputT": {"dtype": "float32","shape": [2, 2, 4],"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_batch2_flattened_tokens_input_inputT" } }},"skipT": {"dtype": "float32",20 unmodified lines"provenance": {"source": "onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc","test": "SkipLayerNormTest.SkipLayerNormBatch1_NoBeta","notes": "ORT shape [1, 2, 4] is represented as [2, 4] tokens by this lowered fixture, with beta omitted."},"attrs": { "epsilon": 1e-12 },"inputs": {143 unmodified lines},{"name": "beta_bias_output_only_hidden6_unaligned_row","provenance": {"notes": "Row-kernel arm of beta_bias_output_only: hidden=6 fails vec4Aligned. 6 storage buffers."},"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": {35 unmodified lines"inputT": {"dtype": "float32","shape": [2, 2, 4],"data": { "kind": "values", "values": { "$ref": "#/fixtureArrays/ort_batch2_flattened_tokens_input_inputT" } }},"skipT": {"dtype": "float32",53 unmodified lines},{"name": "f32_hidden768_no_bias_residual","provenance": {"notes": "A compact hidden-size-768 residual normalization exercises the subgroup route and its reduced-tier fallback without bias."},"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": {60 unmodified lines{"name": "f32_hidden1025_bias_residual","provenance": {"notes": "A compact hidden-size-1025 normalization exercises the unaligned two-pass path with bias and residual output."},"attrs": { "epsilon": 0.00001 },"inputs": {159 unmodified lines},{"name": "rank3_no_bias_residual","provenance": {"notes": "Rank-3 activation shape carrying the residual output, the form ONNX Runtime's transformer fusion emits when the pre-normalization sum feeds the next block."},"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": {25 unmodified lines{"name": "rank3_beta_no_bias_output_only_hidden6_unaligned_row","provenance": {"notes": "Rank-3 at a hidden size that is not a multiple of four, so the scalar row route serves it."},"attrs": { "epsilon": 0.00001 },"inputs": {58 unmodified lines},{"name": "f16_beta_bias_output_only_hidden6_unaligned_row","provenance": { "notes": "Half precision at an unaligned hidden size, which the scalar row route serves." },"requires": { "features": ["shader-f16"] },"attrs": { "epsilon": 0.00001 },"inputs": {109 unmodified lines},{"name": "f16_no_beta_output_only","provenance": {"notes": "Half precision with neither beta nor bias at an aligned hidden size, which is the vec4 arm of that pair."},"requires": { "features": ["shader-f16"] },"attrs": { "epsilon": 0.00001 },"inputs": {18 unmodified lines{"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": {6 unmodified lines{"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": {7 unmodified lines{"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": {8 unmodified lines{"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 },9 unmodified lines{"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 },9 unmodified lines{"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 },9 unmodified lines{"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 },9 unmodified lines{"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 },12 unmodified lines{"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": {8 unmodified lines{"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": {6 unmodified lines{"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": {7 unmodified lines{"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": {8 unmodified lines{"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 },9 unmodified lines{"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 },9 unmodified lines{"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 },9 unmodified lines{"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 },9 unmodified lines{"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 },9 unmodified lines{"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": {8 unmodified lines{"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": {123456789137 unmodified lines147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272100 unmodified lines37337437537637737837924 unmodified lines40440540640740840941087 unmodified lines49849950050150250350420 unmodified lines525526527528529530531143 unmodified lines67567667767867968068135 unmodified lines71771871972072172272353 unmodified lines77777877978078178278360 unmodified lines844845846847848849850159 unmodified lines101010111012101310141015101625 unmodified lines104210431044104510461047104858 unmodified lines1107110811091110111111121113109 unmodified lines122312241225122612271228122918 unmodified lines12481249125012511252125312546 unmodified lines12611262126312641265126612677 unmodified lines12751276127712781279128012818 unmodified lines12901291129212931294129512969 unmodified lines13061307130813091310131113129 unmodified lines13221323132413251326132713289 unmodified lines13381339134013411342134313449 unmodified lines135413551356135713581359136012 unmodified lines13731374137513761377137813798 unmodified lines13881389139013911392139313946 unmodified lines14011402140314041405140614077 unmodified lines14151416141714181419142014218 unmodified lines14301431143214331434143514369 unmodified lines14461447144814491450145114529 unmodified lines14621463146414651466146714689 unmodified lines14781479148014811482148314849 unmodified lines14941495149614971498149915009 unmodified lines15101511151215131514151515168 unmodified lines1525152615271528152915301531{"fixtureArrays": {"ort_batch2_bias_flattened_tokens_input_skipT": [0.1, -0.2, 0.3, 1, 0.5, 0.1, 0.4, 1.6, 1.8, -0.3, 0, 1, -0.5, 0.4, 0.8, -0.6],"ort_batch2_skip_broadcast_no_batch_size_output_outputT": [0.2843385934829712, -0.17090578377246857, -0.9289716482162476, 4.692415237426758, 0.4611165225505829, -0.21333980560302734, -0.29631003737449646, 3.5148544311523438, 0.2843385934829712, -0.17090578377246857, -0.9289716482162476, 4.692415237426758, 0.4611165225505829, -0.21333980560302734, -0.29631003737449646, 3.5148544311523438],"hidden_size_one_bias_output_only_input_inputT": [2, "Infinity", "-Infinity", "NaN", 1, 1, 1, 3.4028234663852886e+38, 2, -4, 0.5, 1.25, -2, 4, -0.5, 0, 3],"hidden_size_one_bias_output_only_input_skipT": [3, 0, 0, 0, "Infinity", "-Infinity", "NaN", 3.4028234663852886e+38, 3, 1, -0.5, 0.5, 1, -2, 2, 0, -1]},"cases": [{137 unmodified lines"name": "hidden_size_one_bias_path","attrs": { "epsilon": 0.00001 },"inputs": {"inputT": {"dtype": "float32","shape": [10, 1],"data": {"kind": "values","values": [2.0, -4.0, 0.5, "Infinity", "-Infinity", "NaN", 1.0, 1.0, 1.0, 3.4028234663852886e+38]}},"skipT": {"dtype": "float32","shape": [10, 1],"data": {"kind": "values","values": [3.0, 1.0, -0.5, 0.0, 0.0, 0.0, "Infinity", "-Infinity", "NaN", 3.4028234663852886e+38]}},"gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [7.0] } },"betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-2.0] } },"biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.25] } }},"outputs": {"outputT": {"dtype": "float32","shape": [10, 1],"tolerance": 0.000001,"data": { "kind": "values", "values": [-2.0, -2.0, -2.0, "NaN", "NaN", "NaN", "NaN", "NaN", "NaN", "NaN"] },"allowNaN": true},"residualT": {"dtype": "float32","shape": [10, 1],"tolerance": 0.000001,"data": {"kind": "values","values": [5.25, -2.75, 0.25, "Infinity", "-Infinity", "NaN", "Infinity", "-Infinity", "NaN", "Infinity"]},"allowNaN": true}},"provenance": {"notes": "Hidden size one with bias 0.25, gamma 7 and beta -2 over ten rows: three finite rows, rows with +-Infinity or NaN in the input or skip, and finite inputs whose sum overflows to +Infinity. The residual output holds each sum; the normalized output is beta (-2) for a finite residual and NaN otherwise."}},{"name": "hidden_size_one_bias_output_only","provenance": {"notes": "Hidden size one over 4,097 rows with bias 0.25, gamma 7 and beta -2: a 17-row cycle mixes finite rows with rows whose input or skip is +-Infinity or NaN and a row of finite inputs whose sum overflows. Each finite residual normalizes to zero, giving beta (-2), and each non-finite residual gives NaN."},"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": {"dtype": "float32","shape": [4097, 1],"data": {"kind": "cycle","values": { "$ref": "#/fixtureArrays/hidden_size_one_bias_output_only_input_inputT" }}},"skipT": {"dtype": "float32","shape": [4097, 1],"data": {"kind": "cycle","values": { "$ref": "#/fixtureArrays/hidden_size_one_bias_output_only_input_skipT" }}},"gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [7.0] } },"betaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [-2.0] } },"biasT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.25] } }},"outputs": {"outputT": {"dtype": "float32","shape": [4097, 1],"tolerance": 0.000001,"data": {"kind": "cycle","values": [-2.0, "NaN", "NaN", "NaN", "NaN", "NaN", "NaN", "NaN", -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0, -2.0]},"allowNaN": true}}},{"name": "hidden_size_one_no_beta_output_only","provenance": {"notes": "Hidden size one over 4,097 rows with gamma 7 and no bias or beta: a 17-row cycle mixes finite rows with rows whose input or skip is +-Infinity or NaN and a row of finite inputs whose sum overflows. Each finite residual normalizes to zero, giving 0, and each non-finite residual gives NaN."},"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": {"dtype": "float32","shape": [4097, 1],"data": {"kind": "cycle","values": { "$ref": "#/fixtureArrays/hidden_size_one_bias_output_only_input_inputT" }}},"skipT": {"dtype": "float32","shape": [4097, 1],"data": {"kind": "cycle","values": { "$ref": "#/fixtureArrays/hidden_size_one_bias_output_only_input_skipT" }}},"gammaT": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [7.0] } }},"outputs": {"outputT": {"dtype": "float32","shape": [4097, 1],"tolerance": 0.000001,"data": {"kind": "cycle","values": [0.0, "NaN", "NaN", "NaN", "NaN", "NaN", "NaN", "NaN", 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]},"allowNaN": true}}},{"name": "hidden_size_one_bias_rows65535_dispatch_edge",100 unmodified lines"inputT": {"dtype": "float32","shape": [4, 4],"data": { "kind": "cycle", "values": [0.7, -0.4, -0.2, 1.2, 0.4, 0.3, 0.1, -0.4] }},"skipT": {"dtype": "float32",24 unmodified lines"inputT": {"dtype": "float32","shape": [4, 4],"data": { "kind": "cycle", "values": [0.8, -0.5, 0.0, 1.0, 0.5, 0.2, 0.3, -0.6] }},"skipT": {"dtype": "float32",87 unmodified lines"inputT": {"dtype": "float32","shape": [2, 2, 4],"data": { "kind": "cycle", "values": [0.8, -0.5, 0.0, 1.0, 0.5, 0.2, 0.3, -0.6] }},"skipT": {"dtype": "float32",20 unmodified lines"provenance": {"source": "onnxruntime/test/contrib_ops/skiplayernorm_op_test.cc","test": "SkipLayerNormTest.SkipLayerNormBatch1_NoBeta","notes": "Two tokens of width 4, with a scale and a skip input but no beta."},"attrs": { "epsilon": 1e-12 },"inputs": {143 unmodified lines},{"name": "beta_bias_output_only_hidden6_unaligned_row","provenance": { "notes": "Hidden size 6 is not a multiple of 4, with beta and bias present." },"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": {35 unmodified lines"inputT": {"dtype": "float32","shape": [2, 2, 4],"data": { "kind": "cycle", "values": [0.8, -0.5, 0.0, 1.0, 0.5, 0.2, 0.3, -0.6] }},"skipT": {"dtype": "float32",53 unmodified lines},{"name": "f32_hidden768_no_bias_residual","provenance": { "notes": "A hidden size of 768 (4 rows, float32) with beta, no bias and the residual output." },"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": {60 unmodified lines{"name": "f32_hidden1025_bias_residual","provenance": {"notes": "A hidden size of 1025 (3 rows, float32) with beta, bias and the residual output; 1025 leaves a remainder of 1 after multiples of 4."},"attrs": { "epsilon": 0.00001 },"inputs": {159 unmodified lines},{"name": "rank3_no_bias_residual","provenance": { "notes": "Rank-3 activation [1, 4, 768] with the residual (sum) output present and no bias." },"attrs": { "epsilon": 0.00001 },"inputs": {"inputT": {25 unmodified lines{"name": "rank3_beta_no_bias_output_only_hidden6_unaligned_row","provenance": {"notes": "Rank-3 activation [1, 2, 6] whose hidden size of 6 is not a multiple of 4, with beta and no bias."},"attrs": { "epsilon": 0.00001 },"inputs": {58 unmodified lines},{"name": "f16_beta_bias_output_only_hidden6_unaligned_row","provenance": { "notes": "Float16 with hidden size 6 (not a multiple of 4), beta and bias." },"requires": { "features": ["shader-f16"] },"attrs": { "epsilon": 0.00001 },"inputs": {109 unmodified lines},{"name": "f16_no_beta_output_only","provenance": { "notes": "Float16 with neither beta nor bias at a hidden size of 8 (a multiple of 4)." },"requires": { "features": ["shader-f16"] },"attrs": { "epsilon": 0.00001 },"inputs": {18 unmodified lines{"name": "independent_rows_float32_257x1_option0_wgdefault_epsilon0.00001","provenance": {"notes": "257 float32 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values."},"attrs": { "epsilon": 0.00001 },"inputs": {6 unmodified lines{"name": "independent_rows_float32_257x1_option1_wgdefault_epsilon0.00001","provenance": {"notes": "257 float32 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values."},"attrs": { "epsilon": 0.00001 },"inputs": {7 unmodified lines{"name": "independent_rows_float32_257x1_option2_wgdefault_epsilon0.00001","provenance": {"notes": "257 float32 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values."},"attrs": { "epsilon": 0.00001 },"inputs": {8 unmodified lines{"name": "independent_rows_float32_3x31x1_option2_wg1_epsilon0.00001","provenance": {"notes": "93 float32 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values. Its tunable sets a maximum workgroup size of 1."},"attrs": { "epsilon": 0.00001 },"tunables": { "MAX_WORKGROUP_SIZE": 1 },9 unmodified lines{"name": "independent_rows_float32_3x31x1_option2_wg8_epsilon0.00001","provenance": {"notes": "93 float32 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values. Its tunable sets a maximum workgroup size of 8."},"attrs": { "epsilon": 0.00001 },"tunables": { "MAX_WORKGROUP_SIZE": 8 },9 unmodified lines{"name": "independent_rows_float32_3x31x1_option2_wg64_epsilon0.00001","provenance": {"notes": "93 float32 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values. Its tunable sets a maximum workgroup size of 64."},"attrs": { "epsilon": 0.00001 },"tunables": { "MAX_WORKGROUP_SIZE": 64 },9 unmodified lines{"name": "independent_rows_float32_3x31x1_option2_wg128_epsilon0.00001","provenance": {"notes": "93 float32 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values. Its tunable sets a maximum workgroup size of 128."},"attrs": { "epsilon": 0.00001 },"tunables": { "MAX_WORKGROUP_SIZE": 128 },9 unmodified lines{"name": "independent_rows_float32_524289x1_option3_wg8_epsilon0.00001","provenance": {"notes": "524,289 float32 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values and a residual sum. Its tunable sets a maximum workgroup size of 8."},"attrs": { "epsilon": 0.00001 },"tunables": { "MAX_WORKGROUP_SIZE": 8 },12 unmodified lines{"name": "independent_rows_float32_257x1_option2_wgdefault_epsilon0","provenance": {"notes": "257 float32 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 0: with a single element the variance is zero, so the normalization divides zero by zero and NaN outputs are allowed."},"attrs": { "epsilon": 0 },"inputs": {8 unmodified lines{"name": "independent_rows_float16_257x1_option0_wgdefault_epsilon0.00001","provenance": {"notes": "257 float16 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values."},"attrs": { "epsilon": 0.00001 },"inputs": {6 unmodified lines{"name": "independent_rows_float16_257x1_option1_wgdefault_epsilon0.00001","provenance": {"notes": "257 float16 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values."},"attrs": { "epsilon": 0.00001 },"inputs": {7 unmodified lines{"name": "independent_rows_float16_257x1_option2_wgdefault_epsilon0.00001","provenance": {"notes": "257 float16 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values."},"attrs": { "epsilon": 0.00001 },"inputs": {8 unmodified lines{"name": "independent_rows_float16_3x31x1_option2_wg1_epsilon0.00001","provenance": {"notes": "93 float16 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values. Its tunable sets a maximum workgroup size of 1."},"attrs": { "epsilon": 0.00001 },"tunables": { "MAX_WORKGROUP_SIZE": 1 },9 unmodified lines{"name": "independent_rows_float16_3x31x1_option2_wg8_epsilon0.00001","provenance": {"notes": "93 float16 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values. Its tunable sets a maximum workgroup size of 8."},"attrs": { "epsilon": 0.00001 },"tunables": { "MAX_WORKGROUP_SIZE": 8 },9 unmodified lines{"name": "independent_rows_float16_3x31x1_option2_wg64_epsilon0.00001","provenance": {"notes": "93 float16 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values. Its tunable sets a maximum workgroup size of 64."},"attrs": { "epsilon": 0.00001 },"tunables": { "MAX_WORKGROUP_SIZE": 64 },9 unmodified lines{"name": "independent_rows_float16_3x31x1_option2_wg128_epsilon0.00001","provenance": {"notes": "93 float16 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values. Its tunable sets a maximum workgroup size of 128."},"attrs": { "epsilon": 0.00001 },"tunables": { "MAX_WORKGROUP_SIZE": 128 },9 unmodified lines{"name": "independent_rows_float16_524289x1_option2_wg8_epsilon0.00001","provenance": {"notes": "524,289 float16 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values. Its tunable sets a maximum workgroup size of 8."},"attrs": { "epsilon": 0.00001 },"tunables": { "MAX_WORKGROUP_SIZE": 8 },9 unmodified lines{"name": "independent_rows_float16_257x1_option2_wgdefault_epsilon0","provenance": {"notes": "257 float16 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 0: with a single element the variance is zero, so the normalization divides zero by zero and NaN outputs are allowed."},"attrs": { "epsilon": 0 },"inputs": {8 unmodified lines{"name": "independent_rows_float32_257x1_option3_wgdefault_epsilon0.00001","provenance": {"notes": "257 float32 rows of hidden size 1 (input 1.25, skip 0.5, constant) with gamma and beta and bias and epsilon 1e-05: each row normalizes a single element, so the result is uniform and has a closed form. The outputs are the normalized values and a residual sum."},"attrs": { "epsilon": 0.00001 },"inputs": {
README.md+18-42
build/webgpu/bench.json-17
build/webgpu/manifest.json+1-1553
build/webgpu/metadata.json+1-70
build/webgpu/norm-skip-row-vec4.wgsl.jinja+18-11
build/webgpu/norm-skip-row.wgsl.jinja+46-21
build/webgpu/norm-stats-copy.wgsl.jinja+6-3
build/webgpu/test.json+128-56