Skip to content

Change RuntimeError to ImportError - #17380

Merged
pengwa merged 1 commit into
mainfrom
baijumeswani/fix-win-mac-training-cpu-package-import
Sep 1, 2023
Merged

Change RuntimeError to ImportError#17380
pengwa merged 1 commit into
mainfrom
baijumeswani/fix-win-mac-training-cpu-package-import

Conversation

@baijumeswani

Copy link
Copy Markdown
Contributor

The onnxruntime-validation for ORTModule checks for ImportError:

except ImportError:
# ORTModule not present
has_ortmodule = False

If any other kind of error is raised, it does not silently fail and will raise an exception. This causes a problem when ortmodule is explicitly not made available on win/mac packages since we currently raise a RuntimeError.

Resolves issue: microsoft/onnxruntime-training-examples#161

@baijumeswani baijumeswani added the training issues related to ONNX Runtime training; typically submitted using template label Aug 31, 2023
@baijumeswani
baijumeswani requested review from askhade and pengwa August 31, 2023 22:54
@pengwa
pengwa merged commit 8b98eca into main Sep 1, 2023
@pengwa
pengwa deleted the baijumeswani/fix-win-mac-training-cpu-package-import branch September 1, 2023 01:56
@baijumeswani

Copy link
Copy Markdown
Contributor Author

Thank you so much @pengwa :)

@natke natke added the triage:approved Approved for cherrypicks for release label Sep 1, 2023
Lafi7e pushed a commit that referenced this pull request Sep 1, 2023
The `onnxruntime-validation` for ORTModule checks for `ImportError`:


https://github.com/microsoft/onnxruntime/blob/44101e877125eaa18e191793973a4e1a002c6eca/onnxruntime/python/onnxruntime_validation.py#L73-L75

If any other kind of error is raised, it does not silently fail and will
raise an exception. This causes a problem when ortmodule is explicitly
not made available on win/mac packages since we currently raise a
RuntimeError.

Resolves issue:
microsoft/onnxruntime-training-examples#161
snnn pushed a commit that referenced this pull request Sep 7, 2023
Cherry-pick 2nd round for 1.16.0 release.
PR List:

#17201
#17270
#17311
#17315
#17320
#17326
#17355
#17227
#17380
#17386
kleiti pushed a commit to kleiti/onnxruntime that referenced this pull request Mar 22, 2024
The `onnxruntime-validation` for ORTModule checks for `ImportError`:


https://github.com/microsoft/onnxruntime/blob/44101e877125eaa18e191793973a4e1a002c6eca/onnxruntime/python/onnxruntime_validation.py#L73-L75

If any other kind of error is raised, it does not silently fail and will
raise an exception. This causes a problem when ortmodule is explicitly
not made available on win/mac packages since we currently raise a
RuntimeError.

Resolves issue:
microsoft/onnxruntime-training-examples#161
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

training issues related to ONNX Runtime training; typically submitted using template triage:approved Approved for cherrypicks for release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants