Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relax UnsqueezeBroadcastReshapeSDPAFusion with no need to ask querry … #27515

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ceciliapeng2011
Copy link
Contributor

@ceciliapeng2011 ceciliapeng2011 commented Nov 12, 2024

…branch from non-reshape.

Details:

  • improve the 2nd token latency for GLM4 model.

Tickets:

  • 157261

@ceciliapeng2011 ceciliapeng2011 requested review from a team as code owners November 12, 2024 08:08
@github-actions github-actions bot added the category: GPU OpenVINO GPU plugin label Nov 12, 2024
@TianmengChen
Copy link

Hi, cecilia
We try to run glm4v under this PR, but get error log:

Traceback (most recent call last):
  File "C:\chen\zhipu\glm4v\test_v_ov.py", line 20, in <module>
    model = OvGLM4v(MODEL_PATH, "GPU")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\chen\zhipu\glm4v\glm4v_helper.py", line 407, in __init__
    compiled_model = core.compile_model(self.model, device)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\chen\genai\Lib\site-packages\openvino\runtime\ie_api.py", line 543, in compile_model
    super().compile_model(model, device_name, {} if config is None else config),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Exception from src\inference\src\cpp\core.cpp:107:
Exception from src\inference\src\dev\plugin.cpp:53:
Exception from src\core\src\pass\graph_rewrite.cpp:295:
[MATCHER] UnsqueezeBroadcastReshapeSDPAFusionnode: gpu_opset::SDPA __module.model.encoder.layers.0.self_attention.core_attention/aten::scaled_dot_product_attention/ScaledDotProductAttention (opset1::Reshape aten::flatten/Reshape[0]:f16[?,16,?,128], opset1::Reshape __module.model.encoder.layers.0.self_attention/aten::view/Reshape_2[0]:f16[?,16,?,128], opset1::Reshape __module.model.encoder.layers.0.self_attention/aten::view/Reshape_4[0]:f16[?,16,?,128], opset1::Select __module.model.encoder.layers.0.self_attention.core_attention/aten::masked_fill_/Select[0]:f16[?,1,?,?]) -> (f16[?,16,?,128]) callback has thrown: Check 'value_input_correctness' failed at src\core\shape_inference\include\scaled_dot_product_attention_shape_inference.hpp:68:
While validating node 'gpu_opset::SDPA SDPA_58065 (opset1::Reshape aten::flatten/Reshape[0]:f16[?,16,?,128], gpu_opset::KVCache __module.model.encoder.layers.0.self_attention/aten::cat/Concat[0]:f16[?,?,?,?], gpu_opset::KVCache __module.model.encoder.layers.0.self_attention/aten::cat/Concat_1[0]:f16[?,4,?,128], opset1::Select __module.model.encoder.layers.0.self_attention.core_attention/aten::masked_fill_/Select[0]:f16[?,1,?,?]) -> ()' with friendly_name 'SDPA_58065':
Shape inference input shapes {[?,16,?,128],[?,?,?,?],[?,4,?,128]}
Value input shape not compatible with other inputs.

can you have a look, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: GPU OpenVINO GPU plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants