Design reliable ML pipeline orchestration
Design ML pipelines with explicit dependencies, resource placement, safe caching, bounded retries, and complete evaluation evidence in Polyaxon.
ML pipeline orchestration coordinates dependencies, execution resources, and failure handling across a model workflow. A useful pipeline definition explains when a step may start, which inputs it consumes, and what counts as a complete result.
For example, a document classifier might require one preprocessing run, several training candidates, a shared evaluation, and a review before registration. Running every step in one GPU container is easy to begin with, but it ties together unrelated resource needs and makes recovery expensive. Separating those steps is useful when their inputs, outputs, and recovery rules are clear.
Define the boundary of each step
Choose boundaries around outputs that can be validated and reused. A preparation step should publish a dataset manifest only after its expected files are complete. A training step should identify its checkpoint and configuration. An evaluation step should produce a report that names every candidate and test case it actually processed.
| Step | Required inputs | Completion evidence | Typical resource need |
|---|---|---|---|
| Prepare | Source snapshot and transformation version | Validated dataset manifest | CPU, memory, storage throughput |
| Train | Prepared data, code, parameters | Checkpoint and training record | GPU plus CPU and memory |
| Evaluate | Candidate artifacts and frozen test set | Per-case results and aggregate report | Depends on local or remote inference |
| Review | Complete evaluation and release criteria | Recorded decision | Often lightweight processing and human review |
Resource needs depend on the implementation. Evaluation against a remote model endpoint may need no local GPU; evaluation that loads a model locally may need substantial accelerator capacity.
Polyaxon's DAG runtime expresses dependencies, conditions, and parallel work. Pass explicit upstream outputs into downstream operations so the graph records what was consumed, rather than having every step read an independently changing latest path.
Separate concurrency from capacity
A workflow concurrency limit bounds how many operations it can dispatch together. It does not prove that the destination cluster has enough GPUs, memory, or storage bandwidth to run them.
Set concurrency using the scarcest shared dependency. If each evaluation worker calls the same rate-limited endpoint, adding workers can increase retries without increasing completed evaluations. If training jobs repeatedly download the same model, network or storage throughput may become the limiting resource before GPU capacity does.
Where configured in Polyaxon Cloud or Enterprise, queues provide routing, priorities, concurrency, and quota controls. These admission policies work alongside Kubernetes placement. A dispatched job can still wait because its resource requests or node constraints cannot be satisfied. Use the Pending GPU job guide to identify the stage that is waiting.
Treat a cache hit as an evidence claim
A cached result says that a previous execution is suitable for the current request. That claim is safe only if the inputs used for cache matching represent everything that can affect the result.
Include dataset revisions, transformation code, relevant parameters, and the execution environment. A filename that points to different bytes tomorrow is not a sufficient data identity. A time-to-live can limit reuse, but it cannot make an incomplete identity correct.
Polyaxon exposes cache controls for workflow operations. Disable reuse when you intentionally want an independent stochastic repetition or when a step depends on external state that is not captured in its inputs. Review cache behavior when changing component boundaries; a faster run is not useful if it silently evaluates stale data.
Retry the operation without duplicating its effects
Distinguish transient infrastructure failures from deterministic application errors. A temporary storage outage may justify a retry. A malformed dataset or incompatible checkpoint usually needs a correction first.
Polyaxon's termination settings can bound retries and execution time. For example, this policy fragment allows at most two retries and sets a one-hour timeout:
termination:
maxRetries: 2
timeout: 3600Add the fragment to a component or operation whose runtime supports the intended behavior. It does not implement checkpoint recovery inside your training code. Test whether a replacement process actually finds and restores its checkpoint, including optimizer and scheduler state where needed.
Write intermediate outputs to an attempt-specific location and publish a completion manifest only after validation. For side effects such as registration or notifications, use a stable operation identity and check whether the effect has already occurred. A retry should not register a second model under a different name merely because the response to the first request was lost.
Make partial failure visible in model selection
Suppose two of five candidates fail during evaluation. Selecting the best of the remaining three is a different decision from selecting the best of all five. The report should state which comparison was possible and why the other candidates were excluded.
Define the intended policy before execution: fail the workflow, continue with a clearly incomplete report, or accept a specified subset. Keep an aggregation step that must inspect failures separate from a release step that requires successful checks. An unconditional completion trigger is useful for collecting evidence, but it should not imply approval.
Measure the time until a result is usable
Record queue wait, startup, data preparation, computation, recovery, and evaluation separately. This shows whether the next improvement should be a smaller image, a data cache, a scheduling change, or faster model code.
Test the pipeline by interrupting one training run, invalidating one input, and rerunning one completed step. Verify its recovery, cache decision, and final report. The pipelines and automation learning path provides the Polyaxon building blocks for putting those policies into practice.