-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add exception manager to handle options which aren't covered in all CTK versions #371
base: main
Are you sure you want to change the base?
Add exception manager to handle options which aren't covered in all CTK versions #371
Conversation
/ok to test |
/ok to test |
if culink_backend: | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't know the behavior of return
in a function decorated by contextmanager
. I don't think the semantics is documented? Perhaps this is what you are after?
if not culink_backend:
skip_version_specific_linker_options = ... # this decorated function, but without the return
else:
skip_version_specific_linker_options = nullcontext
https://docs.python.org/3/library/contextlib.html#contextlib.nullcontext
except nvjitlink.nvJitLinkError as e: | ||
if e.status == nvjitlink.Result.ERROR_UNRECOGNIZED_OPTION: | ||
pytest.skip("current nvjitlink version does not support the option provided") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- this probably needs a reraise when the error code is not unrecognized option:
except nvjitlink.nvJitLinkError as e: | |
if e.status == nvjitlink.Result.ERROR_UNRECOGNIZED_OPTION: | |
pytest.skip("current nvjitlink version does not support the option provided") | |
except nvjitlink.nvJitLinkError as e: | |
if e.status == nvjitlink.Result.ERROR_UNRECOGNIZED_OPTION: | |
pytest.skip("current nvjitlink version does not support the option provided") | |
else: | |
raise |
- I am wondering if this check should be moved to
_exception_manager()
in_linker.py
? WDYT?
except Exception as e: | ||
raise e |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be removed entirely
except Exception as e: | |
raise e |
This change skips tests when a specific nvjitlink exception is raised for invalid option, which happens if the option is invalid, or if the option is invalid for the given CTK.
I think we should also add cuda 12.4 to the test matrix because <21.3 targets the culink backend, and cuda 12.6 has options which aren't part of 12.4