Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance test of sparse-matrix vector product added #1213

Merged
merged 1 commit into from
Jul 7, 2013

Conversation

lambday
Copy link
Member

@lambday lambday commented Jul 7, 2013

Tried testing mat-vec product performance with SGSparseMatrix and Eigen::SparseMatrix, used same fixed matrix for both with dim 10^6x10^6, with nnz~3^10^6, nz elements are along the diagonal, the first row and the first col.

On my machine the output is (with -O3)

time shogun (s) eigen3 (s)

0 0.940000 0.800000
1 0.940000 0.800000
2 0.940000 0.790000
3 0.940000 0.800000
4 0.940000 0.790000

without -O3, however
time shogun (s) eigen3 (s)

0 1.420000 13.450000
1 1.440000 13.460000
2 1.440000 13.480000
3 1.430000 13.470000
4 1.430000 13.470000

@lambday
Copy link
Member Author

lambday commented Jul 7, 2013

@karlnapf @sonney2k @lisitsyn please have a look :)

@lambday
Copy link
Member Author

lambday commented Jul 7, 2013

checked using valgrind, heap usage (for 1 time creation)

eigen3 : 264 allocs, 264 frees, 258,255,714 bytes allocated
shogun: 3,000,236 allocs, 3,000,236 frees, 160,038,038 bytes allocated

@lambday
Copy link
Member Author

lambday commented Jul 7, 2013

updated with dense dot

{
SGVector<float64_t> r(v.vlen);
ASSERT(v.vlen==m.num_vectors);
for (register index_t i=0; i<m.num_vectors; ++i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

register makes no real advantage nowadays - compiler knows how to do that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lisitsyn okay, I'll remove it. But this result looks reasonable, no? Earlier I was taking num_vectors=num_cols, so got confused. I guess this is what @sonney2k was talking about.

@karlnapf
Copy link
Member

karlnapf commented Jul 7, 2013

What is the consequence of this?
shoguns sparse matrix-vector product is way slower than eigen3's

karlnapf added a commit that referenced this pull request Jul 7, 2013
performance test of sparse-matrix vector product added
@karlnapf karlnapf merged commit e827211 into shogun-toolbox:develop Jul 7, 2013
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling f114684 on lambday:feature/log_determinant into * on shogun-toolbox:develop*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants