Skip to content

Fixing missing provider options argument #11397

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

Merged
merged 9 commits into from
Apr 28, 2025

Conversation

urpetkov-amd
Copy link
Contributor

What does this PR do?

This PR adding support for provider options argument for diffusers pipelines. In previous approach, not all of the necessary code had been added following those two closed PRs:
#10719
#10661

Provider options argument is missing on two places: diffusers/src/diffusers/pipelines/onnx_utils.py lines 177. and 193.

ONNXRuntime Inference Session( ) method accepts provider options as a list of dictionary, change on: diffusers/src/diffusers/pipelines/onnx_utils.py line 79.

Fixes missing provider options argument.

Before submitting

Who can review?

@yiyixuxu
@asomoza
@sayakpaul
@DN6

@sayakpaul sayakpaul requested a review from echarlaix April 23, 2025 15:35
@yiyixuxu yiyixuxu requested a review from Copilot April 23, 2025 16:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the missing provider options argument for diffusers pipelines, ensuring that the ONNX Runtime InferenceSession receives the expected list of provider options.

  • Update the provider_options parameter to a list in the InferenceSession instantiation.
  • Propagate provider_options from kwargs in both local and hub model loading.

Comment on lines 78 to 79
return ort.InferenceSession(
path, providers=[provider], sess_options=sess_options, provider_options=provider_options
path, providers=[provider], sess_options=sess_options, provider_options=[provider_options]
Copy link
Preview

Copilot AI Apr 23, 2025

Choose a reason for hiding this comment

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

Wrapping provider_options in a list may result in [None] if provider_options is not provided. Consider defaulting to an empty list or checking for a non-null value before wrapping.

Copilot uses AI. Check for mistakes.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@urpetkov-amd
Copy link
Contributor Author

@yiyixuxu Added changes for None case and explained second Copilot suggestions.

@urpetkov-amd urpetkov-amd requested a review from yiyixuxu April 25, 2025 09:44
@urpetkov-amd
Copy link
Contributor Author

Are we okay with this? If we are okay, can we merge it soon? Thanks!

@yiyixuxu
@asomoza
@sayakpaul
@DN6

@yiyixuxu
Copy link
Collaborator

@bot /style

Copy link
Contributor

Style fixes have been applied. View the workflow run here.

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

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

thanks!
I left one comment, will merge soon

@urpetkov-amd
Copy link
Contributor Author

@yiyixuxu Added your suggestions, thanks!

@yiyixuxu yiyixuxu merged commit 4a9ab65 into huggingface:main Apr 28, 2025
11 of 12 checks passed
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