AGENT SKILL

workflows

Compose and validate Earth2Studio deterministic and prognostic-plus-diagnostic inference workflows with coordinate-aware inputs, outputs, devices, checkpoints, and offline protocol checks.

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

01 前言 Front Matter

name
workflows
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Compose and validate Earth2Studio deterministic and prognostic-plus-diagnostic inference workflows with coordinate-aware inputs, outputs, devices, checkpoints, and offline protocol checks.
disable-model-invocation
true

02 资源文件 4

03 SKILL.md 正文

Earth2Studio workflows

Use this skill when a task needs a concrete Earth2Studio inference pipeline built from a prognostic model, a data source, an IO backend, and optionally a coordinate-compatible diagnostic model. It owns the deterministic and prognostic-plus-diagnostic paths exposed by earth2studio.run; it does not own ensemble orchestration, data-only retrieval, detailed backend selection, or remote serving.

Decide the path

  1. Clarify initialization times, forecast horizon, variables, spatial domain, output format, and CPU/GPU constraints. Use ISO-8601 strings, datetime, or np.datetime64 values for time.
  2. Select a prognostic class whose input_coords() can be supplied by the selected DataSource or ForecastSource. Inspect its output_coords() to learn the model step and output variables; do not assume all models use the same grid or lead time.
  3. Add a diagnostic only when a derived field is required. Its input_coords() must be mappable from each prognostic output, and its output_coords() determines the variables written by run.diagnostic.
  4. Select an IO object and initialize it outside the workflow. The run function mutates and returns the same IO object. See API reference for the narrow IO contract and supported public backend names.
  5. Calculate nsteps from the model's advertised lead-time increment. A run writes the initial state plus nsteps forecast steps, so the lead-time axis has nsteps + 1 entries.

Load components

For a packaged model, use the class's public loading pair; the package handle is lightweight, while load_model may access remote or cached assets:

from earth2studio.models.px import <PrognosticClass>

prognostic = <PrognosticClass>.load_model(
    <PrognosticClass>.load_default_package()
)

Use the analogous pair from earth2studio.models.dx for a diagnostic. Model classes can require targeted optional extras and model-specific hardware; do not recommend an extra until the chosen class's installation notes are known. A network-free smoke path uses Persistence, Identity, Random, and ZarrBackend; it checks protocol and coordinate behavior without model weights. See workflow recipes.

Run deterministic inference

Construct data and io, inspect prognostic.input_coords(), then call:

from earth2studio import run

result = run.deterministic(
    time=["2024-01-01T00:00:00"],
    nsteps=8,
    prognostic=prognostic,
    data=data,
    io=io,
    output_coords=output_coords,  # omit or use OrderedDict({}) for all output
    device=device,                # None selects CUDA when available, else CPU
    verbose=True,
    checkpoint=checkpoint,         # optional checkpoint manager/session
)

run.deterministic fetches the prognostic initial-condition variables and lead times, maps them to the model grid, iterates from the initial state, applies output_coords at each step, and calls io.write. It returns io, not a new result wrapper. Use a small nsteps and verbose=False for a smoke run.

Run diagnostic inference

Keep the same initial-condition and prognostic setup, load a diagnostic, and call run.diagnostic(time, nsteps, prognostic, diagnostic, data, io, ...). The workflow maps each prognostic step to diagnostic.input_coords(), invokes the diagnostic, then maps to output_coords before writing. Its output is the diagnostic result; it does not retain the prognostic fields in the output backend. If both are required, compose a custom workflow rather than assuming this built-in path stores both.

Coordinate and horizon checks

Before a live run:

  • Compare data variables with prognostic.input_coords()["variable"].
  • Read the model's lead_time increment and use an integer nsteps.
  • Preserve coordinate key order: keys describe tensor dimensions. Common keys are batch, time, lead_time, variable, lat, and lon.
  • Keep output_coords a subset of produced dimensions. Variable restrictions must name produced variables; spatial restrictions may select or nearest-map numeric 1-D coordinates. Empty arrays are used by model protocols for free dimensions; do not use empty output overrides unless the backend contract explicitly permits them.
  • For a diagnostic, check every required diagnostic dimension and variable can be mapped from the prognostic output. Exact grid handshakes may still be required by a model even where the workflow can numerically map coordinates.
  • Run the bundled offline checker before spending network or GPU resources: python path/to/check_workflow_config.py --config workflow.json.

See workflows for runnable CPU mock examples and troubleshooting for recovery by failure class.

Boundaries and omissions

This sub-skill intentionally omits run.ensemble and perturbation/batch-size orchestration, a catalog of IO backend options, custom model implementation, full data-source selection, serving clients, and model-weight download procedures. It names public interfaces and targeted-extra constraints but does not claim exhaustive model, data, or backend coverage. Use the sibling skill for deterministic forecast selection when the task is only model/data/horizon recommendation; use data-fetch or installation guidance for those concerns.

Handoff checks

Report the selected workflow, model/data/diagnostic classes, initialization times, nsteps and implied lead-time horizon, output coordinate restriction, device, IO backend, whether weights/data are downloaded, and the validation performed. Preserve unresolved coordinate, optional-extra, credential, and hardware limits instead of presenting a smoke test as a scientific forecast.

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