{"id":24722,"library":"torch-ort","title":"Torch-ORT","description":"torch-ort accelerates PyTorch models using ONNX Runtime. Version 1.19.2 supports PyTorch 2.x and ONNX Runtime 1.19.x. Released monthly in sync with ONNX Runtime.","status":"active","version":"1.19.2","language":"python","source_language":"en","source_url":"https://github.com/pytorch/ort","tags":["pytorch","onnx-runtime","acceleration","inference","training"],"install":[{"cmd":"pip install torch-ort","lang":"bash","label":"PyPI"}],"dependencies":[{"reason":"Required for model export and execution.","package":"torch","optional":false},{"reason":"Runtime for executing ONNX models.","package":"onnxruntime","optional":false}],"imports":[{"note":"Common alias is not needed; just use ORTModule directly.","wrong":"from torch_ort import ORTModule as ORT","symbol":"ORTModule","correct":"from torch_ort import ORTModule"},{"note":"Function name changed in v1.10.0.","wrong":"from torch_ort import ort_enable_training","symbol":"enable_training","correct":"from torch_ort import enable_training"}],"quickstart":{"code":"import torch\nfrom torch_ort import ORTModule\n\nmodel = torch.nn.Linear(10, 5)\nort_model = ORTModule(model)\n\nx = torch.randn(3, 10)\noutput = ort_model(x)\nprint(output)","lang":"python","description":"Wrap a PyTorch model with ORTModule to accelerate inference/training via ONNX Runtime."},"warnings":[{"fix":"Upgrade onnxruntime to 1.14+ or pin torch-ort to <1.14.0.","message":"Breaking change: torch-ort v1.14+ requires ONNX Runtime 1.14+. Older ONNX Runtime installations will cause import errors.","severity":"breaking","affected_versions":">=1.14.0"},{"fix":"Remove calls to enable_training; ORTModule now auto-detects training vs inference.","message":"The 'enable_training' function is deprecated since v1.15.0. Training mode is automatically detected.","severity":"deprecated","affected_versions":">=1.15.0"},{"fix":"Test model with ORTModule and fallback to native PyTorch if unsupported ops are encountered. Use ort_model.debug() to trace unsupported operators.","message":"ORTModule does not support all PyTorch operations. Custom autograd.Function subclasses may fail silently.","severity":"gotcha","affected_versions":"all"},{"fix":"Convert model _before_ training or after final eval to avoid key mismatch. Use model.load_state_dict on the original model, not the ORTModule-wrapped one.","message":"Models must be in eval mode before conversion? No, ORTModule works in both train and eval, but state dict keys may change if you convert mid-training.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.19':22 '1.19.2':14 '2':17 'acceler':7,35 'infer':36 'model':9 'month':25 'onnx':11,20,29,33 'onnx-runtim':32 'ort':3,6 'pytorch':8,16,31 'releas':24 'runtim':12,21,30,34 'support':15 'sync':27 'torch':2,5 'torch-ort':1,4 'train':37 'use':10 'version':13 'x':18,23","created_at":"2026-05-01T08:14:35.171083+00:00","updated_at":"2026-05-01T08:14:35.171083+00:00","problems":{"verify_error":"× No solution found when resolving dependencies:\n  ╰─▶ Because onnxruntime-training==1.19.2 has no wheels with a matching\n      Python ABI tag (e.g., `cp312`) and onnxruntime-training<=1.19.1 has no\n      wheels with a matching Python ABI tag (e.g., `cp312`), we can conclude\n      that onnxruntime-t"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.19.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/pytorch/ort","docs":null,"changelog":null,"pypi":"https://pypi.org/project/torch-ort/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-06","install_tag":null}}