pytorch/data

MPRS hangs if child processes get killed externally (e.g. from OOM reaper)

sehoffmann opened this issue ยท 3 comments

๐Ÿ› Describe the bug

If either a worker process or the feeder process of the MPRS get killed, the main process will just hang indefinitely and not throw an error. Such a situation might easily arise because the OOM reaper killed a child process and not the main process.

Initially arose from trying to troubleshoot #1169 .

Versions

(wb) โžœ  ~ python collect_env.py                                                                      
Collecting environment information...
PyTorch version: 2.1.0.dev20230427
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OS: CentOS Linux 7 (Core) (x86_64)
GCC version: (Anaconda gcc) 11.2.0
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.17

Python version: 3.10.9 (main, Jan 11 2023, 15:21:40) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-3.10.0-1160.76.1.el7.x86_64-x86_64-with-glibc2.17
Is CUDA available: True
CUDA runtime version: 12.1.105
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2080 Ti
Nvidia driver version: 515.65.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                72
On-line CPU(s) list:   0-71
Thread(s) per core:    2
Core(s) per socket:    18
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
Stepping:              7
CPU MHz:               3299.987
CPU max MHz:           3900.0000
CPU min MHz:           1000.0000
BogoMIPS:              5200.00
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              1024K
L3 cache:              25344K
NUMA node0 CPU(s):     0-17,36-53
NUMA node1 CPU(s):     18-35,54-71
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch epb cat_l3 cdp_l3 invpcid_single intel_ppin intel_pt ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke avx512_vnni md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.23.5
[pip3] torch==2.1.0.dev20230427
[pip3] torchaudio==2.1.0.dev20230427
[pip3] torchdata==0.7.0.dev20230427
[pip3] torchvision==0.16.0.dev20230427
[pip3] triton==2.1.0
[conda] blas                      1.0                         mkl    anaconda
[conda] cudatoolkit               11.8.0              h37601d7_11    conda-forge
[conda] libblas                   3.9.0            16_linux64_mkl    conda-forge
[conda] libcblas                  3.9.0            16_linux64_mkl    conda-forge
[conda] liblapack                 3.9.0            16_linux64_mkl    conda-forge
[conda] mkl                       2022.1.0           hc2b9512_224    anaconda
[conda] nomkl                     2.0                           0    anaconda
[conda] numpy                     1.23.5          py310h53a5b5f_0    conda-forge
[conda] pytorch                   2.1.0.dev20230427 py3.10_cuda11.8_cudnn8.7.0_0    pytorch-nightly
[conda] pytorch-cuda              11.8                 h7e8668a_5    pytorch-nightly
[conda] pytorch-mutex             1.0                        cuda    pytorch-nightly
[conda] torchaudio                2.1.0.dev20230427     py310_cu118    pytorch-nightly
[conda] torchdata                 0.7.0.dev20230427           py310    pytorch-nightly
[conda] torchtriton               2.1.0+7d1a95b046           py310    pytorch-nightly
[conda] torchvision               0.16.0.dev20230427     py310_cu118    pytorch-nightly

(wb) โžœ  ~ conda list | grep torchdata
torchdata                 0.7.0.dev20230427           py310    pytorch-nightly
ejguan commented

Similar Error handling mechanism should be introduced to MPRS from https://github.com/pytorch/pytorch/blob/main/torch/utils/data/_utils/signal_handling.py

Pls feel free to open a PR to patch it.

@ejguan I might have a look at this in the next weeks. What would be the appropriate place in torchdata to register these global signal handlers?

ejguan commented

A new file under dataloader2 directory and invoke it whenever MPRS is imported.