Maratyszcza / NNPACK

Acceleration package for neural networks on multi-core CPUs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SIGFPE when using the nosmt linux kernel parameter

jbd opened this issue · comments

Hello,

I tracked down a SIGFPE around line src/convolution-inference.c:526 here because input_channels_block_max was equal to 0:

521		const size_t output_channels_subblock_max = (fourier_transform ? nnp_hwinfo.cxgemm.nr : nnp_hwinfo.sxgemm.nr);
522	
523		const size_t input_channels_block_max =
524			round_down(cache_elements_l1 / (tiles_subblock_max + output_channels_subblock_max), 2);
525		const size_t tiles_block_max =
526			round_down(cache_elements_l2 / input_channels_block_max, tiles_subblock_max);
527		const size_t output_channels_block_max =
528			round_down(cache_elements_l3 / input_channels_block_max, output_channels_subblock_max);
529	
530		const size_t transform_tile_size = tile_elements * 

The node was booted using the "nosmt" boot parameter, meaning HT cores were still here, but offline. If I remove this parameter, the code is running fine.

This example code gives different output whenever nosmt is on the cmdline or not:

$ cat ../test/nnpinfo/nnpinfo.cc 
#include <gtest/gtest.h>
#include <iostream>

#include <nnpack.h>
#include <nnpack/macros.h>
#include <nnpack/hwinfo.h>

int main(int argc, char* argv[]) {
	const enum nnp_status init_status = nnp_initialize();
	assert(init_status == nnp_status_success);
	std::cout << nnp_hwinfo.blocking.l1 << ' ' << nnp_hwinfo.blocking.l2 << ' ' << nnp_hwinfo.blocking.l3 << std::endl;
}

With nosmt on the linux kernel cmdline:

$ ./nnpinfo-test 
337 5067 16777216

Without nosmt:

$ ./nnpinfo-test 
16384 245760 16777216

lscpu without nosmt on the linux kernel cmdline:

Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              192
On-line CPU(s) list: 0-191
Thread(s) per core:  2
Core(s) per socket:  48
Socket(s):           2
NUMA node(s):        2
Vendor ID:           AuthenticAMD
BIOS Vendor ID:      Advanced Micro Devices, Inc.
CPU family:          23
Model:               49
Model name:          AMD EPYC 7552 48-Core Processor
BIOS Model name:     AMD EPYC 7552 48-Core Processor                
Stepping:            0
CPU MHz:             2200.000
CPU max MHz:         2200.0000
CPU min MHz:         1500.0000
BogoMIPS:            4400.15
Virtualization:      AMD-V
L1d cache:           32K
L1i cache:           32K
L2 cache:            512K
L3 cache:            16384K
NUMA node0 CPU(s):   0-47,96-143
NUMA node1 CPU(s):   48-95,144-191
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr 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_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd amd_ppin arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip rdpid overflow_recov succor smca sme sev sev_es

lscpu with nosmt on the linux kernel cmdline:

Architecture:         x86_64
CPU op-mode(s):       32-bit, 64-bit
Byte Order:           Little Endian
CPU(s):               192
On-line CPU(s) list:  0-95
Off-line CPU(s) list: 96-191
Thread(s) per core:   1
Core(s) per socket:   48
Socket(s):            2
NUMA node(s):         2
Vendor ID:            AuthenticAMD
BIOS Vendor ID:       Advanced Micro Devices, Inc.
CPU family:           23
Model:                49
Model name:           AMD EPYC 7552 48-Core Processor
BIOS Model name:      AMD EPYC 7552 48-Core Processor                
Stepping:             0
CPU MHz:              2851.220
CPU max MHz:          2200.0000
CPU min MHz:          1500.0000
BogoMIPS:             4400.33
Virtualization:       AMD-V
L1d cache:            32K
L1i cache:            32K
L2 cache:             512K
L3 cache:             16384K
NUMA node0 CPU(s):    0-47
NUMA node1 CPU(s):    48-95
Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr 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_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd amd_ppin arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip rdpid overflow_recov succor smca sme sev sev_es

The difference is are on the On-line/Off-line CPU(s) lists.

I hope it's enough information to understand the problem. I didn't look enough to see if it is at the nnpinfo or cpuinfo level, sorry.

Thank you !

I've reported it upstream: pytorch/cpuinfo#238