-
Notifications
You must be signed in to change notification settings - Fork 51
Allow passing a lamda to from_alloc to set env vars based on MonarchContext #622
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
Conversation
This pull request was exported from Phabricator. Differential Revision: D78602523 |
…ontext (pytorch-labs#622) Summary: The from_alloc method now takes an optional Callable At a high level: ``` def setup_defined_in_user_code(ctx: MonarchCtx) -> None """ user code logic which sets up env vars """ ... allocator = MastAllocator(my_job) alloc = allocator.allocate(spec) proc_mesh = await ProcMesh.from_alloc(alloc, setup_defined_in_user_code) // this will call the SetupActor behind the scenes which takes the setup_defined_in_user_code method user_code_actor = await proc_mesh.spawn(UserCodeActor) .... Differential Revision: D78602523
…ontext (pytorch-labs#622) Summary: The from_alloc method now takes an optional Callable At a high level: ``` def setup_defined_in_user_code(ctx: MonarchCtx) -> None """ user code logic which sets up env vars """ ... allocator = MastAllocator(my_job) alloc = allocator.allocate(spec) proc_mesh = await ProcMesh.from_alloc(alloc, setup_defined_in_user_code) // this will call the SetupActor behind the scenes which takes the setup_defined_in_user_code method user_code_actor = await proc_mesh.spawn(UserCodeActor) .... Differential Revision: D78602523
This pull request was exported from Phabricator. Differential Revision: D78602523 |
…ontext (pytorch-labs#622) Summary: The from_alloc method now takes an optional Callable At a high level: ``` def setup_defined_in_user_code(ctx: MonarchCtx) -> None """ user code logic which sets up env vars """ ... allocator = MastAllocator(my_job) alloc = allocator.allocate(spec) proc_mesh = await ProcMesh.from_alloc(alloc, setup_defined_in_user_code) // this will call the SetupActor behind the scenes which takes the setup_defined_in_user_code method user_code_actor = await proc_mesh.spawn(UserCodeActor) .... Differential Revision: D78602523
…ontext (pytorch-labs#622) Summary: The from_alloc method now takes an optional Callable At a high level: ``` def setup_defined_in_user_code(ctx: MonarchCtx) -> None """ user code logic which sets up env vars """ ... allocator = MastAllocator(my_job) alloc = allocator.allocate(spec) proc_mesh = await ProcMesh.from_alloc(alloc, setup_defined_in_user_code) // this will call the SetupActor behind the scenes which takes the setup_defined_in_user_code method user_code_actor = await proc_mesh.spawn(UserCodeActor) .... Differential Revision: D78602523
This pull request was exported from Phabricator. Differential Revision: D78602523 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D78602523 |
…ontext (pytorch-labs#622) Summary: Pull Request resolved: pytorch-labs#622 The from_alloc method now takes an optional Callable At a high level: ``` def setup_defined_in_user_code(ctx: MonarchCtx) -> None """ user code logic which sets up env vars """ ... allocator = MastAllocator(my_job) alloc = allocator.allocate(spec) proc_mesh = await ProcMesh.from_alloc(alloc, setup_defined_in_user_code) // this will call the SetupActor behind the scenes which takes the setup_defined_in_user_code method user_code_actor = await proc_mesh.spawn(UserCodeActor) .... Differential Revision: D78602523
…ontext (pytorch-labs#622) Summary: The from_alloc method now takes an optional Callable At a high level: ``` def setup_defined_in_user_code(ctx: MonarchCtx) -> None """ user code logic which sets up env vars """ ... allocator = MastAllocator(my_job) alloc = allocator.allocate(spec) proc_mesh = await ProcMesh.from_alloc(alloc, setup_defined_in_user_code) // this will call the SetupActor behind the scenes which takes the setup_defined_in_user_code method user_code_actor = await proc_mesh.spawn(UserCodeActor) .... Reviewed By: highker Differential Revision: D78602523
This pull request was exported from Phabricator. Differential Revision: D78602523 |
This pull request has been merged in ee55be1. |
Summary:
The from_alloc method now takes an optional Callable
At a high level: