Re: [sage-devel] fpylll really slow in sage9.x, when compared to sage8.x

2023-01-11 Thread 'Julian Nowakowski' via sage-devel
Hi Dima,

thank you for your suggestion.

We still think that this issue is Sage-related.
We have already tried to figure out, whether the slowdown is simply an 
issue of fpylll.
If that was the case, then the slowdown would probably be caused by one of 
the following two issues:

1) The newer versions of fpylll, that ship with sage9, might be much slower 
than the older versions, that ship with sage8.
2) Running fpylll with python2 (as in sage8) might be much faster than 
running it with python3 (as in sage9).

To test, if that is case, we built the versions of fpylll, that ship with 
sage9, by ourselves.
We then ran the above code in these builds, using both python2 and python3.
In these runs, fpylll was just as fast as it was in sage8.x.
So the slowdown is probably not caused by the differences in fpylll/python 
versions.

It seems more likely to us that sage 9.x is doing something strange when 
building fpylll and that this is causing the slowdown.

Best,
Julian

dim...@gmail.com schrieb am Dienstag, 10. Januar 2023 um 17:03:27 UTC+1:

> This does not appear to be Sage-related.
> You can run the code above in Python shell.
> (e.g. you can start Sage's python as "sage --python")
>
> HTH
> Dima
>
> On Tue, Jan 10, 2023 at 3:48 PM 'Julian Nowakowski' via sage-devel
>  wrote:
> >
> > Hi Martin,
> >
> > the slowdown also appears in other contexts. In particular, it also 
> appears when running LLL.
> > Running the following code on our machine takes approximately 1 second 
> with sage 8.1 and 8.9, but approximately 10 seconds with sage 9.3 and 9.7.
> >
> > import time
> > from fpylll import IntegerMatrix, LLL
> >
> > dim = 250
> > bits = 3
> >
> > A = IntegerMatrix.random( dim, "uniform", bits = bits )
> >
> > start = time.time()
> > LLL.reduction(A)
> > stop = time.time()
> >
> > print("LLL took %f seconds." % (stop-start))
> >
> > Best,
> > Julian
> > martinr...@googlemail.com schrieb am Dienstag, 10. Januar 2023 um 
> 11:57:29 UTC+1:
> >>
> >> Hi there,
> >>
> >> I don’t think A*B is a good benchmark for FPyLLL does the same slowdown 
> also appear for, say, LLL?
> >>
> >> Cheers,
> >> Martin
> >>
> >> On Tue, Jan 10 2023, 'Julian Nowakowski' via sage-devel wrote:
> >> > Hi all,
> >> >
> >> > we recently noticed that the IntegerMatrix class from fpylll is (on 
> our
> >> > hardware) much slower in sage9.x, than it is in sage8.x.
> >> >
> >> > Please consider the following code snippet:
> >> >
> >> > import time
> >> > from fpylll import IntegerMatrix
> >> >
> >> > dim = 30
> >> > bits = 10
> >> >
> >> > A = IntegerMatrix.random( dim, "uniform", bits = bits )
> >> > B = IntegerMatrix.random( dim, "uniform", bits = bits )
> >> >
> >> > start = time.time()
> >> > C = A*B
> >> > stop = time.time()
> >> >
> >> > print( "Multiplication took %f seconds." % (stop-start) )
> >> >
> >> >
> >> > We tried running this code in Sage 8.1, 8.9, 9.3 and 9.7. In the 8.x
> >> > versions, the multiplications takes less than 0.2 seconds. In the 9.x
> >> > versions, it takes more than 6 seconds.
> >> >
> >> > Any ideas?
> >> >
> >> > Best,
> >> > Julian
> >> >
> >> > --
> >> >
> >> > https://juliannowakow.ski/
> >>
> >>
> >> --
> >>
> >> _pgp: https://keybase.io/martinralbrecht
> >> _www: https://malb.io
> >> _prn: he/him or they/them
> >>
> > --
> > You received this message because you are subscribed to the Google 
> Groups "sage-devel" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-devel+...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/73f9e6ea-cdc4-4d43-a2fc-abbfa144d71cn%40googlegroups.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/d0abe8fb-d821-48b1-8aee-aa10a61754b4n%40googlegroups.com.


Re: [sage-devel] fpylll really slow in sage9.x, when compared to sage8.x

2023-01-10 Thread 'Julian Nowakowski' via sage-devel
Hi Martin,

the slowdown also appears in other contexts. In particular, it also appears 
when running LLL.
Running the following code on our machine takes approximately 1 second with 
sage 8.1 and 8.9, but approximately 10 seconds with sage 9.3 and 9.7.

import time
from fpylll import IntegerMatrix, LLL

dim = 250
bits = 3

A = IntegerMatrix.random( dim, "uniform", bits = bits )

start = time.time()
LLL.reduction(A)
stop = time.time()

print("LLL took %f seconds." % (stop-start))

Best,
Julian
martinr...@googlemail.com schrieb am Dienstag, 10. Januar 2023 um 11:57:29 
UTC+1:

> Hi there,
>
> I don’t think A*B is a good benchmark for FPyLLL does the same slowdown 
> also appear for, say, LLL?
>
> Cheers,
> Martin
>
> On Tue, Jan 10 2023, 'Julian Nowakowski' via sage-devel wrote:
> > Hi all,
> >
> > we recently noticed that the IntegerMatrix class from fpylll is (on our 
> > hardware) much slower in sage9.x, than it is in sage8.x.
> >
> > Please consider the following code snippet:
> >
> > import time
> > from fpylll import IntegerMatrix
> >
> > dim = 30
> > bits = 10
> >
> > A = IntegerMatrix.random( dim, "uniform", bits = bits )
> > B = IntegerMatrix.random( dim, "uniform", bits = bits )
> >
> > start = time.time()
> > C = A*B
> > stop = time.time()
> >
> > print( "Multiplication took %f seconds." % (stop-start) )
> >
> >
> > We tried running this code in Sage 8.1, 8.9, 9.3 and 9.7. In the 8.x 
> > versions, the multiplications takes less than 0.2 seconds. In the 9.x 
> > versions, it takes more than 6 seconds.
> >
> > Any ideas?
> >
> > Best,
> > Julian
> >
> > --
> >
> > https://juliannowakow.ski/
>
>
> -- 
>
> _pgp: https://keybase.io/martinralbrecht
> _www: https://malb.io
> _prn: he/him or they/them
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/73f9e6ea-cdc4-4d43-a2fc-abbfa144d71cn%40googlegroups.com.


[sage-devel] fpylll really slow in sage9.x, when compared to sage8.x

2023-01-10 Thread 'Julian Nowakowski' via sage-devel
Hi all,

we recently noticed that the IntegerMatrix class from fpylll is (on our 
hardware) much slower in sage9.x, than it is in sage8.x.

Please consider the following code snippet:

import time
from fpylll import IntegerMatrix

dim = 30
bits = 10

A = IntegerMatrix.random( dim, "uniform", bits = bits )
B = IntegerMatrix.random( dim, "uniform", bits = bits )

start = time.time()
C = A*B
stop = time.time()

print( "Multiplication took %f seconds." % (stop-start) )


We tried running this code in Sage 8.1, 8.9, 9.3 and 9.7. In the 8.x 
versions, the multiplications takes less than 0.2 seconds. In the 9.x 
versions, it takes more than 6 seconds.

Any ideas?

Best,
Julian

--

https://juliannowakow.ski/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/2b836bea-a10a-47ba-b401-97b91c1a6b4bn%40googlegroups.com.