Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PERF Adding multi-output support to PWD implementation in KNeighborsClassifier #3

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

Open
wants to merge 9 commits into
base: pwd_kncp
Choose a base branch
from

Conversation

Micky774
Copy link
Owner

@Micky774 Micky774 commented Aug 9, 2022

Reference Issues/PRs

Follows up work in #24076

What does this implement/fix? Explain your changes.

This PR develops proper multi-output support without wasted memory transfer

Any other comments?

Currently broken due to weird memory issues and segfaults surrounding the use of using vector[memory_view] type structures. Opening this PR to share and get feedback.

@Micky774 Micky774 changed the title Pwd knc/multi output PERF Adding multi-output support to PWD implementation in KNeighborsClassifier Aug 9, 2022
@jjerphan
Copy link

jjerphan commented Aug 9, 2022

I think you can and should use other structures than vector[memory_view]. For instance, using vector[vector] is possible and such structure is coercible to nadarray[nadarray] if needed.

But I would focus our energy later on this PR as scikit-learn#24076 might be structured again with round of reviews.

@da-woods
Copy link

da-woods commented Aug 9, 2022

Just linking a comment for when you come back to this cython/cython#4966 (comment). I proposed using a list of Python objects wrapping memoryviews.

I've only quickly skimmed this PR so I don't know if it actually does what you need though, so feel free to ignore if it isn't relevant.

@jjerphan
Copy link

jjerphan commented Aug 9, 2022

Thanks @da-woods for this proposal.

I read this proposal in the original issue. Here, we might want to have instructions run as much as possible (or even solely) in nogil context for optimal performances. In this case, I do not think it's possible to use Python lists, isn't it?

@da-woods
Copy link

da-woods commented Aug 9, 2022

Here, we might want to have instructions run as much as possible (or even solely) in nogil context for optimal performances. In this case, I do not think it's possible to use Python lists, isn't it?

No I agree. This is the big limitation of that suggestion.

@OmarManzoor
Copy link

@Micky774 Is this implementation in a working state now?

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.

4 participants