TECHNOLOGY

Kubeflow OneOf: selecting a branch output requires exhaustive mutually exclusive branches

In this article
THE QUICK TAKE

OneOf joins an exhaustive exclusive branch group; it does not rank arbitrary outputs or manufacture a value for an uncovered execution path.

A fallback path has no selected value

A pipeline chooses a model based on a quality threshold. The author defines a preferred-model branch but leaves the fallback case without an output, then expects downstream evaluation to receive a selected model for every run. The control-flow design has not established that a value exists on every intended path.

Write the selection contract first. The preferred candidate, fallback candidate and any explicit rejection outcome should be deliberate cases. A downstream component cannot infer a valid model from the absence of a branch result.

OneOf requires an associated exclusive group

The KFP control-flow guide describes OneOf over logically associated mutually exclusive branches and the requirement for an Else branch. It is a graph construct for gathering the output of the executed branch, not a function that chooses the largest metric from unrelated tasks.

Use a threshold comparison in the supported DSL and preserve the relationship between branches. Arbitrary Python control flow over unresolved pipeline outputs does not automatically express the intended runtime decision in a compiled pipeline.

Outputs need a consistent interface

The DSL reference documents OneOf and conditional constructs. The branch outputs must have compatible declared types under the documented constraints. A string rejection message and a model artifact are not interchangeable just because both can be displayed in a report.

Represent rejection deliberately, perhaps through a separately typed status contract and downstream policy. Do not disguise an ineligible model as a valid model output merely to satisfy the shape of a branch merge.

Artifact type is not full model equivalence

The artifact guide explains model artifact properties. Models from different branches can share an artifact type while requiring different preprocessing or tokenizers. The selected value should retain the implementation identity that downstream evaluation needs.

Use an artifact manifest for that relationship. A successful branch merge establishes dataflow availability, not the semantic compatibility of every model that the threshold policy might select.

Exercise every declared path

Run recognizable cases for the preferred and fallback branches and inspect the selected output identity. Check boundary behavior at the threshold according to the exact comparison used by the pipeline.

Then verify the benchmark task population used by the quality gate. Exhaustive graph branches make selection executable, while a meaningful threshold still depends on relevant evaluation evidence. Control-flow completeness and model suitability remain separate responsibilities.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles