-
Notifications
You must be signed in to change notification settings - Fork 157
Lazy load code modules #269
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
Lazy load code modules #269
Conversation
cba8d04
to
9fba2b7
Compare
/ok to test |
/ok to test |
@@ -7,20 +7,12 @@ | |||
# is strictly prohibited. | |||
|
|||
import pytest | |||
from conftest import can_load_generated_ptx |
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.
My understanding is that we don't need explicit imports for things from conftest?
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 believe this only aplies to fixtures. helper functions still need to be imported. This is what my research and tests have shown.
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 could add a new file called utils, or helpers and import that instead. There is mixed opinions on best practice online
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 is what my research and tests have shown.
I was only relying on chatgpt before. It told me the imports are not needed. If that's not true: keeping it simple seems best to me, unless you anticipate that we're accumulating many helper functions. I.e. just keep what you have?
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.
yeah, it told me that too, then changed its mind. Keeping it simple was my idea as well, with only 1 helper function, it seems premature to split it into a new file, but perhaps down the line it will make sense
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.
yeah we can move it to tests/utils
next time we touch this file
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.
LGTM (assuming the explicit conftest imports are removed).
Co-authored-by: Leo Fang <[email protected]>
/ok to test |
FYI, the PR title can be renamed |
if isinstance(module, str): | ||
# TODO: this option is only taken by the new library APIs, but we have | ||
# a bug that we can't easily support it just yet (NVIDIA/cuda-python#73). | ||
if jit_options is not None: | ||
raise ValueError | ||
module = module.encode() |
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.
good catch thanks
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.
don't thank me, thank the good folks at ruff
/ok to test |
/ok to test |
load modules in CodeObject lazily
close #268