AGENT SKILL

compiler-and-cli

Compile Kubeflow Pipelines Python DSL pipelines or components to PipelineSpec YAML or Kubernetes manifests using the public Compiler API and CLI.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
compiler-and-cli
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Compile Kubeflow Pipelines Python DSL pipelines or components to PipelineSpec YAML or Kubernetes manifests using the public Compiler API and CLI.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Kubeflow Pipelines compiler and CLI

Use this sub-skill when the user already has a KFP Python pipeline/component and needs to compile it, diagnose compilation, or understand the compile-related CLI surface.

Own this scope

  • Compile @dsl.pipeline, @dsl.component, or @dsl.container_component objects to PipelineSpec YAML with kfp.compiler.Compiler().compile.
  • Compile a Python file with kfp dsl compile; explain the legacy dsl-compile alias.
  • Choose an entry point with --function when a file has more than one pipeline/component.
  • Pass input overrides with pipeline_parameters / --pipeline-parameters, toggle type checking, and request Kubernetes native Pipeline/PipelineVersion manifests.
  • Explain kfp component build help, prerequisites, generated files, and Docker side effects at a high level.

Route away

  • Authoring or restructuring the DSL pipeline/component itself -> pipeline-authoring.
  • Uploading packages, creating runs, registry operations, or client-backed CLI commands -> client-and-registry.
  • Kubernetes task helper APIs such as secrets, PVCs, tolerations, pod labels, or platform configs -> kubernetes-platform.
  • Repo maintenance, generated-code refresh, SDK test/generation commands -> repo-development.

Fast operating procedure

  1. Confirm the input is an existing .py file or an in-process decorated pipeline/component object. If the user needs code written first, route to pipeline-authoring.

  2. For a file compile, prefer the bundled wrapper because it uses only the installed KFP package and validates JSON before invoking the public CLI/API:

    python skills/disco/kubeflow-pipelines/sub-skills/compiler-and-cli/scripts/compile_pipeline_file.py \
      --py path/to/pipeline.py \
      --output pipeline.yaml \
      --function pipeline_func \
      --pipeline-parameters '{"text":"Hello KFP!"}'
    
  3. Equivalent direct CLI:

    kfp dsl compile --py path/to/pipeline.py --output pipeline.yaml \
      --function pipeline_func --pipeline-parameters '{"text":"Hello KFP!"}'
    
  4. Equivalent in-process API:

    from kfp import compiler
    
    compiler.Compiler().compile(
        pipeline_func=my_pipeline,
        package_path="pipeline.yaml",
        pipeline_parameters={"text": "Hello KFP!"},
        type_check=True,
    )
    
  5. For Kubernetes native manifests, include the format flag. Naming and namespace flags are ignored by the CLI unless this flag is present:

    kfp dsl compile --py path/to/pipeline.py --output pipeline-version.yaml \
      --function pipeline_func \
      --kubernetes-manifest-format \
      --pipeline-name my-pipeline \
      --pipeline-display-name "My Pipeline" \
      --pipeline-version-name my-pipeline-v1 \
      --pipeline-version-display-name "My Pipeline v1" \
      --namespace kubeflow \
      --include-pipeline-manifest
    

Decision rules

  • Use the CLI/wrapper for a Python file; use Compiler().compile when the pipeline/component object is already imported in Python.
  • --pipeline-parameters must be a JSON object whose keys match pipeline/component inputs. Invalid JSON fails before compile; unknown inputs fail during PipelineSpec override.
  • Leave type checking enabled by default. Use --disable-type-check / type_check=False only when the user explicitly accepts weaker compile-time interface checks.
  • A normal compile writes PipelineSpec YAML (pipelineInfo, root, components, deploymentSpec). Kubernetes manifest format writes Kubernetes PipelineVersion and, with --include-pipeline-manifest, also Pipeline documents.
  • dsl-compile is still installed as a deprecated console script; prefer kfp dsl compile in new commands.
  • kfp component build can generate component metadata, Dockerfile, requirements, config, and optionally build/push images. Treat it as mutating and Docker-dependent; do not run it unless the user asks and prerequisites are present.

Verification checks

  • Check the output file exists and ends in .yaml/.yml for supported YAML compilation.
  • For PipelineSpec YAML, parse YAML and look for pipelineInfo plus root; platform-specific configs may appear as an additional YAML document.
  • For Kubernetes manifest output, parse all YAML documents and look for kind: PipelineVersion; if --include-pipeline-manifest was used, also expect kind: Pipeline.
  • Compilation itself does not contact a KFP service or Kubernetes cluster. If the next step is upload/run, route to client-and-registry.

References

  • references/api-reference.md — Compiler.compile, KubernetesManifestOptions, output behavior, API examples.
  • references/cli-reference.md — kfp dsl compile, dsl-compile, manifest flags, kfp component build surface.
  • references/troubleshooting.md — entry-point selection, JSON, type checks, manifest flag confusion, deprecated alias, Docker build prerequisites.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351