mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > YAFU

Reply
 
Thread Tools
Old 2021-08-11, 15:37   #155
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

254268 Posts
Default

Quote:
Originally Posted by kruoli View Post
Here it is.
Thanks!
xilman is offline   Reply With Quote
Old 2021-08-11, 17:28   #156
Gimarel
 
Apr 2010

18810 Posts
Default

I get a SIGSEGV with yafu 2.05 on a Ryzen 3950X under linux built with
Code:
make yafu NFS=1 USE_SSE41=1 USE_AVX2=1 USE_BMI2=1
and
Code:
yafu "siqs(1131941884204194473862586294639558925416454742463976786637412462462312690253602905547214801)"
The number was generated with rsa(300).
Gimarel is offline   Reply With Quote
Old 2021-08-11, 17:41   #157
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3×1,193 Posts
Default

Thanks for the report and testing, I'll look into it. I won't be able to get a revision out until Sunday.
bsquared is offline   Reply With Quote
Old 2021-08-11, 17:44   #158
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

67738 Posts
Default

Quote:
Originally Posted by Brian Gladman View Post
Hi Ben

I spent some time today aligning all the constituent parts of the YAFU Visual Studio 2019 build for windows X64 to use the Microsoft static runtime libraries and I now have a successful build of YAFU. I have tested it on Windows 11 (beta) with the Quadro T2000 GPU on my laptop and all seems to work as expected.

It is available here (yafu, ysieve and ytools):

https://github.com/BrianGladman?tab=repositories

The build is in the build.vs subdirectory, not build.vc19 (which does not build), as I am in the process of moving it to Visual Studio 2022.

Sadly the build for the siqs_demo project fails because it cannot find these symbols:

1>calc.obj : error LNK2001: unresolved external symbol siqsbench
1>calc.obj : error LNK2001: unresolved external symbol smallmpqs
1>calc.obj : error LNK2001: unresolved external symbol SIQS
1>siqs_demo.obj : error LNK2001: unresolved external symbol get_computer_info

I would be grateful for your advice on where these should be available.
Fantastic thank you Brian! I think siqs demo just needs some project properties work. I'll look into that this weekend.
bsquared is offline   Reply With Quote
Old 2021-08-11, 18:45   #159
charybdis
 
charybdis's Avatar
 
Apr 2020

547 Posts
Default

Quote:
Originally Posted by Gimarel View Post
I get a SIGSEGV with yafu 2.05 on a Ryzen 3950X under linux built with
Code:
make yafu NFS=1 USE_SSE41=1 USE_AVX2=1 USE_BMI2=1
and
Code:
yafu "siqs(1131941884204194473862586294639558925416454742463976786637412462462312690253602905547214801)"
In case it's helpful in diagnosing the issue, I couldn't reproduce this crash on an i5-8500 with the same build flags.
charybdis is offline   Reply With Quote
Old 2021-08-11, 19:05   #160
Plutie
 
"Evan"
Dec 2020
Montreal

23·32 Posts
Default

Quote:
Originally Posted by charybdis View Post
In case it's helpful in diagnosing the issue, I couldn't reproduce this crash on an i5-8500 with the same build flags.
Unable to reproduce on 5600X with same build flags as well.

P.S. YAFU 2.05 from the github repository's "yafu-x64.exe" was crashing upon starting a SIQS factorization. Unable to get logs for the next few days, but I am available to answer more questions if there are any regarding my setup.

Last fiddled with by Plutie on 2021-08-11 at 19:09 Reason: Added extra issue report
Plutie is offline   Reply With Quote
Old 2021-08-12, 06:06   #161
Gimarel
 
Apr 2010

2748 Posts
Default

Quote:
Originally Posted by Gimarel View Post
I get a SIGSEGV with yafu 2.05 on a Ryzen 3950X under linux built with
Code:
make yafu NFS=1 USE_SSE41=1 USE_AVX2=1 USE_BMI2=1
Further testing showed, that the number doesn't matter. yafu crashes every time with siqs(rsa(215)), most of the time with siqs(rsa(214)) but runs every time with siqs(rsa(213)).
Also note that yafu works if I omit USE_AVX2=1.

I'm using gcc-10 of debian bullseye.

Here's a complete log:
Code:
yafu "siqs(rsa(215))" 

