Hi,
Doing more benchmarks on my Linux/pentium 4 machine, I noticed that it
was slower than I expected for estimating a statistical model.
After a bit of work, this boiled down to the fact that matlab on
pentium 4 machines is very slow for sparse matrix multiplication,
which is used in applying the SPM low and high pass filtering.
This can be shown with the little program below:
Kd = 300;
Vd = 2000;
K = ones(Kd);
y = ones(Kd, Vd);
tic
y = K*y;
t = toc;
K = sparse(K);
y = sparse(y);
tic
y = K*y;
t(2) = toc
This gives 0.27 seconds for the full matrix, and 27.10 for the same
sparse matrix, a 100 x slowdown. There is a smaller slowdown for a
pentium 3 laptop (0.66 -> 14.08 = 21 x), and for a Sun machine I work
on (0.69 -> 11.48, 17 x). The pentium 4 slowdown is not changed by
using recompiled ATLAS libraries (see previous mails by Satra Ghosh).
This has a relatively severe effect on model estimation speed; a
benchmark model estimation on spm99 takes about 23 minutes; if the
filter is made full before estimation by adding
for s = 1:length(xX.K)
xX.K{s}.KH=full(xX.K{s}.KH);
xX.K{s}.KL=full(xX.K{s}.KL);
end
at about line 420 of spm_spm.m, the same model estimation takes 6.7
minutes.
I'll send a report to matlab...
Best,
Matthew
|