onnxrt.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # This backend is maintained by ONNX team. To direct issues
  2. # to the right people, please tag related GitHub issues with `module: onnx`.
  3. #
  4. # Maintainers' Github IDs: wschin, xadupre
  5. # from torch.onnx._internal.onnxruntime import (
  6. # is_onnxrt_backend_supported,
  7. # torch_compile_backend,
  8. # )
  9. # from .registry import register_backend
  10. """
  11. Placeholder for onnxruntime backend for dynamo
  12. """
  13. # def has_onnxruntime():
  14. # # FIXME: update test/dynamo/test_backends.py to call is_onnxrt_backend_supported()
  15. # return is_onnxrt_backend_supported()
  16. # if is_onnxrt_backend_supported():
  17. # register_backend(name="onnxrt", compiler_fn=torch_compile_backend)
  18. # else:
  19. # def information_displaying_backend(*args, **kwargs):
  20. # raise ImportError(
  21. # "onnxrt is not registered as a backend. "
  22. # "Please make sure all dependencies such as "
  23. # "numpy, onnx, onnxscript, and onnxruntime-training are installed. "
  24. # "Suggested procedure to fix dependency problem:\n"
  25. # " (1) pip or conda install numpy onnx onnxscript onnxruntime-training.\n"
  26. # " (2) Open a new python terminal.\n"
  27. # " (3) Call the API `torch.onnx.is_onnxrt_backend_supported()`:\n"
  28. # " (4) If it returns `True`, then you can use `onnxrt` backend.\n"
  29. # " (5) If it returns `False`, please execute the package importing section in "
  30. # "torch/onnx/_internal/onnxruntime.py under pdb line-by-line to see which import fails."
  31. # )
  32. # register_backend(name="onnxrt", compiler_fn=information_displaying_backend)