You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support device-level configuration across all devices (#1276)
* [WebNN] Only allow free_dimension_override on a device level
* add device_config
* Use Omit to define device config to prevent duplication
* Update custom config instead of checking each property
* Cleanup
* Add back comment
---------
Co-authored-by: Joshua Lochner <[email protected]>
* @property {import('./utils/tensor.js').DataType|Record<import('./utils/dtypes.js').DataType, import('./utils/tensor.js').DataType>} [kv_cache_dtype] The data type of the key-value cache.
408
409
* @property {Record<string, number>} [free_dimension_overrides] Override the free dimensions of the model.
409
410
* See https://onnxruntime.ai/docs/tutorials/web/env-flags-and-session-options.html#freedimensionoverrides
@@ -412,3 +413,8 @@ export class AutoConfig {
412
413
* @property {import('./utils/dtypes.js').DataType|Record<string, import('./utils/dtypes.js').DataType>} [dtype] The default data type to use for the model.
413
414
* @property {import('./utils/hub.js').ExternalData|Record<string, import('./utils/hub.js').ExternalData>} [use_external_data_format=false] Whether to load the model using the external data format (used for models >= 2GB in size).
'WebNN does not currently support dynamic shapes and requires `free_dimension_overrides` to be set in config.jsonas a field within "transformers.js_config". '+
247
-
'When `free_dimension_overrides` is not set, you may experience significant performance degradation.'
258
+
`WebNN does not currently support dynamic shapes and requires 'free_dimension_overrides' to be set in config.json, preferably as a field within config["transformers.js_config"]["device_config"]["${selectedDevice}"]. `+
259
+
`When 'free_dimension_overrides' is not set, you may experience significant performance degradation.`
0 commit comments