Skip to content

Conversation

@thealmightygrant
Copy link
Contributor

What does this PR do?

This is a followup to 9848. The aim of this is to serve as a fix for several issues around concurrent, multithreaded usage of diffusers:

Fixes #3672, #5749, #9833, #7851, #4920, #2916

Before submitting

Who can review?

@yiyixuxu, anyone else that is interested

curl -X POST -H "Content-Type: application/json" --data '{"model": "something", "prompt": "a kitten in front of a fireplace"}' http://localhost:8000/v1/images/generations
```

### Upgrading Dependencies
Copy link
Member

Choose a reason for hiding this comment

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

Can we also add some notes on the multi-threaded nature of this example and show some GPU utilization numbers with and without threading?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I'll add that in the next commit.

Copy link
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.

Thanks so much for working on this example! I think it's definitely helpful.

But I would like to take opinions from @stevhliu and @yiyixuxu regarding the location of the example as well.

@HuggingFaceDocBuilderDev

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.

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Very nice example! I think this would make the most sense under Inference techniques. You can add this doc to the toctree with the title, "Create a server".

@thealmightygrant
Copy link
Contributor Author

I gave it my best shot at getting those docs in there. I think I did it correctly, but tbh, I am having trouble getting the docs up and running on my macbook 😅

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Thanks, left a few more comments. Your docs look great here :)

@Jaid844
Copy link

Jaid844 commented Nov 18, 2024

So just changing scheduler will do the thing, right? I am facing same issue where different clients cannot access the endpoint.
Any help would do the job :).

Copy link
Member

@stevhliu stevhliu left a comment

Choose a reason for hiding this comment

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

Thanks for adding this example use case! 🤗

@stevhliu stevhliu merged commit c3c94fe into huggingface:main Nov 18, 2024
8 checks passed
sayakpaul pushed a commit that referenced this pull request Dec 23, 2024
* Add server example.

* Minor updates to README.

* Add fixes after local testing.

* Apply suggestions from code review

Updates to README from code review

Co-authored-by: Steven Liu <[email protected]>

* More doc updates.

* Maybe this will work to build the docs correctly?

* Fix style issues.

* Fix toc.

* Minor reformatting.

* Move docs to proper loc.

* Fix missing tick.

* Apply suggestions from code review

Co-authored-by: Steven Liu <[email protected]>

* Sync docs changes back to README.

* Very minor update to docs to add space.

---------

Co-authored-by: Steven Liu <[email protected]>
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.

Concurrent Thread Failure in Image Inference: StableDiffusionPipeline

5 participants