[js/webgpu] fix 2 build breaks introduced in merge (#17273)

### Description
fix 2 build breaks introduced in merge. Fixes web build
This commit is contained in:
Yulong Wang 2023-08-23 18:09:50 -07:00 committed by GitHub
parent 87bef1f3f2
commit fb51faea64
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -1,13 +1,13 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import {DataType, tensorTypeToWsglType} from '../../../wasm-common';
import {DataType} from '../../../wasm-common';
import {TensorView} from '../../tensor';
import {ShapeUtil} from '../../util';
import {AttributeWithCacheKey, createAttributeWithCacheKey} from '../attribute-with-cache-key';
import {ComputeContext, GpuDataType, ProgramInfo, ProgramInfoLoader, ProgramMetadata} from '../types';
import {ShaderHelper} from './common';
import {ShaderHelper, tensorTypeToWsglStorageType} from './common';
export interface SkipLayerNormAttributes extends AttributeWithCacheKey {
epsilon: number;
@ -84,7 +84,7 @@ const createSkipLayerNormProgramInfo =
const meanInvStdDevDim = isTraining ? inputShape.slice(0, -1).concat(1) : [];
const hasBetaInput = inputs.length > 3;
const hasBiasInput = inputs.length > 4;
const dataType = tensorTypeToWsglType(inputs[0].dataType);
const dataType = tensorTypeToWsglStorageType(inputs[0].dataType);
const hasMeanOutput = isTraining && outputCount > 1;
const hasInvStdDevOutput = isTraining && outputCount > 2;
const hasInputSkipBiasSumOutput = outputCount > 3;

View file

@ -66,8 +66,6 @@ export const createTileProgramInfo =
const getShaderSource = (shaderHelper: ShaderHelper) => `
const inputShape = ${input.indices(...inputShape)};
${shaderHelper.declareVariables(input, output)}
${output.impl('offsetToIndices')}
${input.impl('indicesToOffset', 'get')}
${shaderHelper.mainStart()}
${shaderHelper.guardAgainstOutOfBoundsWorkgroupSizes(outputSize)}
let outputIndices = ${output.offsetToIndices('global_idx')};