[PerfFix] Avoid separate thread for MP executor shm spin (#28012)

Signed-off-by: Nick Hill <nhill@redhat.com>
This commit is contained in:
Nick Hill
2025-11-04 08:33:55 -08:00
committed by GitHub
parent 05cae69f0f
commit c9f66da8fd
9 changed files with 145 additions and 133 deletions
+4 -4
View File
@@ -141,19 +141,19 @@ class FutureWrapper(Future):
the result() call. If not only the first worker's output is returned.
"""
def __init__(self, refs, aggregator: KVOutputAggregator | None = None):
def __init__(self, ref_or_refs, aggregator: KVOutputAggregator | None = None):
super().__init__()
self.refs = refs
self.ref_or_refs = ref_or_refs
self.aggregator = aggregator
def result(self, timeout=None):
if timeout is not None:
raise NotImplementedError("timeout is not supported")
outputs = ray.get(self.ref_or_refs, timeout=timeout)
if self.aggregator is None:
return self.refs[0].get()
return outputs
outputs = [ref.get() for ref in self.refs]
return self.aggregator.aggregate(outputs, output_rank=0)