model-training
Guides TransFuser imitation-model training, dataset and configuration validation, backbone and PointPillars selection, single-GPU or torchrun DDP launch, loss interpretation, and checkpoint recovery.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- model-training
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Guides TransFuser imitation-model training, dataset and configuration validation, backbone and PointPillars selection, single-GPU or torchrun DDP launch, loss interpretation, and checkpoint recovery.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/api-reference.md10.7 KB
- 参考文档references/data-format.md9.2 KB
- 参考文档references/training-workflow.md15.2 KB
- 参考文档references/troubleshooting.md12.9 KB
- 脚本scripts/inspect_checkpoint.py7.2 KB
- 脚本scripts/validate_training_setup.py17.3 KB
03 SKILL.md 正文
TransFuser Model Training
Use this sub-skill when a task involves training or resuming a TransFuser-family model, choosing a fusion backbone, validating training data, preparing a single-GPU or DDP command, interpreting losses and logs, or diagnosing a checkpoint.
Non-negotiable runtime boundary
- Training requires an NVIDIA CUDA runtime. The repository training path unconditionally selects a CUDA device; there is no CPU training substitute.
- Preserve the legacy package family unless deliberately porting and revalidating it: Python 3.7, PyTorch 1.12.1+cu113,
mmcv-full1.6.0,mmdet2.25.0,mmsegmentation0.25.0,mmcls0.25.0,torch-scatter2.1.0, andtimm0.6.7. This combination passed imports andpip checkwith CUDA visible on an NVIDIA A100 during skill construction. - Do not treat a successful CPU import,
pip check, or CLI parser run as proof that training works. Requiretorch.cuda.is_available(), a CUDA allocation, and matching compiled extensions. - Model construction can ask
timmfor pretrained image weights. Prepare an approved local cache or explicitly authorize network access before constructing a fresh model in a network-restricted environment.
Route the task
- Prepare a new or resumed run: read training-workflow.md. It contains every
train.pyflag/default, single-GPU andtorchrunrecipes, logging, losses, caching, debug behavior, and resume semantics. - Validate data or diagnose a shape/key failure: read data-format.md, then run validate_training_setup.py. The helper only inspects paths, metadata, environment variables, and optional imports; it never trains or downloads.
- Choose a backbone, architecture, config override, or PointPillars: read api-reference.md. It covers
GlobalConfig,CARLA_Data,LidarCenterNet, all four fusion backbones, tensor contracts, and the PointPillars path. - Resume, compare, or diagnose weights: first read the checkpoint section in training-workflow.md, then run inspect_checkpoint.py. Its default mode does not unpickle the checkpoint; only use
--unsafe-loadfor a trusted file. - Recover from a failure: read troubleshooting.md for missing paths, DDP rank variables, invalid backbones, checkpoint incompatibility, cache/debug failures, and missing OpenMMLab or
torch-scattercomponents.
Safe first pass
From any directory, validate the intended run before launching it:
python <this-sub-skill>/scripts/validate_training_setup.py \
--repo-root <transfuser-checkout> \
--dataset-root <dataset-root> \
--setting 02_05_withheld \
--backbone transFuser \
--parallel-training 0
Add --check-runtime only in the environment intended for training. It imports the compatibility stack and repository training modules and requires working CUDA, but it does not instantiate a model or start training.
Boundaries and handoffs
- Dataset acquisition, CARLA route/scenario generation, and 210-GB collection are owned by data-and-routes.
- Loading a trained model into
HybridAgent, handlingargs.txtat inference time, and CARLA control are owned by sensor-agent. - Longest6 execution and result parsing are owned by carla-evaluation.
- Full training, model-weight downloads, CARLA simulation, Docker builds, and cloud submission are intentionally not performed by bundled helpers.
Completion criteria
Before launching training, require all of the following:
- the dataset split selects at least one train route and, for
02_05_withheld, at least one withheld validation route; - required modality files and future labels exist for eligible samples;
- the exact backbone string and architecture choices are compatible;
- CUDA and compiled dependency probes pass;
- single-GPU runs set
--parallel_training 0, while DDP runs are launched bytorchrunwithRANK,LOCAL_RANK, andWORLD_SIZEpopulated; - resume runs have both
model_<epoch>.pthand the derivedoptimizer_<epoch>.pth, a deliberate--start_epoch, and matching architecture/config provenance; - the output resolves to
<logdir>/<id>and has sufficient storage for checkpoints, TensorBoard events, optional visualizations, and any disk cache.
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).