diff --git a/js/web/lib/wasm/jsep/webnn/webnn.d.ts b/js/web/lib/wasm/jsep/webnn/webnn.d.ts index 5cb0f4e74c3df..3505772cd2b73 100644 --- a/js/web/lib/wasm/jsep/webnn/webnn.d.ts +++ b/js/web/lib/wasm/jsep/webnn/webnn.d.ts @@ -13,7 +13,6 @@ type MLPowerPreference = 'default'|'high-performance'|'low-power'; interface MLContextOptions { deviceType?: MLDeviceType; powerPreference?: MLPowerPreference; - numThreads?: number; } interface ML { createContext(options?: MLContextOptions): Promise; diff --git a/js/web/lib/wasm/wasm-core-impl.ts b/js/web/lib/wasm/wasm-core-impl.ts index 0668ac1931988..5f219f63aaf61 100644 --- a/js/web/lib/wasm/wasm-core-impl.ts +++ b/js/web/lib/wasm/wasm-core-impl.ts @@ -297,14 +297,13 @@ export const createSession = async ( const context = (webnnOptions as InferenceSession.WebNNOptionsWithMLContext)?.context; const gpuDevice = (webnnOptions as InferenceSession.WebNNOptionsWebGpu)?.gpuDevice; const deviceType = (webnnOptions as InferenceSession.WebNNContextOptions)?.deviceType; - const numThreads = (webnnOptions as InferenceSession.WebNNContextOptions)?.numThreads; const powerPreference = (webnnOptions as InferenceSession.WebNNContextOptions)?.powerPreference; if (context) { wasm.currentContext = context as MLContext; } else if (gpuDevice) { wasm.currentContext = await navigator.ml.createContext(gpuDevice); } else { - wasm.currentContext = await navigator.ml.createContext({ deviceType, numThreads, powerPreference }); + wasm.currentContext = await navigator.ml.createContext({ deviceType, powerPreference }); } } else { wasm.currentContext = await navigator.ml.createContext(); diff --git a/js/web/test/test-runner.ts b/js/web/test/test-runner.ts index a8945222b485a..aa62c8dc22c40 100644 --- a/js/web/test/test-runner.ts +++ b/js/web/test/test-runner.ts @@ -291,14 +291,9 @@ export class ModelTestContext { if (['ml-tensor', 'ml-location'].includes(modelTest.ioBinding)) { const webnnOptions = executionProviderConfig as ort.InferenceSession.WebNNExecutionProviderOption; const deviceType = (webnnOptions as ort.InferenceSession.WebNNContextOptions)?.deviceType; - const numThreads = (webnnOptions as ort.InferenceSession.WebNNContextOptions)?.numThreads; const powerPreference = (webnnOptions as ort.InferenceSession.WebNNContextOptions)?.powerPreference; - mlContext = await navigator.ml.createContext({ - deviceType, - numThreads, - powerPreference, - }); + mlContext = await navigator.ml.createContext({ deviceType, powerPreference }); (executionProviderConfig as ort.InferenceSession.WebNNExecutionProviderOption).context = mlContext; if (!deviceType) { (executionProviderConfig as ort.InferenceSession.WebNNContextOptions).deviceType = deviceType;