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

Added support for custom types in PTX parser #17861

Merged
merged 9 commits into from
Feb 5, 2025

Conversation

lamarrr
Copy link
Contributor

@lamarrr lamarrr commented Jan 29, 2025

Description

The PTX parser currently enforces a signature for each parameter.
It requires that the function have the following properties:

  • The first parameter is an output pointer type, void *
  • The other parameters are void const * pointers (if specified) or int32 (if unspecified and unused)

As you can imagine, this is very limiting for any use beyond what it was initially designed for.

This merge request removes the constraint totally and lets the user specify the types of the parameters.
This is needed for more flexible code-gen in UDFs, i.e. defining a function that transforms multiple columns into a single output column using an index as the first parameter is impossible with this limitation.

Note that the register types and sizes are checked against the parameter types during the compilation process.
There's also only a minimal level of safety that can be guaranteed given we are translating from PTX back to CUDA and much of the type information is lost in the process.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Copy link

copy-pr-bot bot commented Jan 29, 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.

@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Jan 29, 2025
@lamarrr lamarrr added non-breaking Non-breaking change improvement Improvement / enhancement to an existing function labels Jan 29, 2025
@lamarrr lamarrr marked this pull request as ready for review January 29, 2025 19:07
@lamarrr lamarrr requested a review from a team as a code owner January 29, 2025 19:07
@davidwendt
Copy link
Contributor

Probably should move this to 25.04 since 25.02 is in burndown.

@lamarrr lamarrr changed the base branch from branch-25.02 to branch-25.04 January 31, 2025 13:42
@GregoryKimball GregoryKimball added the 4 - Needs Review Waiting for reviewer to review or respond label Feb 4, 2025
@shrshi shrshi self-requested a review February 4, 2025 18:18
cpp/src/jit/parser.hpp Outdated Show resolved Hide resolved
cpp/src/jit/parser.cpp Outdated Show resolved Hide resolved
cpp/src/jit/parser.hpp Show resolved Hide resolved
cpp/src/jit/parser.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@shrshi shrshi left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@shrshi
Copy link
Contributor

shrshi commented Feb 4, 2025

/ok to test

@lamarrr
Copy link
Contributor Author

lamarrr commented Feb 5, 2025

/merge

@rapids-bot rapids-bot bot merged commit aa54f5f into rapidsai:branch-25.04 Feb 5, 2025
108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - Needs Review Waiting for reviewer to review or respond improvement Improvement / enhancement to an existing function libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants