From 7bf451f14afb3ccad924d872e28cb05d18dc277f Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Sat, 13 Jul 2024 05:17:09 +0000 Subject: [PATCH 1/3] batch size. --- lib/iq_inference_impl.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/iq_inference_impl.cc b/lib/iq_inference_impl.cc index 35b3da8f..be61c0d3 100644 --- a/lib/iq_inference_impl.cc +++ b/lib/iq_inference_impl.cc @@ -251,11 +251,9 @@ iq_inference_impl::iq_inference_impl( parse_models(model_server, model_names); io_service_ = boost::make_shared(); work_ = boost::make_shared(*io_service_); - for (COUNT_T i = 0; i < MAX_INFERENCE; ++i) { + for (COUNT_T i = 0; i < min(batch_inference_, MAX_INFERENCE); ++i) { threadpool_.create_thread( boost::bind(&boost::asio::io_service::run, io_service_)); - } - for (COUNT_T i = 0; i < MAX_INFERENCE; ++i) { io_service_->post( boost::bind(&iq_inference_impl::background_run_inference_, this)); } From 9b0ac4456760d3ec5ddf5bfacf0d618824cb1843 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Sat, 13 Jul 2024 05:29:09 +0000 Subject: [PATCH 2/3] min --- lib/iq_inference_impl.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/iq_inference_impl.cc b/lib/iq_inference_impl.cc index be61c0d3..cf3cbecc 100644 --- a/lib/iq_inference_impl.cc +++ b/lib/iq_inference_impl.cc @@ -251,7 +251,7 @@ iq_inference_impl::iq_inference_impl( parse_models(model_server, model_names); io_service_ = boost::make_shared(); work_ = boost::make_shared(*io_service_); - for (COUNT_T i = 0; i < min(batch_inference_, MAX_INFERENCE); ++i) { + for (COUNT_T i = 0; i < std::min(batch_inference_, MAX_INFERENCE); ++i) { threadpool_.create_thread( boost::bind(&boost::asio::io_service::run, io_service_)); io_service_->post( From 62db801e6ddcae4d1fe02930b7b918fdb231f562 Mon Sep 17 00:00:00 2001 From: Josh Bailey Date: Sat, 13 Jul 2024 05:54:07 +0000 Subject: [PATCH 3/3] test. --- python/iqtlabs/qa_iq_inference.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/iqtlabs/qa_iq_inference.py b/python/iqtlabs/qa_iq_inference.py index 82209659..d3348e90 100755 --- a/python/iqtlabs/qa_iq_inference.py +++ b/python/iqtlabs/qa_iq_inference.py @@ -296,7 +296,7 @@ def run_flowgraph(self, n_vlen, fft_size, samp_rate, port, model_name): samp_rate=int(samp_rate), power_inference=True, background=False, - batch=1, + batch=5, ) tb.msg_connect((strobe, "strobe"), (source, "cmd"))