Skip to content
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

now compiles in nvcc 10.2 #73

Merged
merged 1 commit into from
Jan 9, 2020
Merged

now compiles in nvcc 10.2 #73

merged 1 commit into from
Jan 9, 2020

Conversation

gridley
Copy link
Contributor

@gridley gridley commented Dec 31, 2019

So, using some xtensor stuff which uses variant.hpp, I was trying to unable to compile stuff with NVCC 10.2 (latest version), and encountered some parsing error in nvcc that is described in this issue and this PR. It seems that part of the issue lies in xtensor-stack's xtl library and also this variant.hpp header file.

This PR just slightly changes an expression in variant.hpp so that the nvcc parser doesn't screw up. I think the code written here is valid beforehand, it's just that nvcc chokes on the parameter pack expansion somewhere.

The error which is encountered before this change, when including variant.hpp is:

gavin@gpad:~/scratch/variant/include/mpark$ nvcc nothing.cu 
variant.hpp: In function ‘constexpr decltype(auto) mpark::visit(Visitor&&, Vs&& ...)’:
variant.hpp:1967:96: error: parameter packs not expanded with ‘...’:
     return (detail::all({!vs.valueless_by_exception()...})
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                     ^                                                                                                      
variant.hpp:1967:96: note:         ‘vs’

No clue why this happens, but the changes here fix it.

@mpark
Copy link
Owner

mpark commented Jan 6, 2020

What the heck...? Not sure why/how this got closed...

@mpark mpark reopened this Jan 6, 2020
@mpark
Copy link
Owner

mpark commented Jan 6, 2020

Oh~ it's because it's trying to merge into the dev branch, and I've been messing with the dev branch! @gridley Could you target this for master please?

@gridley
Copy link
Contributor Author

gridley commented Jan 6, 2020

Whoops, on it in a bit! My apologies!

@gridley gridley changed the base branch from dev to master January 7, 2020 02:19
@gridley
Copy link
Contributor Author

gridley commented Jan 7, 2020

@mpark OK, it's master now.

@mpark
Copy link
Owner

mpark commented Jan 7, 2020

@gridley the changes seem much bigger than it was before. seems like there may have been formatting applied or something?

@gridley
Copy link
Contributor Author

gridley commented Jan 7, 2020

OK, so, maybe now this is ready once tests run.

@mpark
Copy link
Owner

mpark commented Jan 8, 2020

Okay, I've fixed master and re-run the tests for this PR. @ax3l Could you confirm whether this works for you please?

@ax3l
Copy link
Contributor

ax3l commented Jan 8, 2020

I am trying to confirm this fixes my issue as well, but have troubles since the HPC machine (x86) this was found with changed (broke) its software environment recently and I cannot reproduce the original issue on other machines yet (tried on power). Trying to setup another x86 machine/environment today...

@ax3l
Copy link
Contributor

ax3l commented Jan 8, 2020

Ok, I was now able to spin up another env that can reproduce the problem I reported. Sorry for the delay that this caused.
I can confirm the proposed fix in this PR works for me as well and we can close #71 in favour of it. Thanks a lot!

As a side note: I reported the NVCC compiler frontend issue in #70 to Nvidia too and it will be fixed in the next CUDA release as well (latest today: NVCC 10.2.89).

@mpark mpark merged commit 3c7fc82 into mpark:master Jan 9, 2020
ptrblck added a commit to ptrblck/pytorch that referenced this pull request Feb 12, 2020
facebook-github-bot pushed a commit to pytorch/pytorch that referenced this pull request Feb 12, 2020
Summary:
Fixes: #33203
PR based on mpark/variant#73

Verified locally on CUDA10.2.89 and 10.1.243

Thanks ngimel for the hint and gridley for the initial fix in the variant repo! :)
Pull Request resolved: #33230

Differential Revision: D19858083

Pulled By: ngimel

fbshipit-source-id: b9438084f5688712c6aa6b17813c68ccde237bbb
ttumiel pushed a commit to ttumiel/pytorch that referenced this pull request Mar 4, 2020
…33230)

Summary:
Fixes: pytorch#33203
PR based on mpark/variant#73

Verified locally on CUDA10.2.89 and 10.1.243

Thanks ngimel for the hint and gridley for the initial fix in the variant repo! :)
Pull Request resolved: pytorch#33230

Differential Revision: D19858083

Pulled By: ngimel

fbshipit-source-id: b9438084f5688712c6aa6b17813c68ccde237bbb
@gridley gridley deleted the nvcc_compat branch July 6, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants