Repository navigation
Data worker: prepare requests on a pool #1109
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
Changes from all commits
83df73a
645a0a6
800dedf
2b8047b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,6 +153,18 @@ def preprocess_threads(self) -> int: | |
| MB.""" | ||
| return max(1, min(4, self.left // 4)) | ||
|
|
||
| def prepare_workers(self, threads: int) -> int: | ||
| """Requests the data worker prepares at once, for a model that | ||
| declares ``PREPROCESS_PARALLEL``, when each runs on ``threads`` | ||
| intra-op threads: at most 8, and the pool times the threads stays | ||
| within the CPUs left.""" | ||
| return max(1, min(8, self.left // max(1, threads))) | ||
|
|
||
| @property | ||
| def preprocess_workers(self) -> int: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Sized from the default thread count, so a config with a higher
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done: |
||
| """``prepare_workers`` at the default thread count.""" | ||
| return self.prepare_workers(self.preprocess_threads) | ||
|
|
||
| @property | ||
| def png_threads(self) -> int: | ||
| """Threads one PNG deflates on (``image_io.uint8_to_png``).""" | ||
|
|
||
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.
nit:
preprocess_workers:, should we also mention it in serving.rst table next totp_async_sched?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.
Added a
preprocess_workersrow undertp_async_sched, with a pointer topreprocess_torch_threadsand adding_models.rst.