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
- 参考文档references/api-reference.md9.1 KB
- 参考文档references/cluster-workflows.md6.5 KB
- 参考文档references/troubleshooting.md6.4 KB
- 脚本scripts/request_streaming_stop.py3.8 KB
- 脚本scripts/tfos_cluster_env_check.py10.8 KB
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 returnedTFClusterobject'strain,inference,shutdown, andtensorboard_urlmethods.TFSparkNode.TFNodeContextand the context methods used by map functions.reservation.Serverandreservation.Client, including the reservation handshake that coordinates executor startup.TFParallel.run(...)for independent, one-process-per-executor jobs.gpu_info.*andutil.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/TFModelworkflows. - 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.runrecipes. - 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
--executeis 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
- Decide whether this is a shared
TFClusterjob or an independentTFParallel.runjob. - Decide the execution mode:
InputMode.TENSORFLOWorInputMode.SPARK. - Decide whether you need TensorBoard,
driver_ps_nodes,master_node,eval_node, orrelease_port=False. - If your
map_funstarts its own TF gRPC server, reserve the port withrelease_port=Falseand callctx.release_port()before binding the server. - Decide whether the job should request GPUs, rely on Spark resource assignment, or fall back to CPU.
- 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-Noneonly 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
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.
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.
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.
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.
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.
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).