-
Notifications
You must be signed in to change notification settings - Fork 147
(torchx-fb/named_resources) semi-automate registration of fractional resources for gpu types #1121
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
|
@kiukchung has exported this pull request. If you are a Meta employee, you can view the originating diff in D82594325. |
eef90a2 to
fa4c3da
Compare
|
@kiukchung has exported this pull request. If you are a Meta employee, you can view the originating diff in D82594325. |
…togenerate aliases and fractionals, migrate zion_4s_80g to use it. (#1121) Summary: Context: D82556202 ``` named_resource(aliases=["zion4s_80g"], fractionals=powers_of_two_gpus) def zion_4s_80g(fractional: float = 1.0) -> Resource: ... ``` Registers the named resources: 1. `zion_4s_80g` and the alias `zion4s_80g` 1. `zion_4s_80g_1 == zion_4s_80g(fractional=EIGHTH)` 1. `zion_4s_80g_2 == zion_4s_80g(fractional=QUARTER)` 1. `zion_4s_80g_4 == zion_4s_80g(fractional=HALF)` 1. `zion_4s_80g_8 == zion_4s_80g(fractional=WHOLE)` so that we don't have to manually do this. The auto-generated fractionals will return `True` when: ``` from torchx.specs.fb.resource import is_fractional from torchx.specs import get_named_resource assert is_fractional(get_named_resource("zion_4s_80g_1")) == True assert is_fractional(get_named_resource("zion_4s_80g_2")) == True assert is_fractional(get_named_resource("zion_4s_80g_4")) == True assert is_fractional(get_named_resource("zion_4s_80g_8")) == True assert is_fractional(get_named_resource("zion_4s_80g")) == False ``` NOTE: each of the fractional types (including WHOLE) will have `resource.capabilities[IS_FRACTIONAL] == True` so that we can use it as a way to determine whether a resource originates from a fractional named resource. Reviewed By: ajauhri, highker Differential Revision: D82594325
fa4c3da to
b413425
Compare
|
@kiukchung has exported this pull request. If you are a Meta employee, you can view the originating diff in D82594325. |
…togenerate aliases and fractionals, migrate zion_4s_80g to use it. (#1121) Summary: Context: D82556202 ``` named_resource(aliases=["zion4s_80g"], fractionals=powers_of_two_gpus) def zion_4s_80g(fractional: float = 1.0) -> Resource: ... ``` Registers the named resources: 1. `zion_4s_80g` and the alias `zion4s_80g` 1. `zion_4s_80g_1 == zion_4s_80g(fractional=EIGHTH)` 1. `zion_4s_80g_2 == zion_4s_80g(fractional=QUARTER)` 1. `zion_4s_80g_4 == zion_4s_80g(fractional=HALF)` 1. `zion_4s_80g_8 == zion_4s_80g(fractional=WHOLE)` so that we don't have to manually do this. The auto-generated fractionals will return `True` when: ``` from torchx.specs.fb.resource import is_fractional from torchx.specs import get_named_resource assert is_fractional(get_named_resource("zion_4s_80g_1")) == True assert is_fractional(get_named_resource("zion_4s_80g_2")) == True assert is_fractional(get_named_resource("zion_4s_80g_4")) == True assert is_fractional(get_named_resource("zion_4s_80g_8")) == True assert is_fractional(get_named_resource("zion_4s_80g")) == False ``` NOTE: each of the fractional types (including WHOLE) will have `resource.capabilities[IS_FRACTIONAL] == True` so that we can use it as a way to determine whether a resource originates from a fractional named resource. Reviewed By: ajauhri, highker Differential Revision: D82594325
b413425 to
bbe1c23
Compare
|
@kiukchung has exported this pull request. If you are a Meta employee, you can view the originating diff in D82594325. |
Summary:
Context: D82556202
Creates:
def zion_4s_80g_1(): return zion_4s_80g(fractional=EIGHTH)zion_4s_80g_2(): return zion_4s_80g(fractional=QUARTER)zion_4s_80g_4(): return zion_4s_80g(fractional=HALF)zion_4s_80g_8(): return zion_4s_80g(fractional=WHOLE)so that we don't have to manually do this
NOTE: each of the fractional types (including WHOLE) will have
resource.capabilities[IS_FRACTIONAL] == Trueso that we can use it as a way to determine whether a resource originates from a fractional named resource.Reviewed By: ajauhri
Differential Revision: D82594325