#16803: Reimplement matrix_integer_dense using FLINT
-------------------------------------+-------------------------------------
Reporter: mmasdeu | Owner:
Type: enhancement | Status: new
Priority: major | Milestone: sage-6.4
Component: linear algebra | Resolution:
Keywords: flint, matrix | Merged in:
Authors: Marc Masdeu | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/mmasdeu/16803-matrix_integer_dense_flint|
166bae537c52aa4eee968275dcd2f2aef9f52a82
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by was):
Hi,
A first remark playing around with timings is that in sage-6.3 somebody or
something has definitely *completely massively screwed* up Linbox, or how
Linbox is built, or how we use linbox, which was the default
representation and library for arithmetic. Consider this:
{{{
sage: n=200; set_random_seed(0); a = random_matrix(ZZ,n); b =
random_matrix(ZZ,n)
sage: %time c=a._multiply_linbox(b)
CPU times: user 326 ms, sys: 3.63 ms, total: 330 ms
Wall time: 347 ms
sage: %time c=a._multiply_multi_modular(b)
CPU times: user 51.5 ms, sys: 1.6 ms, total: 53.1 ms
Wall time: 56.1 ms
sage: n=400; set_random_seed(0); a = random_matrix(ZZ,n); b =
random_matrix(ZZ,n)
sage: %time c=a._multiply_linbox(b)
CPU times: user 5.28 s, sys: 22.8 ms, total: 5.3 s
Wall time: 5.37 s
sage: %time c=a._multiply_multi_modular(b)
CPU times: user 230 ms, sys: 6.08 ms, total: 236 ms
Wall time: 248 ms
}}}
Linbox should easily beat the multiply_multi_modular approach -- that's
just basically a naive version of the same thing linbox would be doing if
it were properly built and linked. Instead, Linbox is massively slower.
In fact, almost exactly as much slower as I would expect if the wrong BLAS
were being linked. Note that I tested against the new flint backend and
now a._multiply_multi_modular(b) is asymptotically similar to flint,
though asymptotically (for n=2000 already), they are pretty close to the
same in speed (8.55s versus 11.4s). In any case, somebody should
really look into why linbox is so screwed up -- we switched to it
initially since it was much better than doing a._multiply_multi_modular(b)
and also our own strassen implementation.
--
Ticket URL: <http://trac.sagemath.org/ticket/16803#comment:9>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.