YAFU Version 2.05
Built with GCC 10
Using GMP-ECM 7.0.5-dev, Powered by GMP 6.2.1
Detected AMD Ryzen 9 3950X 16-Core Processor            
Detected L1 = 32768 bytes, L2 = 67108864 bytes, CL = 64 bytes
Using 1 random witness for Rabin-Miller PRP checks
Cached 664579 primes; max prime is 9999991

===============================================================
======= Welcome to YAFU (Yet Another Factoring Utility) =======
=======             bbuhrow@gmail.com                   =======
=======     Type help at any time, or quit to quit      =======
===============================================================

>> 
starting SIQS on c65: 31635638050360383928410741313802727069876274264595430910292999519

==== sieve params ====
n = 67 digits, 221 bits
factor base: 6384 primes (max prime = 137117)
single large prime cutoff: 10283775 (75 * pmax)
allocating 3 large prime slices of factor base
buckets hold 2048 elements
large prime hashtables have 196608 bytes
using AVX2 enabled 32k sieve core
sieve interval: 4 blocks of size 32768
polynomial A has ~ 8 factors
using multiplier of 71
using Q2(x) polynomials for kN mod 8 = 1
using SPV correction of 21 bits, starting at offset 32
trial factoring cutoff at 75 bits

==== sieving in progress (1 thread):    6448 relations needed ====
====           Press ctrl-c to abort and save state           ====
 Segmentation fault
gdb backtrace:
Code:
#0  0x000055555558aee1 in nextRoots_32k_avx2 (sconf=<optimized out>, dconf=0x555557fa3710) at factor/qs/update_poly_roots_32k_avx2.c:1506
#1  0x0000555555575da6 in process_poly (vptr=vptr@entry=0x5555578fed60) at factor/qs/SIQS.c:1292
#2  0x000055555557d368 in SIQS (fobj=fobj@entry=0x5555578f5ef0) at factor/qs/SIQS.c:828
#3  0x000055555556c414 in feval (funcnum=funcnum@entry=59, nargs=nargs@entry=1, metadata=metadata@entry=0x7fffffffd030) at top/cmdParser/calc.c:2559
#4  0x000055555556e0c6 in calc (in=in@entry=0x7fffffffce90, metadata=metadata@entry=0x7fffffffd030) at top/cmdParser/calc.c:1946
#5  0x000055555556e364 in calc_with_assignment (in=in@entry=0x5555578fce60, metadata=metadata@entry=0x7fffffffd030, force_quiet=force_quiet@entry=0) at top/cmdParser/calc.c:1526
#6  0x000055555556a421 in process_expression (input_exp=<optimized out>, metadata=metadata@entry=0x7fffffffd030, force_quiet=0, no_convert_result=no_convert_result@entry=0) at top/cmdParser/calc.c:1472
#7  0x000055555555a850 in main (argc=<optimized out>, argv=<optimized out>) at top/driver.c:366
Crashing instruction:

Code:
β”‚   0x55555558aed3 <nextRoots_32k_avx2+10563>       mov    0x28(%rsi),%r14                                                                                                                                                                                                                                                   β”‚
β”‚   0x55555558aed7 <nextRoots_32k_avx2+10567>       vmovdqa (%rdi,%r15,4),%ymm3                                                                                                                                                                                                                                              β”‚
β”‚   0x55555558aedd <nextRoots_32k_avx2+10573>       mov    0x30(%rsi),%r13                                                                                                                                                                                                                                                   β”‚
β”‚  >0x55555558aee1 <nextRoots_32k_avx2+10577>       vmovdqa (%r14,%r15,4),%ymm1                                                                                                                                                                                                                                              β”‚
β”‚   0x55555558aee7 <nextRoots_32k_avx2+10583>       vpaddd %ymm3,%ymm1,%ymm1                                                                                                                                                                                                                                                 β”‚
β”‚   0x55555558aeeb <nextRoots_32k_avx2+10587>       vmovdqa 0x0(%r13,%r15,4),%ymm2                                                                                                                                                                                                                                           β”‚
β”‚   0x55555558aef2 <nextRoots_32k_avx2+10594>       mov    0x20(%rsi),%rdi                                                                                                                                                                                                                                                   β”‚

Last fiddled with by Gimarel on 2021-08-12 at 06:25 Reason: gdb backtrace added
Gimarel is offline   Reply With Quote
Old 2021-08-16, 21:11   #162
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

67738 Posts
Default

