- 
                Notifications
    
You must be signed in to change notification settings  - Fork 6.5k
 
[modular] Tests for custom blocks in modular diffusers #12557
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
base: main
Are you sure you want to change the base?
Conversation
| num_frames_per_block = 2 | ||
| num_blocks = 2 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small numbers to keep the runtime small. Rest of the codebase is from
https://huggingface.co/krea/krea-realtime-video#use-it-with-%F0%9F%A7%A8-diffusers
| for block in pipe.transformer.blocks: | ||
| block.self_attn.fuse_projections() | ||
| 
               | 
          ||
| for block_idx in range(num_blocks): | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so a little bit related to the idea you had here https://huggingface.slack.com/archives/C065E480NN9/p1761726088454629?thread_ts=1761713343.592699&cid=C065E480NN9
in addition to being a docstring example, I think If remote custom pipelines include an executable example string, we can also programmatically discover it and create slow tests for them in our test suite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed over Slack, we will do it after a few days.
| 
           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.  | 
    
What does this PR do?
As the title suggests, this PR adds a test suite for the custom blocks in modular diffusers.
TestModularCustomBlockstests for basic checks, e.g., properties, configs, components, inputs, etc. It also has a test that checks for Hub loading and its correctness.TestKreaCustomBlocksIntegrationchecks for correct loading and also the forward pass to ensure nothing is broken as we continue to improve modular diffusers.Notes:
.github/workflows/pr_modular_tests.yml, getting rid of the matrix as it wasn't really needed.pytestbecause we want to slowly move to it fromunittest.pytestmakes things easier to maintain long term.TestKreaCustomBlocksIntegrationtest suite was checked in an H100 because it is a bit heavy.