Skip to content

Commit ab7dae5

Browse files
committed
separate spawn_fetchers method
1 parent bda4798 commit ab7dae5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/forge/actors/generator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,14 @@ async def setup(self):
231231
log_stats=None,
232232
)
233233
self._start_processing()
234+
if self.prefetch_weights:
235+
self._spawn_fetchers()
236+
237+
def _spawn_fetchers(self):
238+
"""Spawn weight fetchers that prefetch weights from torchstore to shared memory."""
239+
# TODO: this assumes the generator is on the same host as the worker
240+
# and only works for single host generators. Figure out how to support
241+
# generators with workers spanned across multiple hosts.
234242
fetcher_procs = this_host().spawn_procs(
235243
per_host={"procs": self.n_fetcher_procs}
236244
)

0 commit comments

Comments
 (0)