scripts/launcher.py¶
launcher
¶
Command-line entry point: python scripts/launcher.py <mode> config.yaml.
Stage: launch. Builds LauncherConfig (model + data) from the YAML, sets up the Lightning Trainer, W&B logging and callbacks, then trains, evaluates, caches backbone outputs or exports the model (.pt2).
LauncherParams = namedtuple('LauncherParams', ['launcher_config', 'launcher_logger'])
module-attribute
¶
Modes = Literal['train', 'evaluate', 'cache', 'compile']
module-attribute
¶
args = _parse_args()
module-attribute
¶
launcher(mode, config, experiment_dir=None)
¶
Run one mode (train/evaluate/cache/compile) end to end from a YAML config.
Builds config, callbacks and Trainer (GPU fp16 or CPU fp32, DDP), then dispatches. Note: training_examples_per_eval must be a multiple of the global batch size.
Source code in scripts/launcher.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
run_training(trainer, launcher_config)
¶
Fit on train/val, reload the best checkpoint, then test it on the test split.
Source code in scripts/launcher.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |
run_evaluation(trainer, launcher_config)
¶
Test a trained checkpoint (model_params.ckpt_path) on the test split.
Source code in scripts/launcher.py
141 142 143 144 145 146 147 148 149 150 151 152 | |
run_caching(trainer, launcher_config, launcher_logger)
¶
Run the backbone over train/val/test and store its outputs in W&B (cache mode).
Requires GPUs and no backbone_cache in data_params; a dummy predict() starts DDP.
Source code in scripts/launcher.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | |
run_compilation(launcher_config)
¶
Export the model with torch.export on one test window, check outputs, log .pt2 to W&B.
Note: uses only the audio feature; needs an active wandb.run.
Source code in scripts/launcher.py
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | |
setup_multi_node_environment()
¶
Wait for all Kubernetes job pods, then set MASTER_ADDR/PORT, WORLD_SIZE, NODE_RANK.
Source code in scripts/launcher.py
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | |