不同的结果numpy.linalg.lstsq公司在不同的处理器上

2024-04-28 16:23:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我被numpy.linalg.leastsq的行为搞糊涂了。 我生成了完全相同的输入数据,对其进行了pickle处理,并将其移动到两台不同的机器上,这两台机器使用不同的操作系统(ubuntu16.04对ubuntu18.04),不同的处理器(AMD对ubuntu16.04对Intel对ubuntu18.04),以及相同的numpy版本1.16.3。你知道吗

我的矩阵有无限个条件数,但是在英特尔计算机上我可以找到一个很好的解决方案(我事先知道,作为基准),而在AMD计算机上,解决方案有很大的不同。你知道吗

我相信这可能是由两种架构的不同OpenBLAS实现造成的。 知道如何使这两个方法返回相同的值吗? 是不是因为英特尔使用了一些优化的MKL实现?你知道吗

我的AMD处理器是一个Threadripper,具有以下cpuinfo

vendor_id   : AuthenticAMD
cpu family  : 23
model       : 1
model name  : AMD Ryzen Threadripper 1950X 16-Core Processor
stepping    : 1
microcode   : 0x8001129
cpu MHz     : 2200.000
cache size  : 512 KB
physical id : 0
siblings    : 32
core id     : 15
cpu cores   : 16
apicid      : 31
initial apicid  : 31
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
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 extd_apicid amd_dcm aperfmperf eagerfpu 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 skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_l2 mwaitx cpb hw_pstate ssbd vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 clzero arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic
bugs        : fxsave_leak sysret_ss_attrs spectre_v1 spectre_v2 spec_store_bypass
bogomips    : 6786.57
TLB size    : 2560 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm hwpstate eff_freq_ro 

而Intel one有以下cpuinfo

vendor_id   : GenuineIntel
cpu family  : 6
model       : 26
model name  : Intel(R) Core(TM) i7 CPU         950  @ 3.07GHz
stepping    : 5
microcode   : 0x1d
cpu MHz     : 1668.950
cache size  : 8192 KB
physical id : 0
siblings    : 8
core id     : 3
cpu cores   : 4
apicid      : 7
initial apicid  : 7
fpu     : yes
fpu_exception   : yes
cpuid level : 11
wp      : yes
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 rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid dtherm ida flush_l1d
bugs        : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips    : 6147.49
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

显然我更喜欢在AMD上运行,因为它是一个更快的CPU。你知道吗


Tags: idcachesizemodelcpuyeslmphysical