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

initiating RCF3.0 #283

Merged
merged 8 commits into from
Jan 3, 2022
Merged

initiating RCF3.0 #283

merged 8 commits into from
Jan 3, 2022

Conversation

sudiptoguha
Copy link
Contributor

Description of changes: This PR initiates RCF 3.0.

RCF 2.0 introduced multiple primitives, such as bounding box caching, tree representations, columnar compression to provide a space-time tradeoff. However those primitives were not optimized in any manner. RCF 3.0 reorganizes those primitives to provide a more optimal (and hopefully cleaner) tradeoff.

None of the visitor classes were changed and no inference is expected to vary in this PR. There is unlikely to be change in performance of RCF2.0 and RCF3.0 for large model sizes (bounding box cache 1). The RCF 2.0 files were not changed (except minor bug fixes and plumbing to allow direct comparison).

RCF3.0 will focus exclusively on single precision. Double precision calculations over randomized data structures is unlikely to be helpful in the context of RCF. Moreover the newer logic in RCF 3.0 literally "thinks outside the bounding box". While the bounding box description is easy to follow, relying on such descriptions inside an algorithm may be inimical to algorithmic efficiency. We note that efficiency is a key distinguishing feature of RCFs vis-a-vis random forests.

This PR also overhauls the Rust version to the same exact algorithm as the Java version. RCF 2.0 was designed with Rust and memory safely in mind. The parallel implementation underscores that point. We see the Rust version as a mechanism of additional verification of the algorithmic ideas and expect the different language implementations to remain in sync. None of these versions are superior to the other in performance, and we expect to continue to do everything to keep the Java version as performant as possible.

@sudiptoguha sudiptoguha requested a review from jotok December 20, 2021 23:40
*/
@Override
public int decrementRefCount(int index) {
// indexManager.checkValidIndex(index);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be removed or uncommented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed or instantiated to the current notion of valid index, next commit

return false;
}

public BoundingBoxFloat getBox(int index, IPointStoreView<float[]> pointStoreView) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems strange to me to make the point store view a method parameter and not an instance field. By having it as a method argument, that suggests that you should be able to pass any point store view in and get some kind of answer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the 2.0 version called for a more lightweight nodeview -- let me revisit this, it's possible that we can simplify these.


public class RCF3PointStoreLarge extends RCF3PointStore {

static int INFEASIBLE_LOCN = (int) -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

@sudiptoguha I think this bug #322 is caused by this line, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not a bug. The representation of the pointstore changed :) Look at lines 28 and 31-37; the unused locations have value -1. However for the 2.0.1 models the unused valued could have been anything (the check was via refList). I think 1.3 picked up something earlier than 283.

Copy link
Contributor

@ylwu-amzn ylwu-amzn Apr 15, 2022

Choose a reason for hiding this comment

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

Got it. Thanks, agree this is not a bug, just some breaking change compared with RCF jar used by AD 1.3 (PR #282). Should be ok for ml-commons 1.3.1, as it's using PR #309.

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.

3 participants