Skip to content

Complete set_attn_processor for prior and vae#3796

Merged
patrickvonplaten merged 14 commits intomainfrom
add_prior_tests
Jun 15, 2023
Merged

Complete set_attn_processor for prior and vae#3796
patrickvonplaten merged 14 commits intomainfrom
add_prior_tests

Conversation

@patrickvonplaten
Copy link
Copy Markdown
Contributor

@patrickvonplaten patrickvonplaten commented Jun 15, 2023

This adds cleans up the tests a bit and makes sure that:

  • UNet2DConditionModel
  • PriorTransformer
  • AutoencoderKL

all have the same features. This PR also cleans up the tests a bit and adds a whole test suite for the prior transformer.

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented Jun 15, 2023

The documentation is not available anymore as the PR was closed or merged.

@patrickvonplaten patrickvonplaten changed the title Add prior tests Complete set_attn_processor for prior and vae Jun 15, 2023
@patrickvonplaten patrickvonplaten mentioned this pull request Jun 15, 2023
4 tasks
Copy link
Copy Markdown
Contributor

@kashif kashif left a comment

Choose a reason for hiding this comment

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

i love the tests!


from ..configuration_utils import ConfigMixin, register_to_config
from ..utils import BaseOutput, apply_forward_hook
from .attention_processor import AttentionProcessor, AttnProcessor
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we maybe also implement this automatic discoverability of AttnProcessor2_0?

AttnProcessor2_0() if hasattr(F, "scaled_dot_product_attention") and self.scale_qk else AttnProcessor()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't fully follow here. Note that by default the ATTN 2.0 is always chosen whenever someone uses the Attention class which is done for both the AutoEncoder and the Prior, see:



class NCSNppModelTests(ModelTesterMixin, unittest.TestCase):
class NCSNppModelTests(ModelTesterMixin, UNetTesterMixin, unittest.TestCase):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Curiosity:

What does it mean by NCSNpp?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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



class UNetRLModelTests(ModelTesterMixin, unittest.TestCase):
class UNetRLModelTests(ModelTesterMixin, UNetTesterMixin, unittest.TestCase):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Curiosity?

What is it called UNetRLModelTests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Tests a RL model we've integrated

Copy link
Copy Markdown
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Exceptionally clean!

patrickvonplaten and others added 2 commits June 15, 2023 17:27
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
@patrickvonplaten patrickvonplaten merged commit ea8ae8c into main Jun 15, 2023
@patrickvonplaten patrickvonplaten deleted the add_prior_tests branch June 15, 2023 15:43
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* relax tolerance slightly

* Add more tests

* upload readme

* upload readme

* Apply suggestions from code review

* Improve API Autoencoder KL

* finalize

* finalize tests

* finalize tests

* Apply suggestions from code review

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>

* up

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* relax tolerance slightly

* Add more tests

* upload readme

* upload readme

* Apply suggestions from code review

* Improve API Autoencoder KL

* finalize

* finalize tests

* finalize tests

* Apply suggestions from code review

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>

* up

---------

Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
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.

4 participants