acoustic-carpenter-78188
10/27/2023, 9:51 AMFlyteRecoverableException.
Torch's elastic_launch (which is used by flytekit's Elastic task type) always raises a ChildFailedError even if in the worker process e.g. a FlyteRecoverableException was raised.
This means that Flyte's retry mechanism cannot be used for user errors in elastic tasks.
Elastic tasks offer `torchrun`'s retry mechanism by specifying max_retries. However, this retry mechanism (which doesn't restart the pod but the worker processes within the pod) will retry all exceptions which is not always desireable.
This PR makes elastic tasks work with Flyte's retry mechanism by propagating FlyteRecoverableException up from the worker processes.
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
How did you fix the bug, make the feature etc. Link to any design docs etc
Tracking Issue
NA
Follow-up issue
NA
flyteorg/flytekit
✅ All checks have passed
30/30 successful checksacoustic-carpenter-78188
10/27/2023, 9:51 AMacoustic-carpenter-78188
10/28/2023, 8:33 PM