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

[Bug]: T5 Text Encoder producing (very) different output on GPU when model is compiled for dynamic vs. static shape #29017

Open
3 tasks done
RyanMetcalfeInt8 opened this issue Feb 16, 2025 · 0 comments
Assignees
Labels
bug Something isn't working category: GPU OpenVINO GPU plugin support_request

Comments

@RyanMetcalfeInt8
Copy link

OpenVINO Version

2025.1 Nightly (openvino_toolkit_windows_2025.1.0.dev20250214_x86_64)

Operating System

Windows System

Device used for inference

GPU

Framework

None

Model used

T5 Text Encoder

Issue description

The T5 Text Encoder Model (from Stable Diffusion 3 pipeline) produces very different output when it is compiled & run on GPU using dynamic shapes, vs static shapes. Note that this issue seems to be specific to GPU -- I do not observe the same problem when using CPU.

See reproduce steps below for more details.

Step-by-step reproduction

I have attached a small C++ reproducer:

t5_static_vs_dynamic_reproducer.zip

  1. Obtain T5 Text Encoder model by generating SD3 models via the following cmd's. Note: sd3_requirements.txt is packaged with the zip
python -m venv my_env
my_env\Scripts\activate
pip install --upgrade-strategy eager -r sd3_requirements.txt
optimum-cli export openvino --model stabilityai/stable-diffusion-3-medium-diffusers --task stable-diffusion --weight-format fp16 stable-diffusion-3-medium-diffusers
  1. Build the small C++ reproducer (cmd.exe shell):
call "openvino_toolkit_windows_2025.1.0.dev20250214_x86_64\setupvars.bat"
mkdir t5_static_vs_dynamic_reproducer-build
cd t5_static_vs_dynamic_reproducer-build
cmake ..\t5_static_vs_dynamic_reproducer
cmake --build . --config Release
  1. Run it.
cd Release
main.exe <path_to>\stable-diffusion-3-medium-diffusers\text_encoder_3\openvino_model.xml GPU

You should see the following at the end of the log, which indicates different output between static & dynamic:

Mismatch at postiion 0
  static = -0.244141
  dynamic = -0.00371361
done..

Note that if you replace 'GPU' with 'CPU', no mismatches are reported.

Relevant log output

Issue submission checklist

  • I'm reporting an issue. It's not a question.
  • I checked the problem with the documentation, FAQ, open issues, Stack Overflow, etc., and have not found a solution.
  • There is reproducer code and related data files such as images, videos, models, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working category: GPU OpenVINO GPU plugin support_request
Projects
None yet
Development

No branches or pull requests

4 participants