Quote:
Originally Posted by Gimarel View Post
Further testing showed, that the number doesn't matter. yafu crashes every time with siqs(rsa(215)), most of the time with siqs(rsa(214)) but runs every time with siqs(rsa(213)).
Also note that yafu works if I omit USE_AVX2=1.

I'm using gcc-10 of debian bullseye.
Thanks for the detailed info. Looks like gcc-10 is having problems aligning some data, which comes into play once input numbers are big enough to start using avx2 inline assembly. There may be gcc options that force alignment, or you can not use avx2, as you discovered, which is probably the best option for now. I have not seen the same problems with icc or gcc-11.1.0 or gcc-7.3.0. Sorry I can't be of more help.
bsquared is offline   Reply With Quote
Old 2021-08-16, 21:15   #163
bsquared
 
bsquared's Avatar
 
"Ben"
Feb 2007

3×1,193 Posts
Default

Quote:
Originally Posted by Plutie View Post
Unable to reproduce on 5600X with same build flags as well.

P.S. YAFU 2.05 from the github repository's "yafu-x64.exe" was crashing upon starting a SIQS factorization. Unable to get logs for the next few days, but I am available to answer more questions if there are any regarding my setup.
Quote:
Originally Posted by johnadam74 View Post
I downloaded the most recent version 2.05 for Windows. That version is still crashing for me. When I try to run it as yafu-x64.exe, it will open to ">>" where you can enter a command such as factor(123456) but it crashes before I can enter anything.
Can either of you post the siqs output (or whatever output you get) with -v and -vproc?
bsquared is offline   Reply With Quote
Old 2021-08-16, 21:53   #164
charybdis
 
charybdis's Avatar
 
Apr 2020

547 Posts
Default

Quote:
Originally Posted by bsquared View Post
Thanks for the detailed info. Looks like gcc-10 is having problems aligning some data, which comes into play once input numbers are big enough to start using avx2 inline assembly. There may be gcc options that force alignment, or you can not use avx2, as you discovered, which is probably the best option for now. I have not seen the same problems with icc or gcc-11.1.0 or gcc-7.3.0. Sorry I can't be of more help.
This must be very specific to gcc-10: I was using 9.3.0 when I tried and failed to reproduce this. Looks like installing a second gcc version (with the necessary care, of course) would be an alternative solution to the problem.
charybdis is offline   Reply With Quote
Old 2021-08-17, 11:15   #165
Gimarel
 
Apr 2010

22·47 Posts
Default

Quote:
Originally Posted by charybdis View Post
This must be very specific to gcc-10: I was using 9.3.0 when I tried and failed to reproduce this. Looks like installing a second gcc version (with the necessary care, of course) would be an alternative solution to the problem.
I'm getting the same SEGFAULT with gcc-9. I will try to install gcc-11, but this will take some time.

I also tried clang-11 but the build fails with:
Code:
clang-11 -g -DUSE_SSE2 -mbmi2 -mbmi -DUSE_BMI2 -DUSE_AVX2 -DUSE_SSE41  -mavx2  -DUSE_SSE41 -m64 -msse4.1 -DUSE_NFS -O3 -march=native -mtune=native -fomit-frame-pointer -Wall  -I. -Iinclude -Itop/aprcl -Itop/cmdParser -Itop/ -I../../../msieve -I../ysieve -I../ytools -I../../ecm -I../gmp/include -I../gmp-ecm/include/ -c -o factor/qs/msieve/lanczos.o factor/qs/msieve/lanczos.c
In file included from factor/qs/msieve/lanczos.c:18:
In file included from include/lanczos.h:21:
In file included from include/qs_impl.h:20:
include/monty.h:145:19: error: invalid input constraint '0ULL' in asm
        : "1"(c), "0ULL"(0), "r"(n));
                  ^
1 error generated.
make: *** [Makefile:450: factor/qs/msieve/lanczos.o] Fehler 1
Gimarel is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
yafu ignoring yafu.ini chris2be8 YAFU 6 2019-10-17 16:22
Running YAFU via Aliqueit doesn't find yafu.ini EdH YAFU 8 2018-03-14 17:22
YAFU-1.34 bsquared YAFU 119 2015-11-05 16:24
Yafu bug. storflyt32 YAFU 2 2015-06-29 05:19
yafu 1.32 bsquared YAFU 28 2012-07-20 16:17

All times are UTC. The time now is 02:22.


Mon Dec 6 02:22:06 UTC 2021 up 135 days, 20:51, 0 users, load averages: 1.84, 1.75, 1.72

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.