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

Reduce img size in dummy_inputs for FLUX #1070

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

mvafin
Copy link
Contributor

@mvafin mvafin commented Dec 12, 2024

What does this PR do?

In addition to #1064 this change further reduce memory usage for FLUX conversion

Before (with #1064 change) After
~33Gb image ~13Gb image

Fixes # (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@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.

@IlyasMoutawwakil IlyasMoutawwakil merged commit 3c229fc into huggingface:main Dec 17, 2024
22 checks passed
@@ -1804,8 +1804,9 @@ def __init__(
normalized_config: NormalizedVisionConfig,
batch_size: int = DEFAULT_DUMMY_SHAPES["batch_size"],
num_channels: int = DEFAULT_DUMMY_SHAPES["num_channels"],
width: int = DEFAULT_DUMMY_SHAPES["width"],
height: int = DEFAULT_DUMMY_SHAPES["height"],
width: int = DEFAULT_DUMMY_SHAPES["width"] // 4,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This unfortunately doesn't work as defaults are set in the optimum code and this will not change the behaviour

Copy link
Member

Choose a reason for hiding this comment

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

oh ! damn, then it's gonna be problematic as we also don't want to divide user specified input shapes

Copy link
Member

Choose a reason for hiding this comment

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

@echarlaix do you know where exactly we can change these values for a specific architecture like Flux ?
I thought dummy inputs generators will use the defaults in their signature by default unless a user passes input shapes.

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.

3 participants