mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-20 19:12:24 +00:00
DML EP temporarily fall back to CPU for LayerNorm when Bias is not present (#12987)
* Temporarily fall back to CPU for LayerNorm * Build fix * Typo * TYPO Co-authored-by: Sumit Agarwal <sumitagarwal@microsoft.com>
This commit is contained in:
parent
9f6646f11d
commit
709254949a
2 changed files with 7 additions and 4 deletions
|
|
@ -54,14 +54,17 @@ public:
|
|||
|
||||
void CALLBACK QueryLayerNormalization(IMLOperatorSupportQueryContextPrivate* context, /*out*/ bool* isSupported)
|
||||
{
|
||||
*isSupported = true;
|
||||
*isSupported = false;
|
||||
|
||||
// Mean and InvStdDev are not supported outputs.
|
||||
if (context->GetOutputCount() > 1)
|
||||
// If only Scale tensor is present then fall back to CPU. This is temporary until
|
||||
// DML1.9.2 or DML1.10 gets released.
|
||||
if (context->GetInputCount() < 3 || context->GetOutputCount() > 1)
|
||||
{
|
||||
*isSupported = false;
|
||||
return;
|
||||
}
|
||||
|
||||
*isSupported = true;
|
||||
}
|
||||
|
||||
DML_OP_DEFINE_CREATION_FUNCTION(LayerNormalization, DmlOperatorLayerNormalization);
|
||||
|
|
|
|||
|
|
@ -592,7 +592,7 @@ namespace OperatorHelper
|
|||
int32_t transBatch,
|
||||
int32_t transpose)
|
||||
{
|
||||
const uint32_t dimensionCount = sizes.size();
|
||||
const uint32_t dimensionCount = gsl::narrow_cast<uint32_t>(sizes.size());
|
||||
std::vector<uint32_t> newStrides(dimensionCount);
|
||||
std::vector<uint32_t> newSizes(sizes.begin(), sizes.end());
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue