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

C++ Model Container #249

Merged
merged 41 commits into from
Jul 21, 2017
Merged

C++ Model Container #249

merged 41 commits into from
Jul 21, 2017

Conversation

Corey-Zumar
Copy link
Contributor

No description provided.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/541/
Test FAILed.

@dcrankshaw
Copy link
Contributor

Looks great! Let me know when it's ready for review.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/547/
Test PASSed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/548/
Test FAILed.

@Corey-Zumar
Copy link
Contributor Author

@dcrankshaw This is ready for review.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/582/
Test PASSed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/583/
Test FAILed.

Copy link
Contributor Author

@Corey-Zumar Corey-Zumar left a comment

Choose a reason for hiding this comment

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

@dcrankshaw Addressed your comments

@@ -170,7 +170,7 @@ RPC requests sent from Clipper to model containers are divided into two categori
### Serializing Prediction Requests
1. All requests begin with a 32-bit integer header, sent as a single ZeroMQ message. The value of this integer will be 0, indicating that the request is a prediction request.

2. The second ZeroMQ message contains the size of the input header, in bytes, as a 64-bit long. This is the size of the content of the third ZeroMQ message.
2. The second ZeroMQ message contains the size of the input header, in bytes, as a 32-bit integer. This is the size of the content of the third ZeroMQ message.
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 didn't realize that a C++ long is equivalent to a uint32_t, so the correct input header input type has always been 32-bit integer and the docs need this correction.

}

const std::vector<Input<D>> get_string_inputs(
const std::vector<int>& /*input_header*/, long input_content_size) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly. See the bottom of the "Serializing Prediction Requests" section of container_implementation.md

@@ -17,6 +17,7 @@ using QueryId = long;
using FeedbackAck = bool;

enum class InputType {
Invalid = -1,
Copy link
Contributor Author

@Corey-Zumar Corey-Zumar Jul 20, 2017

Choose a reason for hiding this comment

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

I added the Invalid type to for the purpose of defining the input_trait struct in container_rpc.hpp. This trait allows us to infer the InputType enum categorization for the based on the type of Input<D> that a user's model is parameterized with (ByteVector, DoubleVector).

[this, clipper_address, &model, model_name, model_version]() {
serve_model(model, model_name, model_version, clipper_address);
});
serving_thread_.detach();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

template <typename D>
void serve_model(Model<Input<D>>& model, std::string model_name,
int model_version, std::string clipper_address) {
zmq::context_t context(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The context is responsible for initializing and providing IO threads used by ZMQ socket s(See http://api.zeromq.org/2-1:zmq-cpp # Context).

The 1 indicates that our context has a single IO thread. I've added documentation to this effect.

int num_splits = input_header[1] - 1;
std::vector<Input<D>> inputs;
int prev_split = 0;
// Iterate from the beginning of the input data content
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. This should say "input header content" instead of "input data content". Fixed.

int prev_split = 0;
// Iterate from the beginning of the input data content
// (the first two elements of the header are metadata)
for (int i = 2; i < num_splits + 2; i++) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

// Do nothing for now
break;

default: break;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an exception

log_error_formatted(
LOGGING_TAG_CONTAINER,
"Received erroneous new container message from Clipper!");
default: break;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done - added an exception

break;

case RequestType::FeedbackRequest:
// Do nothing for now
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added an exception

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/584/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/585/
Test FAILed.

@Corey-Zumar
Copy link
Contributor Author

@dcrankshaw Build is failing due to code format violations that the format_code script isn't catching on my machine. Can you try formatting when you get a chance?

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/586/
Test FAILed.

@AmplabJenkins
Copy link

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/587/
Test FAILed.

Copy link
Contributor

@dcrankshaw dcrankshaw left a comment

Choose a reason for hiding this comment

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

This looks good to me. I formatted the code so as long as the tests pass I'll merge this.

@dcrankshaw
Copy link
Contributor

jenkins test this please

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/Clipper-PRB/588/
Test PASSed.

@dcrankshaw dcrankshaw merged commit 9f396e0 into ucbrise:develop Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants