Repository navigation
[OpenVINO] Export DFlash drafts for PagedAttention and continuous batching - #2096
Conversation
…NO 2026.5 for DFlash Co-authored-by: Cursor <cursoragent@cursor.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
failing tests https://github.com/huggingface/optimum-intel/actions/runs/41068096136/job/125328119818?pr=2096, please take a look |
|
Hi @echarlaix pushed a fix. Thanks! |
The DFlash drafts need the export from huggingface/optimum-intel#2096, which the pinned optimum-intel does not have, and the VLM DFlash tests need Transformers 5.2. As for the Qwen3.5 MTP tests, a separate job on Linux, manylinux and Windows installs both and runs the continuous-batching and VLM DFlash tests; the API and VLM jobs skip them. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@ofirzaf this PR has merge conflicts with main, could you rebase/merge and resolve them |
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # optimum/exporters/openvino/__main__.py # optimum/exporters/openvino/model_patcher.py # tests/openvino/test_genai.py
|
Updated the branch. Please review @echarlaix |
|
please don't merge it before #2062 |
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # optimum/exporters/openvino/model_configs.py # optimum/exporters/openvino/model_patcher.py
Qwen3DSparkForCausalLM now subclasses Qwen3DFlashForCausalLM and only adds the Markov head when markov_rank > 0, so DSpark drafts export the same per-row backbone as DFlash drafts. The backbone emits every row and no longer drops the anchor row for sample_from_anchor=False: dflash/candidate_position_offset (0 or 1) tells the runtime which rows are candidates. The Markov head model is unchanged. Qwen3DSparkModel maps back to Qwen3DSparkForCausalLM, and the test of the removed anchor-row drop is deleted. Co-authored-by: Igor Margulis <igor.margulis@intel.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Preview models support validation test failed because nightly GenAI doesn't have the new DFlash pipeline merged yet openvinotoolkit/openvino.genai#4790 |
please skip temporarily this test case with a comment. |
The preview models workflow runs it against the GenAI nightly, which still has the stateful DFlash draft and cannot run the per-row draft export. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@rkazants pushed a commit to skip the test with a comment that we can enable it once the genai PR lands in nightly |
There was a problem hiding this comment.
can you also update test_cb_compatible.py to check that dflash exported model is continous batching compatible and SDPAToPA transformation is applied?
huggingface/optimum-intel#2096 merged as f09a56ac, so the DFlash job installs that commit instead of the PR branch. The branch had pulled in optimum-intel main, where Qwen3.5 export needs transformers>=5.15, so the VLM DFlash tests failed to export with transformers 5.2.0; the job now installs transformers 5.15.1. Co-authored-by: Cursor <cursoragent@cursor.com>
What does this PR do?
Changes the DFlash draft export (DFlash, and DeepSpec / DSpark drafts with
markov_rank == 0) so the draft runs on PagedAttention in OpenVINO GenAI continuous batching. This replaces the continuous-batching PoC in #2028.Changes to the exported draft:
inputs_embeds,hidden_states,position_idsand the newtoken_type_idsinput all cover the new rows of a step,[context; block].token_type_idsis 0 for context rows, which read the target hidden states, and 1 for the seed + mask block rows, which read their embeddings.token_type_ids: causal, bidirectional inside the block, and sliding-window for the sliding layers.SDPAToPagedAttentionconverts it like any decoder attention:token_type_idsreaches everyPagedAttentionExtension, and each layer gets its own sliding window.o_projand the MLP. Context rows only produce keys and values.last_hidden_statecovers all rows and is zero in the context rows.Qwen3DSparkModeldrafts withmarkov_rank == 0now export through the sameQwen3DFlashForCausalLM.optimum-cli export openvino -m z-lab/Qwen3.5-9B-DFlash --task text-generation-with-past --trust-remote-code --weight-format int4 Qwen3.5-9B-DFlashoptimum-cli export openvino -m Qwen/Qwen3.5-9B --weight-format int4 Qwen3.5-9BBefore submitting