Skip to content

Conversation

@tatevikstep
Copy link
Contributor

Added support for input of type: { "input_batch" := [[double] | [int] | [byte] | [float] | string] }

Source code changes:

  • query_frontend.hpp
  • json_util.cpp/hpp
  • query_frontend_tests.cpp

Added testing for:

  • Batch inputs of type: [[double] | [int] | [float] | string]
  • Expected error message on malformed batch inputs (non-matching types)

Questions/Still to-do:

  • No testing for:
    • Input batch of type [[byte]]. There's no testing for type [byte] either, I think because EXPECT_EQ() doesn't take binary inputs
    • Return batch predictions only after all queries are processed
  • Some error messages/comments aren't updated to show the acceptable input formats

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@dcrankshaw
Copy link
Contributor

jenkins ok to test

@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/786/
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/788/
Test FAILed.

@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/793/
Test PASSed.

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. There are a couple things that you should add:

  • Add an integration test that uses the batch prediction interface for end-to-end queries. Just add another test like this one that sends batch predictions and checks to make sure the right number of predictions are returned.
  • Add an example of querying Clipper using the batch prediction interface to the examples directory and add a subsection to the Clipper documentation here that explains the batch prediction interface.

*/
* Returns the value corresponding to `key` in `config` as a long
*/
long get_long(const std::string &key,
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert these changes (to keep the commit history clean).

*/
* @return `true` if the received heartbeat is a request for container
* metadata. `false` otherwise.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Revert

final_content += content + "\n";
} catch (const std::exception& e) {
// case: returned a response before all predictions in the
// batch were ready
Copy link
Contributor

Choose a reason for hiding this comment

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

Log this error

predictions
.then([response,
app_metrics](std::vector<folly::Try<Response>> tries) {
std::string final_content;
Copy link
Contributor

Choose a reason for hiding this comment

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

Use a std::stringstream to accumulate the full response.

app_metrics.throughput_->mark(1);

std::string content = get_prediction_response_content(r);
final_content += content + "\n";
Copy link
Contributor

Choose a reason for hiding this comment

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

This will turn into a stringstream appends (e.g. final_content << content << "\n";)

auto prediction = query_processor_.predict(
Query{name, uid, input, latency_slo_micros, policy, models});
predictions.push_back(std::move(prediction));
} else { // d.HasMember("input_batch") instead
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to explicitly check for d.hasMember("input_batch") here, rather than leaving it as an else statement?


/**
* Issues a command to Redis and checks return code.
* \return Returns true if the command was successful.
Copy link
Contributor

Choose a reason for hiding this comment

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

revert all these whitespace changes

* \param `msg`: A vector of individual messages to send to this container.
* The messages will be sent as a single, multi-part ZeroMQ message so
* it is very efficient.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

revert

@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/800/
Test FAILed.

Tatevik Stepanyan added 2 commits November 30, 2017 17:12
@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/801/
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/802/
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/803/
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/808/
Test FAILed.

@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/810/
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/811/
Test FAILed.

@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/821/
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/822/
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.

LGTM

@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/823/
Test PASSed.

@dcrankshaw dcrankshaw merged commit 193cf8b into ucbrise:develop Jan 4, 2018
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