Skip to content

COSMIT Avoid writing out vectorizable operations in sparsefuncs_fast #10615

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

Merged
merged 2 commits into from
Feb 12, 2018

Conversation

jnothman
Copy link
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
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
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
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
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
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
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
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