mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   YAFU (https://www.mersenneforum.org/forumdisplay.php?f=96)
-   -   AVX-ECM (https://www.mersenneforum.org/showthread.php?t=25056)

bsquared 2020-01-02 14:52

[QUOTE=EdH;533996]I would have sworn my earlier sessions with Colab showed AVX512 for their Xeon CPUs when I checked. Now, none of my recent sessions have. The CPU type just says Xeon CPU @ 2.00GHz. It does give me a family, etc. for the CPU(s), but no name. Is there a way to find that via the command line?

If I can, I'll set up a Colab AVX-ECM example in my "How I . . ." series.[/QUOTE]

Not sure if this applies across all distros, but at least for CentOS/RedHat you can do:
cat /proc/cpuinfo

which will list the cpuflags, e.g.:

[CODE]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 intel_ppin intel_pt ssbd
mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle
avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a [B]avx512f avx512dq[/B] rdseed adx
smap clflushopt clwb [B]avx512cd avx512bw avx512vl[/B] 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 md_clear spec_ctrl intel_stibp flush_l1d
[/CODE]

AVX-ECM needs avx512f and avx512dq

bsquared 2020-01-02 14:59

Speaking of cpu features, can't wait for systems with avx512ifma to become available. Should get a good speed boost with that feature.

GP2 2020-01-02 15:01

[QUOTE=chris2be8;533905]How can you check if a CPU supports avx512? Eg one of my systems is a Ryzen 5 2600, /proc/cpuinfo says it supports avx and avx2, but so do some older systems.[/QUOTE]

[c]grep flags /proc/cpuinfo[/c] should show which specific subsets of the AVX-512 instruction set are supported. For instance, the CPU I use has avx512f avx512dq avx512cd avx512bw avx512vl. For the meanings, see [URL="https://en.wikipedia.org/wiki/AVX-512#Instruction_set"]Wikipedia[/URL].

chalsall 2020-01-02 15:33

[QUOTE=bsquared;533997]cat /proc/cpuinfo[/QUOTE]

I just happen to have an SSH session into a Colab session open right now.

[CODE]root@InstanceSSH:~# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 85
model name : Intel(R) Xeon(R) CPU @ 2.00GHz
stepping : 3
microcode : 0x1
cpu MHz : 2000.168
cache size : 39424 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
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 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat md_clear arch_capabilities
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 4000.33
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 85
model name : Intel(R) Xeon(R) CPU @ 2.00GHz
stepping : 3
microcode : 0x1
cpu MHz : 2000.168
cache size : 39424 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 1
initial apicid : 1
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 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat md_clear arch_capabilities
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 4000.33
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:[/CODE]

bsquared 2020-01-02 15:35

[QUOTE=chalsall;534005]I just happen to have an SSH session into a Colab session open right now.

[CODE]root@InstanceSSH:~# cat /proc/cpuinfo

flags : ... avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl ...
[/CODE][/QUOTE]

Nice!

bsquared 2020-01-02 16:16

I bolted on a simplified version of yafu's front end calculator:

[CODE]./avx-ecm "fib(791)/13/677/216416017" 8 1000000 1
starting process 418960
commencing parallel ecm on 478538644094177490260709299559653477212580778084175536200356719720677713018603842152898226485988725658355447208677180777716686530734249077491242934517377
ECM has been configured with DIGITBITS = 52, VECLEN = 8, GMP_LIMB_BITS = 64
Choosing MAXBITS = 624, NWORDS = 12, NBLOCKS = 3 based on input size 508
cached 3001134 primes < 49999991
Input has 508 bits, using 1 threads (8 curves/thread)
Processing in batches of 100000000 primes
Initialization took 0.1045 seconds.
Cached 5761455 primes in range [2 : 99999989]

commencing curves 0-7 of 8
Building curves took 0.0006 seconds.
commencing Stage 1 @ prime 2
accumulating prime 997693
Stage 1 completed at prime 999983 with 2001925 point-adds and 194143 point-doubles
Stage 1 took 6.8980 seconds

found factor 272602401466814027129 in stage 1 in thread 0, vec position 3, with sigma = 1465376940087886860


commencing stage 2 at p=1000003, A=1000230
w = 1155, R = 480, L = 16, umax = 9240, amin = 433
Stage 2 took 4.9852 seconds
performed 3188920 pair-multiplies for 5682957 primes in stage 2
performed 95044 point-additions and 53 point-doubles in stage 2

found factor 272602401466814027129 in stage 2 in thread 0, vec position 3, with sigma = 1465376940087886860

found factor 272602401466814027129 in stage 2 in thread 0, vec position 4, with sigma = 16373433592041433963

found factor 272602401466814027129 in stage 2 in thread 0, vec position 7, with sigma = 12457157968472999552
Process took 11.9819 seconds.
[/CODE]

So now you should be able to use +,-,*,/,^,%,# (primorial), ! (factorial), as well as fib(), luc(), >>, <<, binary ops (xor,and,not,or), and a few other things.

PhilF 2020-01-02 17:34

Sorry, duplicate post...

CRGreathouse 2020-01-02 18:29

[QUOTE=GP2;533999][c]grep flags /proc/cpuinfo[/c] should show which specific subsets of the AVX-512 instruction set are supported.[/QUOTE]

For the lazy:
[code]egrep -o 'avx512[^ ]*' /proc/cpuinfo | sort -u[/code]

mathwiz 2020-01-02 23:17

FWIW, I'm getting segfaults with the current master branch. Was a bug introduced?

bsquared 2020-01-03 00:37

[QUOTE=mathwiz;534063]FWIW, I'm getting segfaults with the current master branch. Was a bug introduced?[/QUOTE]

Probably... can you let me know what command line was giving you problems? It has been working for me but I haven't done a lot of testing either.

bsquared 2020-01-03 02:33

[QUOTE=bsquared;534071]Probably... can you let me know what command line was giving you problems? It has been working for me but I haven't done a lot of testing either.[/QUOTE]

I see now after testing on a different system with gcc that it doesn't work at all. I committed a fix (was missing a couple libraries in the new calc front end). Tested on linux with icc, with mingw on windows/msys2, and on windows-subsystem-for-linux/gcc.



[QUOTE=bsquared;533848]

+ parameterization seems not exactly compatible with gmp-ecm: looking into it

I'm not exactly sure what's going on with the parameterization... this program finds factors when it seems like it shouldn't for some sigma and conversely doesn't find factors when gmp-ecm does for some sigma. On average though the factor-finding rate seems about the same.
[/QUOTE]

Also fixed this. Was a simple overflow when trying to set random sigma values into an mpz_t.


All times are UTC. The time now is 16:39.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.