Skip to main content
Version: v0.2.1

sflow Agent Guidelines

Skill & Doc References

Utility Scripts

ScriptPurposeUsage
validate_sflow_yaml.pyStatic validation of YAML configspython scripts/validate_sflow_yaml.py <file>
check_gpu_plan.pyGPU allocation plan & oversubscription checkpython scripts/check_gpu_plan.py <file> [<file>...]
parse_sflow_errors.pyCategorize errors from logspython scripts/parse_sflow_errors.py <log>
summarize_run.pySummarize task status from output dirpython scripts/summarize_run.py <output_dir>/<run_id>/

Workflow

Step 1: Gather Cluster Information

Before writing any config, ask the user for:

  • SLURM account, partition, GPUs per node, GPU type (H100/GB200/GB300)
  • Container image, model path on cluster
  • Extra sbatch/srun args (--exclusive, --segment, etc.)

Do not assume defaults for these values.

Step 2: Write a Minimal Plain-Text Config

Start hardcoded, no variables. Validate the recipe before adding abstraction.

Step 3: Validate

python scripts/validate_sflow_yaml.py config.yaml
python scripts/check_gpu_plan.py config.yaml
sflow run -f config.yaml --dry-run

Fix errors before proceeding. Use the error analysis skill to diagnose.

Step 4: Run and Debug

sflow run -f config.yaml --tui

If tasks fail, check <output_dir>/<run_id>/<task>/<task>.log. Use:

python scripts/summarize_run.py <output_dir>/<run_id>/
python scripts/parse_sflow_errors.py <output_dir>/<run_id>/sflow.log

Step 5: Extract Variables

Once working, extract changeable values into variables. Re-run --dry-run.

Step 6: Modularize

Ask about variance needs. Split into modular files if needed:

  • slurm_config.yaml, common_workflow.yaml, <framework>/*.yaml, benchmark.yaml
  • Use sflow compose or sflow run -f with --missable-tasks

Rules

  • Use file:// artifacts with content for helper scripts (never heredocs/python3 -c)
  • Use container_name + --container-image in extra_args for container reuse
  • Add probes.failure.log_watch for "Traceback (most recent call last)" on server tasks
  • Add probes.readiness on long-running server tasks
  • Run validation and --dry-run before every actual run