Skip to content

feat: Implement resource requirements for components #193

@toby-coleman

Description

@toby-coleman

Summary

Users would like to be able to specify custom resource requirements on Component objects. These can be passed to Ray when a RayProcess is used or a Tuner object is run.

Requirements:

  • Must be able to specify Resource requirements for cpu, gpu, memory, resources. These should be defined as a Pydantic class in plugboard_schemas.
  • Must be able to specify resources as a numerical value, or as a string (to be validated by Pydantic), e.g. 250m for 0.25 or 10Mi for 1024 * 1024 * 10. resources should be a dictionary of string key, numerical value pairs.
  • Must be able to convert these requirements to their Ray equivalents, see https://docs.ray.io/en/latest/ray-core/api/doc/ray.actor.ActorClass.options.html, i.e. cpu = "250m" gets converted to num_cpus=0.25.
  • Must be able to pass a Resource to a Component when instantiating it. This will require changes to the Component and its schema, so that we can specify resource requirements in YAML config.
  • The default requirement should be {"cpu": 0.001}, to be used if the user does not provide anything.
  • Resource requirements should be passed to the actor options in RayProcess.
  • They should be used in the resource placement group inside Tuner.

Example

No response

Alternatives

No response

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions