Closed imoneoi closed 2 years ago
Could you please provide your system info? For example, the number of CPU cores and the type of CPU: cat /proc/cpuinfo | grep model | uniq -c
.
I ran on DGX-A100 (256 cores) with >255 Atari envs and it works well.
AMD Ryzen Threadripper 3960X 24-Core Processor, with 128GB RAM, installed using pip install envpool
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Address sizes: 43 bits physical, 48 bits virtual
CPU(s): 48
On-line CPU(s) list: 0-47
Thread(s) per core: 2
Core(s) per socket: 24
Socket(s): 1
NUMA node(s): 1
Vendor ID: AuthenticAMD
CPU family: 23
Model: 49
Model name: AMD Ryzen Threadripper 3960X 24-Core Processor
Stepping: 0
Frequency boost: enabled
CPU MHz: 2200.000
CPU max MHz: 4568.1641
CPU min MHz: 2200.0000
BogoMIPS: 7600.29
Virtualization: AMD-V
L1d cache: 768 KiB
L1i cache: 768 KiB
L2 cache: 12 MiB
L3 cache: 128 MiB
NUMA node0 CPU(s): 0-47
Vulnerability Itlb multihit: Not affected
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2: Mitigation; Retpolines, IBPB conditional, STIBP conditional, RSB filling
Vulnerability Srbds: Not affected
Vulnerability Tsx async abort: Not affected
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fx
sr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl
nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1
sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legac
y abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core per
fctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibpb stibp vmmca
ll fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsave
opt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irp
erf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean fl
ushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl
umip rdpid overflow_recov succor smca sme sev sev_es
Run the code above using batch_size=255
python test_envpool.py
255
TPS 60889.970751004286
TPS 60038.54218780955
TPS 59991.044900352266
TPS 59110.94207866427
Run the code above using batch_size=256
python test_envpool.py
256
[1] 3556131 segmentation fault (core dumped) python test_envpool.py
Hi @imoneoi, could you please rerun the test with this wheel?
Thanks! It now works with >255 batch_size (tested with 1024 and 2560).
BTW, setting num_threads=0 seems to allocate 1024 threads with 1024 environments, resulting in ~10% fps drop due to context switching. I think default num_threads should be min(num_envs, cpu_count() - 1)?
But you can always set num_threads
manually.
Describe the bug
Segfault when batch size is larger than 255 on Atari environments
MuJoCo environment seems to work well.
To Reproduce
Steps to reproduce the behavior.
Expected behavior
Can run with large batch size, like 1024, 2048, etc.
System info
Describe the characteristic of your environment:
Additional context
Set batch size to 1024 works / segfaults randomly
Reason and Possible fixes
Checklist