Skip to content

Conversation

@sayakpaul
Copy link
Member

@sayakpaul sayakpaul commented Apr 2, 2024

In some cases, changing the number of groups is simply not possible because internally it's hard-coded. So, I haven't touched those (UNetSpatioTemporal for example).

@sayakpaul sayakpaul requested review from DN6 and yiyixuxu April 2, 2024 10:12
enable_full_determinism()


@skip_mps
Copy link
Member Author

Choose a reason for hiding this comment

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

More than 60% of the tests under this class fails on my Mac Silicon (because Silicon currently doesn't have support for Conv3D). Better to just skip them entirely.

def prepare_init_args_and_inputs_for_common(self):
init_dict = {
"block_out_channels": (32, 64),
"block_out_channels": (16, 32),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Possible to make smaller?

Copy link
Member Author

Choose a reason for hiding this comment

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

There's a hard-coded 32 value somewhere in the TransformerSpatioTemporalModel module. It will lead to:

FAILED tests/models/unets/test_models_unet_motion.py::UNetMotionModelTests::test_output - ValueError: num_channels must be divisible by num_groups

So, a little infeasible at the moment. But I have made a best effort to reduce the other dimensions (such as sample size, number of frames, cross attention dim, etc.). Hopefully that cuts it?

@sayakpaul sayakpaul requested a review from DN6 April 4, 2024 04:20
@sayakpaul
Copy link
Member Author

@DN6 up for another review.

Copy link
Collaborator

@DN6 DN6 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 1c60e09 into main Apr 5, 2024
@sayakpaul sayakpaul deleted the reduce-block-sizes-unet branch April 5, 2024 04:38
noskill pushed a commit to noskill/diffusers that referenced this pull request Apr 5, 2024
* reduce block sizes for unet1d.

* reduce blocks for unet_2d.

* reduce block size for unet_motion

* increase channels.

* correctly increase channels.

* reduce number of layers in unet2dconditionmodel tests.

* reduce block sizes for unet2dconditionmodel tests

* reduce block sizes for unet3dconditionmodel.

* fix: test_feed_forward_chunking

* fix: test_forward_with_norm_groups

* skip spatiotemporal tests on MPS.

* reduce block size in AutoencoderKL.

* reduce block sizes for vqmodel.

* further reduce block size.

* make style.

* Empty-Commit

* reduce sizes for ConsistencyDecoderVAETests

* further reduction.

* further block reductions in AutoencoderKL and AssymetricAutoencoderKL.

* massively reduce the block size in unet2dcontionmodel.

* reduce sizes for unet3d

* fix tests in unet3d.

* reduce blocks further in motion unet.

* fix: output shape

* add attention_head_dim to the test configuration.

* remove unexpected keyword arg

* up a bit.

* groups.

* up again

* fix
sayakpaul added a commit that referenced this pull request Dec 23, 2024
* reduce block sizes for unet1d.

* reduce blocks for unet_2d.

* reduce block size for unet_motion

* increase channels.

* correctly increase channels.

* reduce number of layers in unet2dconditionmodel tests.

* reduce block sizes for unet2dconditionmodel tests

* reduce block sizes for unet3dconditionmodel.

* fix: test_feed_forward_chunking

* fix: test_forward_with_norm_groups

* skip spatiotemporal tests on MPS.

* reduce block size in AutoencoderKL.

* reduce block sizes for vqmodel.

* further reduce block size.

* make style.

* Empty-Commit

* reduce sizes for ConsistencyDecoderVAETests

* further reduction.

* further block reductions in AutoencoderKL and AssymetricAutoencoderKL.

* massively reduce the block size in unet2dcontionmodel.

* reduce sizes for unet3d

* fix tests in unet3d.

* reduce blocks further in motion unet.

* fix: output shape

* add attention_head_dim to the test configuration.

* remove unexpected keyword arg

* up a bit.

* groups.

* up again

* fix
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