Commit eef90a2
(torchx-fb/named_resources) semi-automate registration of fractional resources for gpu types
Summary:
Context: D82556202
```
register_fractionals
def zion_4s_80g(fractional: float = 1.0) -> Resource:
...
```
Creates:
1. `def zion_4s_80g_1(): return zion_4s_80g(fractional=EIGHTH)`
1. `zion_4s_80g_2(): return zion_4s_80g(fractional=QUARTER)`
1. `zion_4s_80g_4(): return zion_4s_80g(fractional=HALF)`
1. `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] == True` so that we can use it as a way to determine whether a resource originates from a fractional named resource.
Reviewed By: ajauhri
Differential Revision: D825943251 parent c534e45 commit eef90a2
2 files changed
+14
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | | - | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | | - | |
62 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| 77 | + | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| 98 | + | |
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| |||
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| 107 | + | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| |||
0 commit comments