Skip to content

Conversation

@ajrasane
Copy link
Contributor

@ajrasane ajrasane commented Nov 7, 2025

What does this PR do?

Type of change:
Minor code change

Overview:

  • Select the high precision dtype directly based on model type - FP16 for Stable Diffusion models, BF16 for Flux

Testing

python diffusion_trt.py --model flux-dev --benchmark

Before your PR is "Ready for review"

  • Make sure you read and follow Contributor guidelines and your commits are signed.
  • Is this change backward compatible?: No (No option to specify dtype while loading pipeline)
  • Did you write any new necessary tests?: No
  • Did you add or update any necessary documentation?: Yes
  • Did you update Changelog?: Yes

@ajrasane ajrasane requested a review from cjluo-nv November 7, 2025 03:08
@ajrasane ajrasane self-assigned this Nov 7, 2025
@ajrasane ajrasane requested a review from a team as a code owner November 7, 2025 03:08
@ajrasane ajrasane requested a review from jingyu-ml November 7, 2025 03:08
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.52%. Comparing base (5adb9ba) to head (80a128d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #526   +/-   ##
=======================================
  Coverage   73.52%   73.52%           
=======================================
  Files         181      181           
  Lines       18207    18207           
=======================================
  Hits        13387    13387           
  Misses       4820     4820           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

model_dtype = None
if hasattr(pipe, "transformer"):
backbone = pipe.transformer
model_dtype = "Bfloat16"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just use the dtype from the model or this has to be setup like the hardcoded way?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have hardcoded the dtype in create_pipeline_from() function, so we will have to use this in the hardcoded way.

Copy link
Contributor

@jingyu-ml jingyu-ml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ajrasane ajrasane changed the title [NVBUG: 5619158] Enfore high precision model dtype for diffusion trt [NVBUG: 5619158] Enforce high precision model dtype for diffusion trt Nov 7, 2025
@ajrasane ajrasane merged commit 2290533 into main Nov 7, 2025
26 checks passed
@ajrasane ajrasane deleted the ajrasane/trt_b100 branch November 7, 2025 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants