Fix ORT_RETURN condition mistake (#16520)

In #16339, the `ORT_ENFORCE(cuda_device_arch_ >= 530` (throw) it changed
to `ORT_RETURN_IF` (Status) but the condition is negated. This fixes the
problem.
This commit is contained in:
cloudhan 2023-07-06 09:13:13 +08:00 committed by GitHub
parent fed08e070a
commit b84c63db2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 20 deletions

View file

@ -55,11 +55,11 @@ class BeamSearchGpt : public BeamSearchBase<T> {
cuda_device_prop_ = cuda_device_prop;
cuda_device_arch_ = cuda_device_arch;
if (gpt_subgraph_.has_decoder_masked_attention_) {
ORT_RETURN_IF(cuda_device_arch_ >= 530,
"Decoder masked self attention can only be used on "
"GPU cards of compute capability 5.3 or higher. "
"This card has compute capability ",
cuda_device_arch_);
ORT_RETURN_IF_NOT(cuda_device_arch_ >= 530,
"Decoder masked self attention can only be used on "
"GPU cards of compute capability 5.3 or higher. "
"This card has compute capability ",
cuda_device_arch_);
}
return Status::OK();
}

View file

@ -64,11 +64,11 @@ class BeamSearchT5 : public BeamSearchBase<T> {
cuda_device_prop_ = cuda_device_prop;
cuda_device_arch_ = cuda_device_arch;
if (decoder_subgraph_.has_decoder_masked_attention_) {
ORT_RETURN_IF(cuda_device_arch_ >= 530,
"Decoder masked multihead attention can only be used on "
"GPU cards of compute capability 5.3 or higher. "
"This card has compute capability ",
cuda_device_arch_);
ORT_RETURN_IF_NOT(cuda_device_arch_ >= 530,
"Decoder masked multihead attention can only be used on "
"GPU cards of compute capability 5.3 or higher. "
"This card has compute capability ",
cuda_device_arch_);
}
return Status::OK();
}

View file

@ -62,11 +62,11 @@ class BeamSearchWhisper : public BeamSearchBase<T> {
cuda_device_prop_ = cuda_device_prop;
cuda_device_arch_ = cuda_device_arch;
if (decoder_subgraph_.has_decoder_masked_attention_) {
ORT_RETURN_IF(cuda_device_arch_ >= 530,
"Decoder masked multihead attention can only be used on "
"GPU cards of compute capability 5.3 or higher. "
"This card has compute capability ",
cuda_device_arch_);
ORT_RETURN_IF_NOT(cuda_device_arch_ >= 530,
"Decoder masked multihead attention can only be used on "
"GPU cards of compute capability 5.3 or higher. "
"This card has compute capability ",
cuda_device_arch_);
}
return Status::OK();
}

View file

@ -69,11 +69,11 @@ class GreedySearchGpt : public GreedySearchBase<T, ParametersT> {
cuda_device_prop_ = cuda_device_prop;
cuda_device_arch_ = cuda_device_arch;
if (gpt_subgraph_.has_decoder_masked_attention_) {
ORT_RETURN_IF(cuda_device_arch_ >= 530,
"Decoder masked self attention can only be used on "
"GPU cards of compute capability 5.3 or higher. "
"This card has compute capability ",
cuda_device_arch_);
ORT_RETURN_IF_NOT(cuda_device_arch_ >= 530,
"Decoder masked self attention can only be used on "
"GPU cards of compute capability 5.3 or higher. "
"This card has compute capability ",
cuda_device_arch_);
}
return Status::OK();
}