Hi all, I've been reading the PR (<flyte#5996>) an...
# contribute
w
Hi all, I've been reading the PR (flyte#5996) and noticed something about the output behavior of subtasks within
map_task
that seems counterintuitive: Current behavior: • Each subtask returns a List containing exactly one element •
map_task
aggregates these single-element lists into a final List of multiple elements My expected behavior: • Each subtask should return its output directly (not wrapped in a List) •
map_task
would collect these individual outputs into the final List I'm trying to understand: 1. Why was array_node designed this way initially? 2. Would returning direct values from subtasks (instead of single-element lists) be a better design? I believe the current design may be why this PR (flyte#5996) needed a workaround solution. Would changing the subtask output behavior to return direct values instead of single-element lists be a better approach?
t
this is just a display issue?
or not
@high-accountant-32689 you confirmed right that the outputs of the underlying tasks are all scalars right? not lists
w
If that is only a display issue, I believe that the issue this Pull Request (#5996) addressed shouldn't exist. I am not familiar with the backend code here, so I need some time to verify that.
t
isn’t that only for offloaded literals? that’s not for all lists right?
w
but if the subtask's output spec is a scalar instead of a collection, the offloaded literals' type should be correct
t
but there are no offloaded literals right?
this is a simple map task, no offloading
w
if the subtask of map_task returns a large value, it will be offloaded
t
yeah but i thought you were testing just with small values
h
@witty-action-93503, thanks for the investigation. You uncovered a bug in how we handle offloading of literals in the case of map tasks. In https://github.com/flyteorg/flytekit/pull/2872 we get the literal type for outputs from the task interface, but since the interface in the case of map tasks is
Collection[OutputType]
, instead of
OutputType
, we end up setting
inferredType
in that case to the wrong type. I'll follow up on this today.
@witty-action-93503, again, thank you for the prodding, upon further inspection, we decided to fix the literal type of offloaded literals produced by map tasks as part of https://github.com/flyteorg/flytekit/pull/2872 and as a consequence, we reverted https://github.com/flyteorg/flyte/pull/5996 in https://github.com/flyteorg/flyte/pull/6045.
w
thank you for the follow-up!