< Previous post | Next post >

[2026-01-20][Daily]

Trying asynchronous data loaders and hyper-threading

Trying to see if bad perf on pytorch was due to dataloading: we use 4 data loader, 28 threads. Indeed, using async loading with 4 workers already improves a lot performances. yet it stays worse than using more threads.

Pytorch intraop vs DAHL on datasets with growing images.

Concerning why previous experiments had better results with 56 threads instead of 28 == numcpu, I think the explanation comes from the fact that my CPU has 2 thread per core:

andrew@rammus ~/d/n/e/workload (main) [nix]  [127]> lscpu
Architecture:                x86_64
  CPU op-mode(s):            32-bit, 64-bit
  Address sizes:             46 bits physical, 48 bits virtual
  Byte Order:                Little Endian
CPU(s):                      28
  On-line CPU(s) list:       0-27
Vendor ID:                   GenuineIntel
  Model name:                Intel(R) Core(TM) i7-14700K
    CPU family:              6
    Model:                   183
    Thread(s) per core:      2
    Core(s) per socket:      20
    Socket(s):               1
    Stepping:                1
    CPU(s) scaling MHz:      18%
    CPU max MHz:             5600.0000
    CPU min MHz:             800.0000

So using 56 (28*2) threads and obtaining better performances actually makes sense, I guess? But it seems to increase context switches by a lot.

< Previous post | Next post >