has anyone thought about a resource model on flyte...
# flyte-support
g
has anyone thought about a resource model on flyte where instead of specifying resources via
requests
and
limits
, we can just specify an instance type for a task? maybe also a proportion to select like half of an instance for example
we currently do this via a class wrapper:
Copy code
@dataclass
class Resources(DataClassJSONMixin):
    name: str
    cpu: int
    mem: int
    gpu: Optional[int] = None
    ephemeral_storage: int = field(default=1000)
with some presets e.g.
Copy code
M5D_XLARGE: Resources = Resources(
    name="m5d.xlarge", cpu=3900, mem=14162, gpu=None, ephemeral_storage=1000
)
and the class implements
__truediv__
so can be divided
but then to use this, we have to do
@task(requests=DEFAULT.flyte_resource)
which is okay but it would be nicer if this was baked into flytekit to abstract out
requests
,
limits
and maybe even
pod_template
- then, we can specify some instance type resources to come with a node selector/toleration like flyte natively does for gpus
a
that's an interesting approach with some challenges of course, including how to manage the differences between instance types throughout cloud providers and how to maintain it up to date with the time. Feel free to start a discussion in the RFC Incubator so we can discuss it with other contributors
g
yeah definitely makes sense - I was thinking naively that Flyte could provide the interface like the
class Resources
and it could be up to users to define the list of instance types they want to support
a big motivation being to help ensure that users don't specify invalid resources that don't match the available instances in the cluster and to ensure their workloads don't schedule on unexpected instances
it might not be that huge of a change either - it could be optional to use the new resources class in the
@task
, and essentially will fill out the
requests
,
limits
and
pod_template
for the user
but of course there's
with_overrides
to think about
I'll definitely start a thread in the incubator!