-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Enable the C wrapper to extract model to memory and initialize model from memory #1189
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@eisber I thought you had looked into RAM-based model storage in the past? What's the status? |
You’ll have to implement something like https://github.com/JohnLangford/vowpal_wabbit/blob/master/cs/cli/clr_io_memory.h
save_load_header takes in an io_buf: https://github.com/JohnLangford/vowpal_wabbit/blob/master/vowpalwabbit/parse_regressor.h#L19
…-Markus
|
Yes, the PR includes |
I'm hazy on an important detail here. @eisber is this functionality already there? If not, why is there an interface? |
@JohnLangford it's not there yet. It's only in the C# side. I think this is good. |
Merged in, thanks. |
JohnLangford
pushed a commit
that referenced
this pull request
May 3, 2017
* Add prerequisites: zlib-devel (or zlib1g-dev) (#1226) * Added zlib-devel (or zlib1g-dev) to Prerequisites * Update README.md * do not use deprecated sklearn module (#1223) * Enable the C wrapper to extract model to memory and initialize model from memory (#1189) * extract model to memory and initialize model from memory * add get_confidence C wrapper function * JNI concurrent interface extensions (#1215) * replaced NativeUtils with Java's own library loader; Added MulticlassMultilabel Interface to JNI; generated OS dependant lib files; modified pom to include generated lib file in java library path; removed unused variable in multiclassleaner; * Since an instance of vw model is not thread safe for multiple predictions in parallel, we introduce a concurrent learner (for multilabel and multiline multiclass learners) that works with a pool of learners to get high throughput for predictions in an online setting. * Learner pool now creates vw instances of the same model using seed_vw_model method instead of initialize. Former method reuses shared variables from the seed learner instance and hence has much less memory footprint in comparison to latter which allocates new memory for all new instances created. * Fixed space alignment issue and changed getLearner api to return Optional to stop any unwanted NPEs. * Removed TODO as we now use seed_vw_model to instantiate multiple learner instances of the same model. * remove java8 components * added method to return Future in abstract concurrent predictor; added method to create concurrent predictor using thread pool and predictor pool of same size in factory; * tweaks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This workaround allows library users to load and store the model directly without using the file system.