Skip to content
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

Add support for min_success_ratio for local map_task execution #1884

Conversation

chaohengstudent
Copy link
Contributor

@chaohengstudent chaohengstudent commented Oct 10, 2023

TL;DR

Implement min_success_ratio forlocalmap_task execution.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

Implement min_success_ratio at map_task._raw_execute by counting failed tasks.
It will exit once there are no chance to meet the min success tasks.
The output element of failed task will present as None.
(p.s. wonder if just showing the error with the one exceed max failed tasks is reasonable or not?)

Tracking Issue

Fixes flyteorg/flyte#4094

Follow-up issue

NA

@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

Attention: 36 lines in your changes are missing coverage. Please review.

Comparison is base (2aaae61) 49.57% compared to head (b07546c) 51.21%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1884      +/-   ##
==========================================
+ Coverage   49.57%   51.21%   +1.64%     
==========================================
  Files         251      268      +17     
  Lines       20123    20928     +805     
  Branches     3453     3458       +5     
==========================================
+ Hits         9976    10719     +743     
- Misses       9975    10037      +62     
  Partials      172      172              
Files Coverage Δ
flytekit/core/map_task.py 30.50% <10.52%> (-1.20%) ⬇️
flytekit/core/array_node_map_task.py 32.79% <9.52%> (-1.71%) ⬇️

... and 18 files with indirect coverage changes

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

…-execution

# Conflicts:
#	flytekit/core/array_node_map_task.py
#	flytekit/core/map_task.py
#	tests/flytekit/unit/core/test_array_node_map_task.py
#	tests/flytekit/unit/core/test_map_task.py
Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

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

LGTM, one nit

flytekit/core/map_task.py Show resolved Hide resolved
Signed-off-by: Chao-Heng Lee <[email protected]>
Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

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

could you merge master into this branch? it will fix the failing tests

…_ratio-for-local-execution

Signed-off-by: Eduardo Apolinario <[email protected]>
@eapolinario eapolinario merged commit 8491f70 into flyteorg:master Oct 30, 2023
69 of 70 checks passed
ringohoffman pushed a commit to ringohoffman/flytekit that referenced this pull request Nov 24, 2023
…org#1884)

* Add min_success_ratio logic in map_task._raw_execute. Add test.

Signed-off-by: Chao-Heng Lee <[email protected]>

* also update array_node_map_task.

Signed-off-by: Chao-Heng Lee <[email protected]>

* add log with error.

Signed-off-by: Chao-Heng Lee <[email protected]>

---------

Signed-off-by: Chao-Heng Lee <[email protected]>
Signed-off-by: Eduardo Apolinario <[email protected]>
Co-authored-by: Eduardo Apolinario <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Core feature] Add support for min_success_ratio for local map_task execution
4 participants