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

Change cmake virtual and real cuda arch flags to avoid extra JIT compilation #37

Merged
merged 2 commits into from
Mar 15, 2021

Conversation

dantegd
Copy link
Contributor

@dantegd dantegd commented Mar 12, 2021

Closes #36

See issue for a detailed description: #36 (comment)

Will be testing it later today to confirm issues are solved and will change from draft then (it just takes quite a while to compile the conda package locally).

Checklist

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

Copy link
Member

@h-vetinari h-vetinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening this!

Despite having read your explanation, I don't understand why we need to remove the latest arch from ARCHES.

IIUC, the only change would need to be regarding -real vs. -virtual resp. nothing vs -real...?

Edit: on second read, I got it.

@h-vetinari
Copy link
Member

h-vetinari commented Mar 12, 2021

LGTM (except we definitely need to bump the build number), but would appreciate @teju85's input on this

Comment on lines +19 to +27
ARCHES=( "${ARCHES[@]}" 75 80 )
LATEST_ARCH=86
elif [ $(version2int $cuda_compiler_version) -ge $(version2int "11.0") ]; then
# Ampere support for A100 (sm_80) needs cuda >= 11.0
ARCHES=( "${ARCHES[@]}" 75 80 )
ARCHES=( "${ARCHES[@]}" 75 )
LATEST_ARCH=80
elif [ $(version2int $cuda_compiler_version) -ge $(version2int "10.0") ]; then
# Turing support (sm_75) needs cuda >= 10.0
ARCHES=( "${DEPRECATED_IN_11[@]}" "${ARCHES[@]}" 75 )
ARCHES=( "${DEPRECATED_IN_11[@]}" "${ARCHES[@]}" )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dantegd not sure I get why the latest arch's are removed from the lists?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually stumbled over the same point at first sight. But LATEST_ARCH is handled independently from ARCHES, and that's why there's no actual reduction in arch-support

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, originally I got it wrong and the compilation string repeating the last arch, line 34 (inside the loop) adds all the archs with real (i.e. all except the last) and then line 39 adds the last arch without real or virtual (which makes it so it adds both virtual and real for the latest arch) and we end up with the desired

52-real;-60-real;61-real;70-real;75-real;80

(that was the 11.0 example)

@jakirkham
Copy link
Member

Edited OP to make sure the linked issue gets closed out. Hope that is ok 🙂

@dantegd dantegd changed the title WIP Change cmake virtual and real cuda arch flags to avoid extra JIT compilation Change cmake virtual and real cuda arch flags to avoid extra JIT compilation Mar 12, 2021
@dantegd dantegd marked this pull request as ready for review March 12, 2021 21:17
Copy link
Member

@h-vetinari h-vetinari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dantegd!

Any remaining comments @teju85? The selection or ARCHes is correct I believe, the relevant changes that I want to get correctly are more about the <arch>-real vs. <arch>-virtual vs. <arch>

@h-vetinari
Copy link
Member

Ping @teju85

I'm planning to merge this in the next 24h, but your feedback is still welcome even afterwards 🙃

Copy link

@teju85 teju85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. I thought I responded to this! Changes LGTM now.

@h-vetinari h-vetinari merged commit fa9d51d into conda-forge:master Mar 15, 2021
@h-vetinari
Copy link
Member

Thanks a lot @dantegd & @teju85 😊

h-vetinari added a commit to h-vetinari/faiss-split-feedstock that referenced this pull request Mar 15, 2021
h-vetinari added a commit to h-vetinari/faiss-split-feedstock that referenced this pull request Apr 6, 2021
h-vetinari added a commit to h-vetinari/faiss-split-feedstock that referenced this pull request Apr 6, 2021
h-vetinari added a commit to h-vetinari/faiss-split-feedstock that referenced this pull request Apr 6, 2021
h-vetinari added a commit to h-vetinari/faiss-split-feedstock that referenced this pull request Apr 6, 2021
h-vetinari added a commit to h-vetinari/faiss-split-feedstock that referenced this pull request Apr 7, 2021
h-vetinari added a commit to h-vetinari/faiss-split-feedstock that referenced this pull request Apr 7, 2021
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.

CUDA 11 (libfaiss) conda package triggers JIT compilation on Turing GPUs
5 participants