Skip to content

Conversation

@lawrence-cj
Copy link
Contributor

What does this PR do?

This PR fix the Positional Embedding missing bug. We re-introduce PE into > 2K resolution models. So we need to add PE back in SanaTransformer2DModel

Cc: @yiyixuxu @sayakpaul @a-r-r-o-w , thanks in advance for merging this PR to fix the bug.

Before the PR:
image

After the PR:
sana2

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

@nitinmukesh
Copy link

Adding comment to get notification when it's merged.

base_output = model(**inputs_dict)

model_size = compute_module_sizes(model)[""]
model_size = compute_module_persistent_sizes(model)[""]
Copy link
Collaborator

Choose a reason for hiding this comment

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

we estimate the checkpoint size here, so should not include non-persistent buffers; technically we could pass remove_non_persistent to the named_module_tensors here but it will require a PR to accelerate so adding a function here for now
https://github.com/huggingface/accelerate/blob/200c9eb7833cfa505907f6f224ebf5a275aa6d92/src/accelerate/utils/modeling.py#L724

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there anything I need to do here? I'm not familiar with what you said above. 🤔

@yiyixuxu yiyixuxu requested a review from DN6 December 23, 2024 01:27
@DN6 DN6 merged commit b58868e into huggingface:main Dec 23, 2024
12 checks passed
sayakpaul pushed a commit that referenced this pull request Dec 23, 2024
* fix the Positinoal Embedding bug in 2K model;

* Change the default model to the BF16 one for more stable training and output

* make style

* substract buffer size

* add compute_module_persistent_sizes

---------

Co-authored-by: yiyixuxu <[email protected]>
@lawrence-cj lawrence-cj deleted the Sana-PE branch January 2, 2025 15:25
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.

5 participants