-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
#7535 Update FloatTensor type hints to Tensor #7883
#7535 Update FloatTensor type hints to Tensor #7883
Conversation
@DN6 Can you approve this for a pipeline run? Due to the number of files this touches, I was trying to run the full suite on my laptop but it was taking over an hour, and I see it takes way less than an hr (around 20m) for people's tests to run in the CI pipeline. |
cc @standardAI here :) |
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. |
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.
thank you so much for doing this!!
I think we need to manually update this too (a test currently fails) https://github.com/huggingface/diffusers/blob/8edaf3b79c564a56fbffb003ee74ac92e9162a73/tests/others/test_check_copies.py#L31C1-L31C15 |
Yep! On it. Thanks for the review! |
Do you think it makes sense to update the examples too? Just realized I missed those |
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.
Thanks so much for updating! 👏
What examples are you referring to?
I really meant all of them that reference or use FloatTensor. I decided to update them. I'm running the tests on my server right now instead of my laptop, but they're still going pretty slow. Do one of you mind approving the workflow again? |
How long should the full suite of tests take to run? I started a full run last night on my home server and as of this morning, they're still running. I'm curious to hear what's the typical dev flow for situations like this for those of you at HF. It seems super weird for it to take this long. Maybe the 32 worker threads it spun up was too many and my box is getting bottlenecked somewhere? Would it run faster if I passed my GPU to it? On my Mac, the pipelines never were this slow (but they were only running 8 threads since there were only 8 "cores"), but on my much more powerful server it is typical to see numbers like "159s/it". |
01491e3
to
961ce4b
Compare
An update on the test that failed: I believe the one that caused the failed pipeline was a fluke as it passes consistently on my box. I think it just needs a retry. Looking forward at other tests that have yet to run in the pipeline, I am consistently having issues with one of the determinism tests: I see that elsewhere the precision required for the determinism test was reduced to Admittedly determinsim is definitely something that's a little out of my wheelhouse, so it's totally possible I missed something, and I would love to hear any ideas y'all may have. In the meantime, I'll continue investigating tomorrow in my free time. I'm totally down to hop on a call to talk about it if any of you at HF are open to it! But I know you guys are probably really busy, so I also completely understand if that's not something of interest. I'll hop on the Discord though Thanks in advance! |
Thanks for updating type hints Mark!
And, I used this command: python -m pytest -n auto --dist=loadfile -s -v examples/text_to_image/test_text_to_image.py::TextToImage::test_text_to_image |
cb7dd2b
to
78500e8
Compare
Pipeline passed, woohoo, let's go! Does someone with permissions mind merging? |
thank you! |
Amazing, thank you all! Super stoked to have my first contribution merged in :) |
diffusers commit be4afa0 #7535 Update FloatTensor type hints to Tensor huggingface/diffusers#7883
What does this PR do?
Updates all references to torch.FloatTensor to torch.Tensor. This is because FloatTensor is essentially deprecated and all Tensor types are actually just Tensors now. FloatTensor was kept to be backwards compatible as noted here.
This allows type hints to not yell when a user uses the canonical Tensor type
Fixes #7535
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.