onnxruntime
88855c7f - webgpu: Add configurable multi rotary cache concat offset parameter (#27434)

Commit
231 days ago
webgpu: Add configurable multi rotary cache concat offset parameter (#27434) This pull request adds support for a new configuration option, `multiRotaryCacheConcatOffset`, to the WebGPU execution provider in ONNX Runtime. This option allows for the use of a concatenated multi rotary cache in rotary embedding operations, which can be enabled or disabled via provider configuration. The changes propagate this option through the provider, compute context, and shader programs, and update the relevant WGSL shader templates to use the offset when specified. These changes enable more flexible and efficient handling of rotary cache concatenation in transformer models running on WebGPU. In GenAI builder.py, when enable_webgpu_graph is enabled, [xxx_cache_small and xxx_cache_large will concat](https://github.com/microsoft/onnxruntime-genai/blob/main/src/python/py/models/builders/base.py#L1942-L1943) together. In rope mode, we need this information to get the correct rotary cache information. It fixes the issue that the result is not correct when total sequence length is larger than 4096 for phi model generated by builder.py with enable_webgpu_graph enabled.
Author
Parents
Loading