mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-30 20:18:08 +00:00
replace std::numeric_limits<T> by cub::FpLimits<T> (#10703)
This commit is contained in:
parent
9a22b5d253
commit
c51b500ca7
1 changed files with 5 additions and 4 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "beam_search_impl.h"
|
||||
#include "core/providers/cuda/cuda_common.h"
|
||||
#include "core/providers/cuda/cu_inc/common.cuh"
|
||||
#include "cub/util_type.cuh"
|
||||
|
||||
namespace onnxruntime {
|
||||
namespace contrib {
|
||||
|
|
@ -109,27 +110,27 @@ __global__ void LogitsProcessKernel(
|
|||
}
|
||||
|
||||
if (found) {
|
||||
next_token_scores[index] = std::numeric_limits<T>::lowest();
|
||||
next_token_scores[index] = cub::FpLimits<T>::Lowest();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// VocabMaskLogitsProcessor
|
||||
if (vocab_mask != nullptr && vocab_mask[word_id] == 0) {
|
||||
next_token_scores[index] = std::numeric_limits<T>::lowest();
|
||||
next_token_scores[index] = cub::FpLimits<T>::Lowest();
|
||||
return;
|
||||
}
|
||||
|
||||
// PrefixVocabMaskLogitsProcessor
|
||||
int batch_id = batch_beam_index / num_beams;
|
||||
if (prefix_vocab_mask != nullptr && prefix_vocab_mask[batch_id * vocab_size + word_id] == 0) {
|
||||
next_token_scores[index] = std::numeric_limits<T>::lowest();
|
||||
next_token_scores[index] = cub::FpLimits<T>::Lowest();
|
||||
return;
|
||||
}
|
||||
|
||||
// MinLengthLogitsProcessor
|
||||
if (word_id == demote_token_id) {
|
||||
next_token_scores[index] = std::numeric_limits<T>::lowest();
|
||||
next_token_scores[index] = cub::FpLimits<T>::Lowest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue