Deprecate KarrasVeScheduler and ScoreSdeVpScheduler by a-r-r-o-w · Pull Request #5269 · huggingface/diffusers · GitHub
Skip to content

Deprecate KarrasVeScheduler and ScoreSdeVpScheduler - #5269

Merged
patrickvonplaten merged 14 commits into
huggingface:mainfrom
a-r-r-o-w:remove-deprecated-schedulers
Nov 27, 2023
Merged

patrickvonplaten merged 14 commits into
huggingface:mainfrom
a-r-r-o-w:remove-deprecated-schedulers

Conversation

@a-r-r-o-w

@a-r-r-o-w a-r-r-o-w commented Oct 2, 2023 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #5257.

Please let me know if any other changes are required. Thanks!

Before submitting

@yiyixuxu

@a-r-r-o-w a-r-r-o-w changed the title Remove deprecated schedulers Deprecate KarrasVeScheduler and ScoreSdeVpScheduler Oct 2, 2023

@yiyixuxu yiyixuxu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for working on this!
Looks great!
Can you:

  1. run make style to make sure we pass quality tests
  2. maybe provide a simple code example to show that we can still use these 2 schedulers

@a-r-r-o-w

Copy link
Copy Markdown
Contributor Author

Comment thread src/diffusers/__init__.py Outdated
@a-r-r-o-w
a-r-r-o-w force-pushed the remove-deprecated-schedulers branch from a69b74d to 264fea5 Compare October 5, 2023 13:45
@a-r-r-o-w

Copy link
Copy Markdown
Contributor Author

Sorry about the force push 😅 Made an accidental push to the wrong branch.

@yiyixuxu

yiyixuxu commented Oct 6, 2023

Copy link
Copy Markdown
Collaborator

@a-r-r-o-w make sure the tests pass too!

@a-r-r-o-w

Copy link
Copy Markdown
Contributor Author

I'm not sure if these tests are failing due to something I've done. Could you help me out with this? The other failed tests were caused due to not running make fix-copies but that seems to be because of errant assumption to import ScoreSdeVpScheduler in diffusers/__init__.py when it wasn't there originally. Will commit the fix in a moment.

image
image

Comment thread src/diffusers/schedulers/__init__.py Outdated

@patrickvonplaten patrickvonplaten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cool!

@sayakpaul sayakpaul left a comment

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.

Cool!

Wondering if we should be a bit less aggressive about the deprecation i.e., we still let people allow importing the scheduler but instead, throw a deprecation warning.

@patrickvonplaten

Copy link
Copy Markdown
Contributor

@sayakpaul or @DN6 could you look into the failing docs error here?

Comment thread src/diffusers/schedulers/__init__.py Outdated
Comment on lines +130 to +131
from .deprecated.scheduling_karras_ve import KarrasVeScheduler
from .deprecated.scheduling_sde_vp import ScoreSdeVpScheduler

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.

https://github.com/huggingface/diffusers/actions/runs/6509446074/job/17680967513?pr=5269 tells the following:

ModuleNotFoundError: No module named 'diffusers.schedulers.deprecated'

To check this I did the following:

  • Cloned the PR branch and ran pip install -e . in a separate env (ensuring PT installation too).
  • From there in the activate env, I was able to successfully import: import diffusers.scheduler.deprecated.

This contradicts the error message we get from the CI.

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.

from diffusers import StableDiffusionControlNetPipeline

Also works as expected.

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.

Hmm, this seems weird... I'm on python3.11 locally and a fresh install works for me as well without any errors.

@a-r-r-o-w

Copy link
Copy Markdown
Contributor Author

@sayakpaul @yiyixuxu Is there anything else I can do here? I can't seem to replicate the CI test fail...

@yiyixuxu yiyixuxu left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

looks good to me to merge :)

ohh actually, didn't realize the test fail is relevant here....

@yiyixuxu

Copy link
Copy Markdown
Collaborator

@DN6 do you have any idea why this is happening?

@a-r-r-o-w a-r-r-o-w closed this Nov 7, 2023
@a-r-r-o-w
a-r-r-o-w deleted the remove-deprecated-schedulers branch November 7, 2023 11:42
@patrickvonplaten

Copy link
Copy Markdown
Contributor

@a-r-r-o-w, sorry that we're being a bit slow here - I think the PR is still very much relevant, should we re-open it?

