[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Martin Albrecht
On Thursday 15 January 2009, dmharvey wrote: > On Jan 14, 5:41 pm, Bill Hart wrote: > > There's only one conclusion possible. The Schoenhage/Nussbaumer FFT > > David has written in zn_poly for multiplication of polys over Z/pZ is > > truly much better on Intel than the Kronecker Segmentation/Scho

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread dmharvey
On Jan 14, 5:41 pm, Bill Hart wrote: > There's only one conclusion possible. The Schoenhage/Nussbaumer FFT > David has written in zn_poly for multiplication of polys over Z/pZ is > truly much better on Intel than the Kronecker Segmentation/Schoenhage- > Strassen FFT method used in FLINT. zn_pol

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Bill Hart
Here's some more info: It's not a caching issue. I've tried adjusting the expected cache size in FLINT from very small to very large. It makes little difference. It's quite amazing that these Intel machines appear completely oblivious to how big their caches are. The total time taken for the lar

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Bill Hart
Properly tuned, for a length 10^6 multiplication with 40 bit modulus, zn_poly takes 1.59s and FLINT 2.22s on sage.math. So zn_poly is quite a bit faster on Intel machines than FLINT. No idea why that is. But it is very impressive!! Bill. On 14 Jan, 20:37, Bill Hart wrote: > I did some more timi

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Bill Hart
I did some more timings and I've been bitten by the timing irregularities on my Opteron again. For length 1,000,000 and 40 bits FLINT takes about 1.57s and zn_poly 1.46s. I tried using the --use-flint option in zn_poly, but presumably this multiplication is outside the KS range and so the timing

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Bill Hart
On the 2.4GHz Opteron zn_poly reports that it takes 1.46s for this multiplication. That is certainly faster than FLINT. So it looks like zn_poly really is better for longer length polynomials now. It's not clear what the improvement was, but it looks like better tuning code, from the zn_poly CHAN

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Bill Hart
On a 2.4Ghz Opteron FLINT takes 1.92s for the multiplication. So at least there is no serious speed regression in FLINT. I now need to time zn_poly and see if it does better than FLINT on the Opteron. Bill. On 14 Jan, 17:09, Bill Hart wrote: > I did the timings from FLINT directly and indeed i

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Bill Hart
I did the timings from FLINT directly and indeed it takes 2.5s for a 40 bit modulus and length 10^6. This agrees with what comes out of Martin's version of Sage. So, only 3 possibilities remain: 1) Serious speed regression in FLINT 2) David's improved tuning for zn_poly *really* makes a differen

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread William Stein
On Wed, Jan 14, 2009 at 8:44 AM, Bill Hart wrote: > > I'm trying to inspect the gmp in your installation to see if maybe the > Core 2 patches aren't installed or something, but I'm having trouble > opening the spkg named gmp-4.2.2.p1.fake. Is that where the gmp is? I > thought these were just tar

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Bill Hart
I'm trying to inspect the gmp in your installation to see if maybe the Core 2 patches aren't installed or something, but I'm having trouble opening the spkg named gmp-4.2.2.p1.fake. Is that where the gmp is? I thought these were just tar files or bzip2 files? Bill. On 14 Jan, 16:29, Martin Albre

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Martin Albrecht
On Wednesday 14 January 2009, Bill Hart wrote: > I checked back through the correspondence I had and the timing I am > thinking of is for a 40 bit modulus at length 1,000,000. David and I > compared at the time and zn_poly version 0.4.1 took 2.06s compared to > FLINT at 2.37s, at that stage, on th

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Martin Albrecht
On Wednesday 14 January 2009, Bill Hart wrote: > On 13 Jan, 12:17, Martin Albrecht > > wrote: > > The following is multiplication of two random polynomials over > > GF(140737488355328) of length n > > > > n               FLINT   zn_poly > > > > 131072  0.292   0.220 > > 262144  0.612   0.454 > >

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Bill Hart
I checked back through the correspondence I had and the timing I am thinking of is for a 40 bit modulus at length 1,000,000. David and I compared at the time and zn_poly version 0.4.1 took 2.06s compared to FLINT at 2.37s, at that stage, on the old sage.math. The zn_poly changelog shows that Davi

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-14 Thread Bill Hart
On 13 Jan, 12:17, Martin Albrecht wrote: > The following is multiplication of two random polynomials over > GF(140737488355328) of length n > > n               FLINT   zn_poly > 131072  0.292   0.220 > 262144  0.612   0.454 > 524288  1.522   1.028 > 1048576 3.136   2.096 These are unexpected

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-13 Thread William Stein
On Tue, Jan 13, 2009 at 6:29 AM, Martin Albrecht wrote: > >> In particular the class >> >> cdef class Polynomial_zmod_flint(Polynomial_template): >> >> only has like 5 or 6 methods. Just make a version of this class that is >> >> cdef class Polynomial_zmod_flint_and_ntl(Polynomial_template): >>

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-13 Thread Martin Albrecht
> In particular the class > > cdef class Polynomial_zmod_flint(Polynomial_template): > > only has like 5 or 6 methods. Just make a version of this class that is > > cdef class Polynomial_zmod_flint_and_ntl(Polynomial_template): > > say that defines versions of all 5 or 6 methods that use both ntl

[sage-devel] Re: zn_poly & zmod_poly_t

2009-01-13 Thread William Stein
On Tue, Jan 13, 2009 at 4:17 AM, Martin Albrecht wrote: > > Hi there, > > this is a continuation of a thread on [sage-nt] on arithmetic over Z/nZ[x] for > n word sized. > > http://groups.google.com/group/sage-nt/browse_thread/thread/6e415c61089ea435 > > It started about #4965 > > http://trac.sa