[NVVM] Expose nvvm version detection in cuda.bindings.utils.#1837
[NVVM] Expose nvvm version detection in cuda.bindings.utils.#1837abhilash1910 wants to merge 7 commits intoNVIDIA:mainfrom
Conversation
|
pre-commit.ci autofix |
| options_list = [opt.decode("utf-8") if isinstance(opt, bytes) else opt for opt in options] | ||
| nvvm.verify_program(program, len(options_list), options_list) | ||
| nvvm.compile_program(program, len(options_list), options_list) | ||
| except Exception: |
There was a problem hiding this comment.
If you're compiling anyway, do you actually need the verify_program() call?
I'm thinking the try should just be around this one line:
try:
nvvm.compile_program(prog, len(options), options)
except nvvm.nvvmError as e:
# can we add something here to ensure we're not masking errors other than invalid options?I believe it's really important to take great care that we're not masking actual errors; e.g. the hard-wired _PRECHECK_NVVM_IR might need tweaks for future GPU generations. If we're simply reporting any error as "invalid compiler option", it'll potentially take someone downstream a long time to drill down all the way back here.
There was a problem hiding this comment.
While I do agree verify_program() is not needed, the location of proposed try could eventually throw as then the destroy_program() call will never get triggered.
What I was thinking is that :
program = nvvm.create_program()
try:
<..rest of code>
nvvm.compile_program()
except nvvm.nvvmError as e:
<exception raising>
finally:
destroy_program()| >>> check_nvvm_options([b"-arch=compute_90", b"-numba-debug"]) | ||
| True # if -numba-debug is supported by the installed libNVVM |
There was a problem hiding this comment.
Could we use a non-numba example here?
|
pre-commit.ci autofix |
Description
Fixes issue #1457 . Provides an api call to
cuda.bindings.utilsto check the version of nvvm.@leofang @rwgk pinging for review.