[OpenVINO] Add support for Zyphra ZAYA#4
Draft
mlukasze wants to merge 11 commits into
Draft
Conversation
* [CI] Bump style-bot SHA + switch to GitHub App * [CI] Bump style-bot to merged SHA e2867e92
* [OpenVINO] Use performant 3GEMM MoE for Qwen3.5 Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> * Fix quantization test Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com> --------- Signed-off-by: Kazantsev, Roman <roman.kazantsev@intel.com>
Support Zyphra ZAYA hybrid SSM+attention export and runtime in OpenVINO. Includes exporter registration, model patching, runtime cache handling, Zaya-specific tests, and docs update. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0937be4 to
9c528ab
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…opy_() with assignment+detach() so OpenVINO make_stateful can materialize the missing ReadValue/Assign pair for ZAYA Mamba state caches.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…patch Three fixes for ZAYA1-8B models exported with past_key_values/present naming (rather than cache_params.* naming): 1. Class dispatch fix (from_pretrained): OVModelWithMambaForCausalLM requires cache_params.* input names. When an SSM model is exported with standard past_key_values/present naming, fall back to OVModelForCausalLM which handles that correctly. 2. key_value_input_names rebuild (OVBaseDecoderModel.__init__): ZAYA exports even-layer KV-cache inputs as past_key_values.X.key/value and odd-layer KV-cache inputs as present.X.key/value (same name for both input and output). The standard filter only picks up past_key_values.* names, so key_value_input_names is half-empty. When inputs < outputs, rebuild the list ordered to match outputs so dict(zip(key_value_input_names, past_key_values)) is correct. 3. _reshape fix (OVBaseDecoderModel._reshape): present.X.key/value inputs (4-D KV tensors) must have their sequence dimension (dim 2) made dynamic, not dim 1 (num_heads). The previous else branch incorrectly set dim 1 to -1, making num_heads dynamic and causing 'Cannot get length of dynamic dimension' during empty-cache tensor creation in prepare_inputs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rid Mamba+Attention MoE) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…d SSM+Attention models Fix Concat shape mismatch in stateful dynamo export for ZAYA1-8B. opset13.gather with scalar axis can return a 0D tensor, but opset13.concat requires consistent rank. Normalize batch with reshape(-1) before concatenation. Also fixes ZayaDummyPastKeyValuesGenerator to read conv_kernel_size from model config instead of hardcoding 2. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds OpenVINO export and runtime support for Zyphra ZAYA (
zaya) — a hybrid attention + recurrent architecture implemented in Transformers asZayaForCausalLM.Installation instructions
Exporting cmd-line
optimum-cli export openvino -m Zyphra/ZAYA1-8B --task text-generation-with-past --weight-format int4 zaya1-8b-ov/Inference script
Before submitting