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

discard serial number update if discarding inference request #318

Merged
merged 3 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/image_inference_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class image_inference_impl : public image_inference, base_impl {
boost::scoped_ptr<std::thread> inference_thread_;
boost::scoped_ptr<torchserve_client> torchserve_client_;
boost::lockfree::spsc_queue<output_item_type> inference_q_{MAX_INFERENCE};
boost::lockfree::spsc_queue<std::string> json_q_{MAX_INFERENCE};
boost::lockfree::spsc_queue<std::string> json_q_{MAX_INFERENCE * 2};
boost::scoped_ptr<cv::Mat> cmapped_buffer_, resized_buffer_,
normalized_buffer_;

Expand Down
1 change: 1 addition & 0 deletions lib/iq_inference_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ void iq_inference_impl::process_items_(COUNT_T power_in_count,
if (background_) {
if (!inference_q_.push(output_item)) {
delete_output_item_(output_item);
--serial_;
if (host_now_() - last_full_time_ > 5) {
d_logger->error(
"inference queue full (increase inference dB threshold "
Expand Down
2 changes: 1 addition & 1 deletion lib/iq_inference_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class iq_inference_impl : public iq_inference, base_impl {
boost::lockfree::capacity<MAX_INFERENCE>>
inference_q_;
boost::lockfree::queue<std::string *,
boost::lockfree::capacity<MAX_INFERENCE>>
boost::lockfree::capacity<MAX_INFERENCE * 2>>
json_q_;
boost::shared_ptr<boost::asio::io_service> io_service_;
boost::shared_ptr<boost::asio::io_service::work> work_;
Expand Down
Loading