Skip to content

Commit 382fa86

Browse files
fix 0size problem in unzip-zip op (#10755)
Co-authored-by: zhangyuqin <zhangyuqin@baidu.com>
1 parent 7ecb1dc commit 382fa86

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

slm/model_zoo/gpt-3/external_ops/token_dispatcher_utils/tokens_stable_unzip.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ std::vector<paddle::Tensor> tokens_unzip_stable(
246246
}
247247
const int rows = X.shape()[0]; // 一般为seqlen
248248
const int cols = X.shape()[1]; // 一般为7168
249+
if(rows==0)return;
249250
const int quanted_cols = (XScale) ? XScale->shape()[1] : 0;
250251
/*
251252
const int max_tokens_per_expert =

slm/model_zoo/gpt-3/external_ops/token_dispatcher_utils/tokens_unzip_and_zip.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ std::vector<paddle::Tensor> tokens_zip(
747747
unzipped_tokens.dtype() == paddle::DataType::FLOAT32);
748748
const int rows = unzipped_tokens.shape()[0]; // seqlen
749749
const int cols = unzipped_tokens.shape()[1]; // 一般为7168
750+
if(rows==0)return;
750751
const int topk = expert_routemap_topk.shape()[1]; // 一般为8
751752

752753

0 commit comments

Comments
 (0)