-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[AIR] Execute GPU inference in a separate stage in BatchPredictor #26616
Conversation
Signed-off-by: Eric Liang <[email protected]>
@@ -231,6 +253,9 @@ def predict_pipelined( | |||
max_scoring_workers: If set, specify the maximum number of scoring actors. | |||
num_cpus_per_worker: Number of CPUs to allocate per scoring worker. | |||
num_gpus_per_worker: Number of GPUs to allocate per scoring worker. | |||
separate_gpu_stage: If using GPUs, specifies whether to execute GPU |
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.
Is there a case when we would not want this enabled?
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.
If the preprocessor is very lightweight, then enabling this could hurt more than it helps, due to excess disk spilling (in non-pipelined mode).
Signed-off-by: Eric Liang <[email protected]>
Signed-off-by: Eric Liang <[email protected]>
Signed-off-by: Matthew Deng <[email protected]>
Signed-off-by: Matthew Deng <[email protected]>
Signed-off-by: Matthew Deng <[email protected]>
Signed-off-by: Matthew Deng <[email protected]>
Signed-off-by: Matthew Deng <[email protected]>
Signed-off-by: Matthew Deng <[email protected]>
Signed-off-by: Matthew Deng <[email protected]>
Signed-off-by: Matthew Deng <[email protected]>
Signed-off-by: Eric Liang <[email protected]>
Signed-off-by: Eric Liang <[email protected]>
if num_gpus_per_worker is None: | ||
num_gpus_per_worker = 0 | ||
if num_cpus_per_worker is None: | ||
if num_gpus_per_worker > 0: |
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.
should we be doing this across all of our library code 😅
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.
Yeah, it's probably a good idea.
if separate_gpu_stage and num_gpus_per_worker > 0: | ||
preprocessor = self.get_preprocessor() | ||
if preprocessor: | ||
override_prep = BatchMapper(lambda x: x) |
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.
doesnt seem like override_prep is being used anywhere?
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.
Oh, that's weird LINT didn't catch it.
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.
Oh it's actually a local variable from the previous PR.
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.
I think there might be a set_preprocessor
line missing to disable the preprocessor for the predictor.
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.
It's actually correct--- I modified the unit test. If you remove this line, the test will fail. Also added a clarifying comment.
Signed-off-by: Eric Liang <[email protected]>
Signed-off-by: Eric Liang <[email protected]>
Signed-off-by: Eric Liang <[email protected]>
Co-authored-by: matthewdeng <[email protected]>
Signed-off-by: Eric Liang <[email protected]>
…y-project#26616) Signed-off-by: Rohan138 <[email protected]>
…y-project#26616) Signed-off-by: Stefan van der Kleij <[email protected]>
Why are these changes needed?
This PR is stacked on #26600