Optimize exposure autoencoder distributed training

This commit is contained in:
2026-07-09 15:44:21 +08:00
parent f7fb6b7718
commit 5a3122c965
3 changed files with 258 additions and 50 deletions

View File

@@ -73,3 +73,16 @@ compatible with the default gated `TimesNetExposureEncoder`, and the channel
normalization statistics needed when the encoder is attached to DeepHealth.
Multi-GPU pretraining follows the main trainer interface: add
`--data_parallel --gpu_ids 0,1,2,3`.
For efficient multi-GPU training, launch one process per GPU with DDP:
```bash
torchrun --standalone --nproc_per_node=4 train_exposure_autoencoder.py \
--exposure_cache_dir ukb_exposure_cache \
--batch_size 128
```
In DDP mode, `--batch_size` is the global batch size and must be divisible by
the number of processes.
Training-channel statistics are cached at
`<exposure_cache_dir>/train_channel_stats.npz`; use
`--recompute_channel_stats` only when a forced refresh is needed.