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
Adds nvcc as a RawKernel backend #1941
Conversation
Thank you for the PR and I'm sorry for late review. Does it have to rely on |
I discussed with @okuta and agreed to support NVCC in RawKernel.
|
Thanks for the suggestions. I'll try find some time to incorporate them in the next while. |
I think this is now almost ready. One thing I'm still not quite sure how to handle with the nvcc route is the _preprocess call. Any suggestions on how to handle this? |
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.
Sorry for late review. LGTM except this comment.
Jenkins, test this please |
Jenkins CI test (for commit a63b2a8, target branch master) failed with status FAILURE. |
Will take a look at the test case failures. |
Those failures in Those in |
OK so the test cases are failing because of a problem that I ran into previously. It doesn't seem possible to decode the test case cubin bytes produced by nvcc into unicode, as there's some byte that causes a failure in translation. So the following with codecs.open(cubin_path, 'rb', encoding='utf-8') as bin_file:
return bin_file.read() produces:
Without this conversion, it's not possible for the cubin to interact with other unicode variables in compiler.py. Could someone with more unicode experience advise on how to handle this situation? |
I am not familiar with unicode either, but does the follow piece of code help? It describes how a unicode object is generated from the ptx: Lines 111 to 127 in f85374d
|
Thanks for the suggestion of removing the trailing null, but unfortunately it still fails on the byte at position 18. |
Having thought about this a bit more, I think the issue is that |
OK, got it working. |
Thanks. |
Jenkins CI test (for commit 5b205f3, target branch master) failed with status FAILURE. |
The failure seems relevant. |
@niboshi I've been taking a look at the logs. Somewhat difficult to diagnose as it's failing on python2 but succeeding on python3. It also succeeds on python2 on my machine. The error is:
This seems to be a somewhat broad range of errors. For example:
|
OK. |
Successfully created a job for commit d4ff126: |
Jenkins CI test (for commit d4ff126, target branch master) failed with status FAILURE. |
Jenkins confirmed this fix btw. |
This comment has been minimized.
This comment has been minimized.
8415293
to
d4ff126
Compare
@niboshi I did four things:
I suspect there're some subtle cubin shadowing in the PY2 failure. Not sure if the changes 2 & 3 would fix it, but they're necessary anyway. Could you kick off Jenkins again for me please? Sorry for keeping bugging you. Thanks. |
chainer/chainer-test#523 has been merged. @leofang Sure, sorry for delay. |
Successfully created a job for commit 45534ae: |
Jenkins CI test (for commit 45534ae, target branch master) succeeded! |
Ah, too bad PY2 is disabled! I'd love to know where it was fixed...Anyway, thanks for moving forward @niboshi. |
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.
Thank you. LGTM except some cosmetics.
Co-Authored-By: niboshi <niboshi000@gmail.com>
Thank you, @niboshi. Just committed. |
@leofang Thanks for taking over the PR! |
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.
Thanks!
Jenkins, test this please |
Successfully created a job for commit a3f1703: |
Jenkins CI test (for commit a3f1703, target branch master) succeeded! |
Thanks to @sjperkins for laying the groundwork and to @niboshi for your help and patience! |
Adds nvcc as a backend for RawKernel (issue #1928). The nvcc.py is a cut and paste of much of the functionality in
cupy_setup_build.py
andinstall/*.py
-- I've avoided refactoring this at the moment as I'd like to invite input as to whether you think this PR is useful.