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
{{ message }}
Repository navigation
Commit 9930a91
Browse filesBrowse the repository at this point in the historyBrowse files
Auto-detect KV in-place support from graph; thread --ep through build-gguf
ORT GenAI's past_present_share_buffer mode requires the decoder graph
to update the KV cache in place (com.microsoft.GroupQueryAttention).
The standard ONNX opset 23 Attention op concatenates past_key + new_K
and returns a dynamic-shape present_key, which is incompatible with
the pre-allocated shared buffer ORT GenAI passes in. The previous
config wrote past_present_share_buffer=True purely from the target EP
flag, which meant builds that didn't apply the GQA rewrite (anything
other than --ep cpu / cuda / dml / etc.) silently shipped a broken
config and crashed at first inference with 'inconsistent
total_sequence_length'.
This change:
* Adds supports_in_place_kv_cache to GenaiConfigGenerator and
_default_search_params; when set it overrides the EP flag.
* In auto_export._write_genai_config, introspects the decoder graph
for GroupQueryAttention nodes and passes the result through.
Standard-Attention graphs now correctly get share_buffer=False
regardless of the target EP.
* Adds --ep to the build-gguf CLI and threads execution_provider
through build_from_gguf so users can opt into the GQA rewrite for
GGUF imports the same way they can for HF imports.
* Updates examples/hy_mt1_5.py to build the Q1_0 variant with
--ep cpu so the example exercises the full share-buffer path
end-to-end and removes the post-hoc _patch_genai_config workaround.
Verified end-to-end on tencent/Hy-MT1.5-1.8B-2bit:
- 32 GroupQueryAttention nodes after build
- genai_config.search.past_present_share_buffer = true
- 'Translate to Spanish: The cat is sleeping on the chair.'
-> 'El gato está durmiendo en la silla.'
Full suite: 2753 passed, 0 failures.
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
0 commit comments