Skip to content

Commit

Permalink
Clarify "--data-directory" flag (triton-inference-server#587)
Browse files Browse the repository at this point in the history
* Clarify "--data-directory" flag

* User provided data must match expected byte size
  • Loading branch information
GuanLuo authored and deadeyegoodwin committed Aug 27, 2019
1 parent fe18fb0 commit 98e472b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/clients/c++/concurrency_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,12 @@ ConcurrencyManager::PrepareInfer(
// if available, use provided data instead
auto it = input_data_.find(input->Name());
if (it != input_data_.end()) {
if (batch1_size > it->second.size()) {
if (batch1_size != it->second.size()) {
return nic::Error(
ni::RequestStatusCode::INVALID_ARG,
"input '" + input->Name() + "' requires " +
std::to_string(batch1_size) +
" bytes for each batch, but provided data only has " +
" bytes for each batch, but provided data has " +
std::to_string(it->second.size()) + " bytes");
}
data = (const uint8_t*)&(it->second)[0];
Expand Down
4 changes: 3 additions & 1 deletion src/clients/c++/perf_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ Usage(char** argv, const std::string& msg = std::string())
<< " be a binary file for each input required by the model."
<< " The file must be named the same as the input and must contain data"
<< " required for sending the input in a batch-1 request. The perf client"
<< " will reuse the data to match the specified batch size." << std::endl;
<< " will reuse the data to match the specified batch size."
<< " Note that the files should contain only the raw binary"
<< " representation of the data in row major order." << std::endl;

exit(1);
}
Expand Down

0 comments on commit 98e472b

Please sign in to comment.