Skip to content

Conversation

@vyasr
Copy link
Contributor

@vyasr vyasr commented Jun 12, 2025

On arm cufile was not supported until CUDA 12.2, whereas support exists since 12.0 on x86 architectures. To properly reflect these dependencies, we need to build separate variants of cufile on arm for cuda versions before and after 12.2. This PR updates the recipe to support that.

@vyasr vyasr self-assigned this Jun 12, 2025
@vyasr vyasr added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Jun 12, 2025
@copy-pr-bot
Copy link

copy-pr-bot bot commented Jun 12, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@vyasr
Copy link
Contributor Author

vyasr commented Jun 12, 2025

/ok to test

@vyasr
Copy link
Contributor Author

vyasr commented Jun 12, 2025

/ok to test

@vyasr
Copy link
Contributor Author

vyasr commented Jun 13, 2025

/ok to test

@vyasr
Copy link
Contributor Author

vyasr commented Jun 13, 2025

/ok to test

@vyasr
Copy link
Contributor Author

vyasr commented Jun 13, 2025

/ok to test

@vyasr vyasr marked this pull request as ready for review June 13, 2025 02:17
@vyasr vyasr requested review from a team as code owners June 13, 2025 02:17
@vyasr vyasr requested a review from msarahan June 13, 2025 02:17
Copy link
Member

@jakirkham jakirkham left a comment

Choose a reason for hiding this comment

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

Thanks Vyas! 🙏

This looks generally reasonable

Had a few comments below

ci/build_cpp.sh Outdated

# Use sed to replace the RAPIDS_CUDA_VERSION string in the variants file with
# the value of that variable in this shell.
sed -i "s/RAPIDS_CUDA_VERSION/${RAPIDS_CUDA_VERSION}/g" "conda/recipes/libkvikio/variants_$(arch).yaml"
Copy link
Member

Choose a reason for hiding this comment

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

One thing that has worked well before, is to output this to a variant file

It does a similar thing admittedly. Though it can be a bit clearer about what is happening. That could just be personal preference though

Copy link
Contributor

Choose a reason for hiding this comment

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

I like that alternative! I agree it is clearer.

Copy link
Contributor Author

@vyasr vyasr Jun 13, 2025

Choose a reason for hiding this comment

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

I considered this possibility as well. However, in this instance it's not quite so simple as the pynvjitlink example because we need other things to be encoded in the variants as well. The behavior on x86 and arm is different because the former is a single variant while the latter requires two, so we would need to write out variants conditionally based on that. Moreover, for arm we need to use a different compiler version for each CUDA version, so it's a longer file. If you both prefer that I can switch to it, we just wind up with two fairly long here-docs instead of this command. The flip side is that we can drop the committed variants files if we choose to go that route.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've made the changes in 00b642a. If you like it we can stick with it, otherwise feel free to revert that commit.

Comment on lines +15 to +16
#cuda_version: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[:2] | join(".") }}
#cuda_major: '${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[0] }}'
Copy link
Member

Choose a reason for hiding this comment

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

Should we drop these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose to keep them to simplify reverting the changes, but if others feel like it would be cleaner to drop these I am fine with that.

Comment on lines -133 to -135
#else
constexpr int cufile_version() noexcept { return 0; }
#endif
Copy link
Contributor Author

@vyasr vyasr Jun 13, 2025

Choose a reason for hiding this comment

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

This change is necessary because the dead code optimizer will generally elide constexpr functions from the final binary if no runtime usage is detected, but we need the symbol in the DSO for usage from other libraries (including Python extensions). For the same reason we also avoid inlining the definition here.

@vyasr
Copy link
Contributor Author

vyasr commented Jun 13, 2025

/ok to test

@vyasr vyasr requested review from bdice and jakirkham June 13, 2025 13:20
Comment on lines +28 to +58
# Construct the extra variants according to the architecture
if [[ "$(arch)" == "x86_64" ]]; then
cat > variants.yaml << EOF
c_compiler_version:
- 13
cxx_compiler_version:
- 13
cuda_version:
- ${RAPIDS_CUDA_VERSION}
EOF
else
cat > variants.yaml << EOF
zip_keys:
- [c_compiler_version, cxx_compiler_version, cuda_version]
c_compiler_version:
- 12
- 13
cxx_compiler_version:
- 12
- 13
cuda_version:
- 12.1 # The last version to not support cufile
- ${RAPIDS_CUDA_VERSION}
EOF
fi

Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking, but I think this would be better to encode in individual variant_$ARCH_$CUDA_VERSION.yaml files and then the branching logic here can be to select the appropriate variant file for the build at hand.

That way the various build variants are all in the conda recipe file and not hidden away in this bash script.

I'm fine with this being done in a follow-up to get CI unblocked.

Copy link
Contributor

Choose a reason for hiding this comment

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

lol, I see that was your original approach. well, not worth going back and forth over it.

My general take is "repeat yourself" if it keeps things clean, and heredocs in a random bash script isn't worth the tradeoff to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I liked the old way better too. This version feels wrong in how much of the logic is moved out of the recipe itself. I think we should reconsider what approach we like best, but I'll merge as-is to get things unblocked for now.

Copy link
Member

Choose a reason for hiding this comment

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

Provided a simplification on the current approach in PR: #755

Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

Thank you!

@vyasr
Copy link
Contributor Author

vyasr commented Jun 13, 2025

/merge

@rapids-bot rapids-bot bot merged commit c3509ac into rapidsai:branch-25.08 Jun 13, 2025
49 checks passed
@vyasr vyasr deleted the feat/cufile_variants branch June 13, 2025 16:52
@jakirkham jakirkham mentioned this pull request Jun 18, 2025
rapids-bot bot pushed a commit that referenced this pull request Jun 26, 2025
Now that we have dropped support for CUDA 11 we no longer require the nvidia channel.
With the changes in rapidsai/rapids-dask-dependency#85, RAPIDS now only uses released versions of dask, so we no longer need the dask channel either.
This PR also removes the explicit cufile dependence in the kvikio conda packages, which should no longer be necessary now that we have variants of the libkvikio package for different CUDA versions handling this dependency (see #754).

Contributes to rapidsai/build-planning#184

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - James Lamb (https://github.com/jameslamb)

URL: #759
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants