Skip to content

Commit 4cd226f

Browse files
committed
pipeline sync
1 parent 645dee1 commit 4cd226f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

csrc/mmdeploy/codebase/mmdet/rtmdet_head.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ static float sigmoid(float x) { return 1.0 / (1.0 + expf(-x)); }
6464
Result<Detections> RTMDetSepBNHead::GetBBoxes(const Value& prep_res,
6565
const std::vector<Tensor>& bbox_preds,
6666
const std::vector<Tensor>& cls_scores) const {
67-
MMDEPLOY_DEBUG("bbox_pred: {}, {}", bbox_preds[0].shape(), dets[0].data_type());
68-
MMDEPLOY_DEBUG("cls_score: {}, {}", scores[0].shape(), scores[0].data_type());
69-
7067
std::vector<float> filter_boxes;
7168
std::vector<float> obj_probs;
7269
std::vector<int> class_ids;

csrc/mmdeploy/triton/instance_state.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "convert.h"
88
#include "json.hpp"
99
#include "mmdeploy/archive/json_archive.h"
10+
#include "mmdeploy/core/device.h"
1011
#include "mmdeploy/core/mat.h"
1112
#include "mmdeploy/core/utils/formatter.h"
1213
#include "mmdeploy_utils.h"
@@ -178,6 +179,15 @@ TRITONSERVER_Error* ModelInstanceState::Execute(TRITONBACKEND_Request** requests
178179
SET_TIMESTAMP(compute_start_ns);
179180

180181
::mmdeploy::Value outputs = pipeline_.Apply(input_args);
182+
{
183+
std::string device_name = "cpu";
184+
if (Kind() == TRITONSERVER_INSTANCEGROUPKIND_GPU) {
185+
device_name = "cuda";
186+
}
187+
auto device = ::mmdeploy::framework::Device(device_name.c_str(), DeviceId());
188+
auto stream = ::mmdeploy::framework::Stream::GetDefault(device);
189+
stream.Wait();
190+
}
181191

182192
std::vector<std::string> strings;
183193
auto output_tensors =
@@ -276,7 +286,7 @@ TRITONSERVER_Error* ModelInstanceState::Execute(TRITONBACKEND_Request** requests
276286
TritonModelInstance(), total_batch_size, exec_start_ns, compute_start_ns,
277287
compute_end_ns, exec_end_ns),
278288
"failed reporting batch request statistics");
279-
#endif // TRITON_ENABLE_STATS
289+
#endif // TRITON_ENABLE_STATS
280290

281291
return nullptr; // success
282292
}

0 commit comments

Comments
 (0)