AGENT SKILL

cluster-lifecycle

Guide TensorFlowOnSpark cluster startup, reservation, shutdown, TensorBoard, TF_CONFIG, GPU/resource selection, and independent TFParallel.run jobs.

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

01 前言 Front Matter

name
cluster-lifecycle
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Guide TensorFlowOnSpark cluster startup, reservation, shutdown, TensorBoard, TF_CONFIG, GPU/resource selection, and independent TFParallel.run jobs.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

cluster-lifecycle

Use this route when the task is about starting or stopping a TensorFlowOnSpark cluster, reserving executors, debugging reservation waits, interpreting TF_CONFIG or TensorBoard setup, choosing GPUs or Spark resources, or running independent TFParallel.run jobs.

In scope

  • TFCluster.run(...) and the returned TFCluster object's train, inference, shutdown, and tensorboard_url methods.
  • TFSparkNode.TFNodeContext and the context methods used by map functions.
  • reservation.Server and reservation.Client, including the reservation handshake that coordinates executor startup.
  • TFParallel.run(...) for independent, one-process-per-executor jobs.
  • gpu_info.* and util.single_node_env(...) for GPU discovery, CUDA selection, and host/runtime setup.

Out of scope

  • Data-feed queue semantics, EndPartition, and batch/output handling.
  • Spark ML TFEstimator / TFModel workflows.
  • TFRecord/DataFrame conversion.
  • Long example migrations and example-to-example conversions.

Read first

  • API reference for signatures, object relationships, and internal flow.
  • Cluster workflows for startup, shutdown, TensorBoard, TF_CONFIG, GPU, and TFParallel.run recipes.
  • Troubleshooting for reservation waits, duplicate executor ids, Windows/background limits, Spark config, and GPU failures.

Use the bundled scripts

  • tfos_cluster_env_check.py to check Python/package, Spark/Java, GPU visibility, and background-mode prerequisites before cluster work.
  • request_streaming_stop.py to request a reservation-server stop for a streaming job; it is dry-run by default and only sends the control message when --execute is supplied.

Typical routing cues

  • “cluster hangs waiting for reservations”
  • “duplicate executor id”
  • “TensorBoard URL missing”
  • “TF_CONFIG not set”
  • “GPU allocation failed”
  • “background mode on Windows”
  • “spark.python.worker.reuse”
  • “run several independent TensorFlow jobs on Spark executors”

Common decisions

  1. Decide whether this is a shared TFCluster job or an independent TFParallel.run job.
  2. Decide the execution mode: InputMode.TENSORFLOW or InputMode.SPARK.
  3. Decide whether you need TensorBoard, driver_ps_nodes, master_node, eval_node, or release_port=False.
  4. If your map_fun starts its own TF gRPC server, reserve the port with release_port=False and call ctx.release_port() before binding the server.
  5. Decide whether the job should request GPUs, rely on Spark resource assignment, or fall back to CPU.
  6. If a streaming job must stop from the driver side, use the bundled stop helper rather than guessing the reservation protocol.

Validation signals

  • Reservation logs show every executor registered and TFCluster.run(...) returns a cluster object.
  • cluster.tensorboard_url() is non-None only when TensorBoard was enabled and a node advertised a port.
  • shutdown() completes without late exceptions and stops the reservation server.
  • TFParallel.run(...) returns after all executors complete, with no shared reservation state.

If the task is really about queue semantics, DataFeed batching, or model/dataframe pipelines, route it to the sibling workflow that owns those behaviors instead of expanding this one.

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