Recorded 2026-10-05. Migrating training from local Apple Silicon hardware to Modal NVIDIA L40S GPUs required revisiting precision and batching settings to utilize the higher compute capacity. According to NVIDIA’s specifications, the L40S provides up to approximately 362 TFLOP/s of BF16/FP16 tensor compute and 91.6 TFLOP/s of FP32 tensor compute, along with 48 GB of VRAM.
Earlier experiments ran locally on an Apple M5 Max with a 40-core GPU and 48 GB of unified memory. Publicly reported estimates place its peak FP32 compute performance at approximately 17 TFLOP/s. In our training workload, the M5 Max achieved a throughput of roughly 20 samples/s, corresponding to a batch size of 4 at approximately 5 steps/s, while total memory usage was around 20 GB.
To avoid underutilizing the L40S with the local settings, we evaluated BF16 mixed precision alongside larger batch sizes and higher frame limits per batch.
Run #1.1: FP32 baseline on Modal
This was our first training run on Modal. Although it was originally conducted as part of Experiment #1 (“Test Training on Modal”), it is included here as a baseline for comparison with subsequent throughput-optimization runs.
Configuration
- GPU: NVIDIA L40S
- Precision: FP32
- Batch size: 4
- Maximum frames per batch: 2,400
During the run, average GPU utilization was approximately 37%, while VRAM usage remained at only around 3 GB.
These measurements showed substantial hardware underutilization, motivating higher batch sizes, higher maximum frames per batch, and BF16 mixed-precision training in subsequent runs.
Run #2.1: increase batch size
Configuration
- GPU: NVIDIA L40S
- Precision: BF16
- Batch size: 32
- Maximum frames per batch: 2,400 (Unchanged from Run #1.1)
In this run, we increased the batch size to 32. Because maximum frames per batch remained at 2,400, throughput stayed almost the same as Run #1.1.
Run #2.2: increase batch size and maximum frames per batch
Configuration
- GPU: NVIDIA L40S
- Precision: BF16
- Batch size: 32
- Maximum frames per batch: 19,200
In this run, we kept the batch size at 32 and increased the maximum frames per batch to 19,200. Average GPU utilization rose to approximately 50%, and VRAM usage reached 12.7 GiB.
The higher utilization and memory usage confirmed that increasing maximum frames per batch improved GPU utilization while leaving additional memory headroom for larger batches.
Runs #2.3–2.5
These runs tested different combinations of batch size and maximum frames per batch. The sweep settled on the configuration below for cloud L40S runs:
Configuration
- GPU: NVIDIA L40S
- Precision: BF16
- Batch size: 192
- Maximum frames per batch: 100,000
Final GPU utilization, VRAM, and throughput measurements for Runs #2.3–2.5 were not recorded in the original log.



