Add DML support to the transformers benchmark.py script (#13776)

### Description
Add DML support to the transformers benchmark.py script



### Motivation and Context
Before this change, running the `benchmark.py` script when the
`onnxruntime-directml` package is installed resulted in an error because
it expects a CUDA or ROCM framework.
This commit is contained in:
Patrice Vignola 2022-11-29 18:57:52 -08:00 committed by GitHub
parent 29ed8811e5
commit 08ed09d20b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,9 +118,10 @@ def run_onnxruntime(
use_gpu
and ("CUDAExecutionProvider" not in onnxruntime.get_available_providers())
and ("ROCMExecutionProvider" not in onnxruntime.get_available_providers())
and ("DmlExecutionProvider" not in onnxruntime.get_available_providers())
):
logger.error(
"Please install onnxruntime-gpu package instead of onnxruntime, and use a machine with GPU for testing gpu performance."
"Please install onnxruntime-gpu or onnxruntime-directml package instead of onnxruntime, and use a machine with GPU for testing gpu performance."
)
return results