Skip to content

Commit e8c600e

Browse files
committed
fix: fix a potential synchronize bug when update state
1 parent adb0148 commit e8c600e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/turbomind/layers/sampling_layers/GuidedDecodeUpdateLayer.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
#include "src/turbomind/layers/sampling_layers/GuidedDecodeUpdateLayer.h"
18+
#include "src/turbomind/core/context.h"
1819

1920
namespace turbomind {
2021

@@ -44,6 +45,7 @@ void GuidedDecodeUpdateLayer<T>::Forward(TensorMap& args)
4445
Tensor_<int> output_ids_buf{{bsz}, kCPU};
4546

4647
FT_CHECK(bsz == matchers_.size());
48+
core::Context::stream().Sync();
4749
Copy(output_ids.slice(step * bsz, bsz), output_ids_buf);
4850

4951
for (size_t i = 0; i < bsz; ++i) {

0 commit comments

Comments
 (0)