Adding multi_specializations_frames#909
Conversation
|
@mohiso22 can you fix the quickcheck pls? |
|
|
||
| def _generate_multi_frame_specialization( | ||
| self, | ||
| inputs: List[str] = None, |
There was a problem hiding this comment.
nit: update the type annotation for inputs as inputs: Dict[str, torch.Tensor]
| } | ||
| ] | ||
| else: | ||
| assert vision_size * f < user_vision_size, ( |
There was a problem hiding this comment.
nit: better to use exception instead of assert.
| grid_height = grid_height * time * batch_size | ||
| if not user_vision_size: | ||
| max_vision_size = max(max_vision_size, vision_size * f) | ||
| assert max_vision_size < ctx_len, ( |
There was a problem hiding this comment.
nit: better to use exception instead of assert.
| return self._generate_regular_batching(vision_prompts, generation_len, stream, **kwargs) | ||
|
|
||
| def run_prefill_multi_frame_specialization( | ||
| self, inputs: Optional[torch.Tensor], num_frames: Optional[int] = 1, generation_len: int = None |
There was a problem hiding this comment.
please add a doc string for the method
| self._session.deactivate() | ||
| self._vision_session.activate() | ||
|
|
||
| if not num_frames: |
There was a problem hiding this comment.
nit: better to specific it as if num_frames ==0: num_frames = 1 and add a warning if that was the check. Since default value is set to 1 ideally we need not need this condition unless somewhere we are passing the value as none.
Signed-off-by: Mohit Soni <mohisoni@qti.qualcomm.com>
Signed-off-by: Mohit Soni <mohisoni@qti.qualcomm.com>
Signed-off-by: Mohit Soni <mohisoni@qti.qualcomm.com>
Signed-off-by: Mohit Soni <mohisoni@qti.qualcomm.com>
Signed-off-by: Mohit Soni <mohisoni@qti.qualcomm.com>
Signed-off-by: Mohit Soni <mohisoni@qti.qualcomm.com>
Signed-off-by: Mohit Soni <mohisoni@qti.qualcomm.com>
Signed-off-by: Mohit Soni <mohisoni@qti.qualcomm.com>
Signed-off-by: Mohit Soni <mohisoni@qti.qualcomm.com>
ccaac2c to
d50cf6d
Compare
|
Merging the PR on release/v1.21.6. @mohiso22 please raise a new PR on mainline with the couple of changes requested. |
…models as per reference from quic#909. Signed-off-by: Dhiraj Kumar Sah <dhirajku@qti.qualcomm.com>
Adds multi-specialization support for Qwen2.5-VL and Qwen3-VL, enabling the vision encoder to be compiled with multiple resolution configurations (height/width/num_frames as lists) in one shot.
Introduces a dedicated _generate_multi_frame_specialization inference path that selects the right specialization at runtime, along with example scripts for both model families.