Skip to content

[Flytekit-7005] Adding ray autoscaler options#3413

Open
0yukali0 wants to merge 17 commits intoflyteorg:masterfrom
0yukali0:flyte-7005
Open

[Flytekit-7005] Adding ray autoscaler options#3413
0yukali0 wants to merge 17 commits intoflyteorg:masterfrom
0yukali0:flyte-7005

Conversation

@0yukali0
Copy link
Copy Markdown

@0yukali0 0yukali0 commented Mar 30, 2026

Tracking issue

Ralated 7005

Why are the changes needed?

Ray plugin in Flytekit does not support ray autoscaler option when enable_autoscaling is settable.

What changes were proposed in this pull request?

  1. Create autoscaler option dataclass
  2. Add that to ray cluster message which sent to backend.

How was this patch tested?

Setup process

clone flyte and flytekit (branch flyte-7005 and flytekit-7005)
run the flyte backend in sandbox
2.1 flytectl demo start --dev
2.2 make compile && POD_NAMESPACE=flyte ./flyte start --config flyte-single-binary-local.yaml
Update ray example like Ray example
3.1 uv venv -p 3.11 && source .venv/bin/activate && uv pip install -e ~/flytekit ~/flytekit/plugins/flytekit-ray && uv pip install -e ~/flyte/flyteidl
3.2 "pyflyte run --remote ray_example.py ray_workflow --n 10"

Screenshots

image image

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

@0yukali0 0yukali0 changed the title [flyte-7005] Adding ray autoscaler options [Flyte-7005] Adding ray autoscaler options Mar 30, 2026
@0yukali0 0yukali0 changed the title [Flyte-7005] Adding ray autoscaler options [Flytekit-7005] Adding ray autoscaler options Mar 30, 2026
@0yukali0 0yukali0 marked this pull request as ready for review March 31, 2026 14:44
@0yukali0 0yukali0 force-pushed the flyte-7005 branch 2 times, most recently from d7abd43 to 3fb001d Compare April 6, 2026 06:22
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.58%. Comparing base (39d4a9f) to head (1bd6f3e).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3413      +/-   ##
==========================================
- Coverage   84.05%   83.58%   -0.47%     
==========================================
  Files         327        3     -324     
  Lines       27885      195   -27690     
  Branches     3016        0    -3016     
==========================================
- Hits        23438      163   -23275     
+ Misses       3567       32    -3535     
+ Partials      880        0     -880     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

0yukali0 added 14 commits April 18, 2026 09:46
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Comment thread flytekit/core/artifact.py Outdated
Comment thread flytekit/core/workflow.py Outdated
self.compiled = False

@property
def name(self) -> str: # type: ignore[override]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need type: ignore here?

Copy link
Copy Markdown
Author

@0yukali0 0yukali0 Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @machichima
I added this when linting indicates the problems.
Currently, should i update code to follow the lint rules in flytekit?
image

Comment on lines +192 to +194
upscaling_mode=_ray_pb2.AutoscalerOptions.UpscalingMode.Value(
"UPSCALING_MODE_" + self.upscaling_mode.upper()
)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we follow how we did for Resources enum without transforming to string. User can directly use enum value (e.g. AutoscalerOptions.UpscalingMode.DEFAULT)

class Resources(_common.FlyteIdlEntity):
class ResourceName(object):
UNKNOWN = _core_task.Resources.UNKNOWN
CPU = _core_task.Resources.CPU
GPU = _core_task.Resources.GPU
MEMORY = _core_task.Resources.MEMORY
EPHEMERAL_STORAGE = _core_task.Resources.EPHEMERAL_STORAGE

Same comment for from_flyte_idl

Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Signed-off-by: Yuteng Chen <a08h0283@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants