Skip to content

Conversation

@sayakpaul
Copy link
Member

What does this PR do?

We have a bunch of attention processors, normalization layers, and activation layers in the codebase and they have thin documentation. This is fine because users can always see their usage in the context of a model or a pipeline to get the fuller picture.

But since we document them in separate pages too, (such as this, this, and this), I think it makes sense to ensure these docs properly reflect what all we support.

This PR adds utilities to do that. @stevhliu I think you will like it :-)

@sayakpaul sayakpaul requested review from DN6, stevhliu and yiyixuxu April 24, 2024 07:10
@sayakpaul
Copy link
Member Author

@stevhliu any idea why the doc build fails?

@stevhliu
Copy link
Member

I'm not sure, the formatting all looks correct to me but for reason autodoc.py can't find them! cc @mishig25 have you encountered this before?

@sayakpaul
Copy link
Member Author

@mishig25 a gentle ping.

@mishig25
Copy link
Contributor

mishig25 commented May 2, 2024

let me check

Comment on lines 37 to 39
## LayerNorm

[[autodoc]] models.normalization.LayerNorm
Copy link
Contributor

@mishig25 mishig25 May 14, 2024

Choose a reason for hiding this comment

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

LayerNorm is the reason why doc-builder is not building.

I've inspected a bit.
All other norms are diffuser defined classes:

>>> import diffusers
>>> diffusers.models.normalization.GlobalResponseNorm
<class 'diffusers.models.normalization.GlobalResponseNorm'>

whereas LayerNorm seems to be alias to pytorch defined class (and doc-builder autodoc does not work with pytorch defined classes):

>>> import diffusers
>>> diffusers.models.normalization.LayerNorm
<class 'torch.nn.modules.normalization.LayerNorm'>

LayerNorm = nn.LayerNorm

Therefore, as a simple fix: I'd suggest replacing [[autodoc]] models.normalization.LayerNorm with something like: You can also use LayerNorm and add markdown link to pytorch layernorm doc

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @mishig25. I think it'd be okay to remove LayerNorm from our doc because our implementation is really a special case and is already supported in the latest versions of PyTorch.

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

@sayakpaul
Copy link
Member Author

@stevhliu @yiyixuxu this is ready for review.

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Sep 14, 2024
@sayakpaul sayakpaul removed the stale Issues that haven't received updates label Dec 8, 2024
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Jan 10, 2025
@yiyixuxu yiyixuxu removed the stale Issues that haven't received updates label Jan 13, 2025
@yiyixuxu
Copy link
Collaborator

can you take a look here @DN6?

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2025

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

@github-actions github-actions bot added the stale Issues that haven't received updates label Feb 7, 2025
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.

super cooll! thanks!

@yiyixuxu yiyixuxu removed the stale Issues that haven't received updates label Feb 19, 2025
@sayakpaul sayakpaul requested a review from hlky February 20, 2025 06:24
Copy link
Contributor

@hlky hlky left a comment

Choose a reason for hiding this comment

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

Nice!

@sayakpaul sayakpaul merged commit f550745 into main Feb 20, 2025
14 of 15 checks passed
@sayakpaul sayakpaul deleted the feat/check-doc-listing branch February 20, 2025 07:07
@sayakpaul sayakpaul mentioned this pull request Apr 14, 2025
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.

7 participants