ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 12 Apr 2015 15:52:31 +0200Matrix dot multiplication slowness and BLAS versionshttps://ask.sagemath.org/question/26507/matrix-dot-multiplication-slowness-and-blas-versions/Hello everyone!
Is there a way to increase a performance of matrix multiplication in Sage? Right now I am relying on numpy's dot function like this:
import numpy as np
N = 768
P = 1024
A = np.random.random((P, N))
A.T.dot(A)
Timing dot product in Sage now gives me a time about second and a half:
>>> setup = """
...
... import numpy as np
...
... N = 768
... P = 1024
...
... A = np.random.random((P, N))
... """
>>> timeit.repeat('A.T.dot(A)', setup=setup, number=10, repeat=3)
[18.736198902130127, 18.66787099838257, 17.36500310897827]
Yet the same multiplication in Matlab takes less than 100 ms. I heard that numpy internally relying on BLAS and it can be replaced with OpenBLAS /ATLAS/IntelMKL or something like that for the better performance.
So I am looking for some kind of manual or info about that is going on with the performance in regard with underlying numpy's components and when one should consider replacing one with another and is there a simple way to do that?
EugeneSun, 12 Apr 2015 15:52:31 +0200https://ask.sagemath.org/question/26507/Any simple way to divert calculations in Sage to the graphics card?https://ask.sagemath.org/question/9129/any-simple-way-to-divert-calculations-in-sage-to-the-graphics-card/Hey,
I'm fairly new to Sage, pls accept my question under this comment:
I've heard that diverting calculations to the graphics card might speed up running time. Person I heard it from uses C and Matlab.
How true is it? And if so - is there a simple way to do this in Sage?
I'm looking for any good advice on how to speed up my calculations, I have installed Ubuntu 12.04 for Sage, and stoped any programs from running in the background when I'm running my code. I try to achieve as much power I can get from my computer solely for the purpose of my calculation.
Thanking u on advence! ErezWed, 04 Jul 2012 06:04:18 +0200https://ask.sagemath.org/question/9129/