ancient-wolf-19325
07/22/2024, 10:31 PMIgnoreOutputs exception for all workers except the one you want to propagate the error from.
According to Flyte discussion, you can achieve this by checking the rank of the worker and raising an IgnoreOutputs exception for all workers except the rank 0 worker. Here is an example of how you can implement this:
import os
from flytekit import task
from flytekit.exceptions import IgnoreOutputs
@task
def pytorch_task():
if os.environ.get("RANK") != "0":
raise IgnoreOutputs("Ignoring outputs from non-rank 0 workers")
# Your training logic here
This ensures that only the rank 0 worker's output (or error) is propagated to the subsequent tasks in the Flyte workflow.
Would you like more detailed guidance on implementing this in your Flyte setup?
Sources:
- Flyte discussion
Slack Link
https://flyte-org.slack.com/archives/CP2HDHKE1/p1721687448.769399 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.