Skip to content

COSMIT Avoid writing out vectorizable operations in sparsefuncs_fast#10615

Merged
rth merged 2 commits intoscikit-learn:masterfrom
jnothman:vec-incr-sparse-meanvar
Feb 12, 2018
Merged

COSMIT Avoid writing out vectorizable operations in sparsefuncs_fast#10615
rth merged 2 commits intoscikit-learn:masterfrom
jnothman:vec-incr-sparse-meanvar

Conversation

@jnothman
Copy link
Copy Markdown
Member

Someone got a bit cython crazy.

@jnothman jnothman changed the title COSMIT Avoid writing out vectorizable operations in sparsefuncs COSMIT Avoid writing out vectorizable operations in sparsefuncs_fast Feb 10, 2018
@jnothman
Copy link
Copy Markdown
Member Author

I think 1 review is fine for this if it gets a green tick.

@jnothman jnothman mentioned this pull request Feb 10, 2018
4 tasks
Copy link
Copy Markdown
Member Author

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

I don't understand how yet, but apparently there are test failures due to numerical instability :(

Copy link
Copy Markdown
Member Author

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

No, due to missed parentheses, not numerical instability.

Copy link
Copy Markdown
Member Author

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

This one should be trivial to review

Copy link
Copy Markdown
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Actually I'm wondering: is writing a for loop in cython for a sum of two numpy arrays is strictly equivalent from the performance perspective to adding them via the numpy API?

@jnothman
Copy link
Copy Markdown
Member Author

is writing a for loop in cython for a sum of two numpy arrays is strictly equivalent from the performance perspective to adding them via the numpy API?

Numpy may have a little more overhead in checking inputs, but is often more efficient in the calculation of vectorised operations.

@rth
Copy link
Copy Markdown
Member

rth commented Feb 12, 2018

Numpy may have a little more overhead in checking inputs, but is often more efficient in the calculation of vectorised operations.

Right, due to BLAS I imagine.

I think 1 review is fine for this if it gets a green tick.

LGTM, merging. Thanks @jnothman !

@rth rth merged commit ef99996 into scikit-learn:master Feb 12, 2018
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.

2 participants