Add weight sharing and support for AMD (Vitis AI) - #1305
Open
Supreet Singh Palne (spalne) wants to merge 5 commits into
Open
Add weight sharing and support for AMD (Vitis AI)#1305Supreet Singh Palne (spalne) wants to merge 5 commits into
Supreet Singh Palne (spalne) wants to merge 5 commits into
Conversation
Supreet Singh Palne (spalne)
marked this pull request as ready for review
August 13, 2026 15:54
Qiong Wu (qiowu) (DingmaomaoBJTU)
left a comment
Collaborator
There was a problem hiding this comment.
Found two deterministic unit-test regressions in the current PR head.
| assert self._context_length is not None, "_new_generator called before load()" | ||
| max_length = min(prompt_len + cfg.max_new_tokens, self._context_length) | ||
| max_length = ( | ||
| self._context_length |
Collaborator
There was a problem hiding this comment.
This makes the existing decoder-pipeline test test_max_length_is_prompt_plus_max_new_tokens receive max_length=131072 instead of 69, so the unit test now fails deterministically. Please update the affected test/behavior contract together with this change.
| assert itr_opts is not None | ||
| vitisai_opts = ctx_opts["provider_options"][0]["vitisai"] | ||
| assert vitisai_opts["target"] == "waic_target_vaiml_cpp_me" | ||
| assert vitisai_opts["xmc_runner_config"] == 1 |
Collaborator
There was a problem hiding this comment.
vitisai_stage_session_options() emits the provider option as the string "1", so this assertion fails ("1" != 1); the no_linear_slice assertion below has the same mismatch. Please align both expectations with the emitted string values.
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.
Weight sharing for the decoder — Enables the Qwen3 decoder's context (prefill) and iterator (decode) stages to be compiled through a single shared EP context. Since both stages derive from the same weights, they now emit one shared weight .bin referenced by both graphs instead of duplicating the weights per stage reducing on disk bundle size and load-time memory. The grouping logic is execution-provider-agnostic, so it applies automatically to QNN, VitisAI, and OpenVINO.
Adds VitisAI as a supported execution provider for the Qwen3 transformer (context/iterator) stages, alongside the existing QNN. Building with now emits the correct per-stage session_options into genai_config.json, routing inference to the AMD NPU via the waic_target_vaiml_cpp_me VAIML C++ backend.