@a-r-r-o-w

Copy link
Copy Markdown
Contributor Author

@patrickvonplaten Oh, this was closed accidentally 😅 I was pruning all my remote branches that had been merged or had work that was covered by another contributor.

Yes, let's re-open it. Do let me know if there's anything I can do from my end, thanks!

@a-r-r-o-w
a-r-r-o-w restored the remove-deprecated-schedulers branch November 10, 2023 07:05
@a-r-r-o-w a-r-r-o-w reopened this Nov 10, 2023
@a-r-r-o-w

Copy link
Copy Markdown
Contributor Author

Not sure why this is failing since locally, it works on python3.11 and python3.10.x. CI uses python3.8, so installing that right now to check if maybe that's the cause (highly unlikely though).

image

@yiyixuxu

Copy link
Copy Markdown
Collaborator

thanks for re-open this!

@patrickvonplaten is this something we can fix in the main?

@patrickvonplaten

Copy link
Copy Markdown
Contributor

thanks for re-open this!

@patrickvonplaten is this something we can fix in the main?

Sorry I don't fully understand, what do you mean?

@a-r-r-o-w
a-r-r-o-w requested a review from yiyixuxu November 15, 2023 22:38
Comment thread src/diffusers/schedulers/__init__.py Outdated
@yiyixuxu

Copy link
Copy Markdown
Collaborator

@patrickvonplaten can we take a look to see if it's ok now? think the test failure is not relevant

@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Nov 17, 2023 •

Copy link
Copy Markdown

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

@patrickvonplaten

Copy link
Copy Markdown
Contributor

We'll need to solve the merge conflict here I'm afraid

@a-r-r-o-w
a-r-r-o-w force-pushed the remove-deprecated-schedulers branch from 16d60e4 to a8abb26 Compare November 21, 2023 20:17
Co-Authored-By: YiYi Xu <yixu310@gmail.com>
@a-r-r-o-w

Copy link
Copy Markdown
Contributor Author

@patrickvonplaten @yiyixuxu This should be ready for merge. Had to rewrite the commit history with rebase to solve the merge conflict we had earlier, however it should still show Yiyi as the author of the commits made.

@patrickvonplaten

Copy link
Copy Markdown
Contributor

@patrickvonplaten
patrickvonplaten merged commit 9c357bd into huggingface:main Nov 27, 2023
yoonseokjin pushed a commit to yoonseokjin/diffusers that referenced this pull request Dec 25, 2023
* deprecated: KarrasVeScheduler, ScoreSdeVpScheduler

* delete tests relevant to deprecated schedulers

* chore: run make style

* fix: import error caused due to incorrect _import_structure after deprecation

* fix: ScoreSdeVpScheduler was not importable from diffusers

* remove import added by assumption

* Update src/diffusers/schedulers/__init__.py as suggested by @patrickvonplaten

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* make it a part deprecated

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* Fix

* fix

* fix doc

* fix doc....again.......

* remove karras_ve test folder

Co-Authored-By: YiYi Xu <yixu310@gmail.com>

---------

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: YiYi Xu <yixu310@gmail.com>
Co-authored-by: yiyixuxu <yixu310@gmail,com>
AmericanPresidentJimmyCarter pushed a commit to AmericanPresidentJimmyCarter/diffusers that referenced this pull request Apr 26, 2024
* deprecated: KarrasVeScheduler, ScoreSdeVpScheduler

* delete tests relevant to deprecated schedulers

* chore: run make style

* fix: import error caused due to incorrect _import_structure after deprecation

* fix: ScoreSdeVpScheduler was not importable from diffusers

* remove import added by assumption

* Update src/diffusers/schedulers/__init__.py as suggested by @patrickvonplaten

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* make it a part deprecated

* Apply suggestions from code review

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>

* Fix

* fix

* fix doc

* fix doc....again.......

* remove karras_ve test folder

Co-Authored-By: YiYi Xu <yixu310@gmail.com>

---------

Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Co-authored-by: Sayak Paul <spsayakpaul@gmail.com>
Co-authored-by: YiYi Xu <yixu310@gmail.com>
Co-authored-by: yiyixuxu <yixu310@gmail,com>
@stevhliu stevhliu mentioned this pull request Aug 20, 2026
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.

[HacktoberFest] remove outdated schedulers

5 participants