align-justifyPipeline Step Exclusion

This guide will walk you through implementing step exclusion in your AI pipelines to selectively disable specific steps or branches during execution. We'll explore how step exclusion can help you create flexible, configurable pipelines that can adapt to different scenarios without requiring separate pipeline definitions.

circle-info

This tutorial builds upon basic pipeline concepts. Ensure you understand sequential and parallel pipeline construction before implementing step exclusion patterns.

circle-exclamation
chevron-rightPrerequisiteshashtag

This example specifically requires:

  1. Completion of the Your First RAG Pipelinearrow-up-right tutorial - understanding of basic pipeline construction

  2. Completion of all setup steps listed on the Prerequisitesarrow-up-right page

You should be familiar with these concepts and components:

  1. Components in Your First RAG Pipeline prerequisitesarrow-up-right - Required foundation

Installation

# you can use a Conda environment
pip install --extra-index-url "https://oauth2accesstoken:$(gcloud auth print-access-token)@glsdk.gdplabs.id/gen-ai-internal/simple/" gllm-pipeline gllm-rag gllm-core gllm-generation gllm-inference gllm-retrieval gllm-misc gllm-datastore

Project Setup

1

Project Structure

Create your project structure for parallel pipeline implementation:

<your-project>/
├── modules/
│   └── [your actual components]
└── pipeline.py        # 👈 Pipeline with parallel steps

Understanding Step Exclusion

Step exclusion is a powerful feature that allows you to selectively disable specific steps or branches within your pipeline during execution. This is particularly useful for:

  • A/B Testing: Compare different processing paths without creating separate pipelines

  • Debugging: Temporarily disable problematic steps to isolate issues

  • Feature Flags: Enable/disable features dynamically based on configuration

  • Performance Optimization: Skip expensive operations when not needed

  • Conditional Processing: Adapt pipeline behavior based on runtime conditions

The exclusion system uses dot-notation paths to identify specific steps or branches:

  • Simple Steps: "step_name" - Excludes the entire step

  • Parallel Branches: "parallel_step.branch_name" - Excludes a specific parallel branch

  • Conditional Branches: "conditional_step.true" or "conditional_step.false" - Excludes a conditional branch

  • Nested Steps: "parent_step.child_step" - Excludes a child step within a composite step


Example

Basic Use

Let's start with a basic document processing pipeline:

Step Exclusion for Conditional Step

For conditional processing, you can exclude entire branches:

Step Exclusion for Complex Pipeline Structures

For complex pipeline structures, you can exclude deeply nested steps:

Dynamic Pipeline using Step Exclusion

You can dynamically manage exclusions based on runtime conditions:

Step Exclusion Lifecycle

You can manage exclusion state throughout the pipeline lifecycle:


Congratulations! You've successfully learned how to implement step exclusion in your AI pipelines. By strategically applying step exclusion, you can create flexible, configurable pipelines that adapt to different scenarios without requiring separate pipeline definitions. Your pipelines will now support dynamic behavior modification, better debugging capabilities, and improved maintainability through selective step execution.

Last updated