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

cudf jit parser now supports .pragma instructions with quotes #14348

Merged

Conversation

robertmaynard
Copy link
Contributor

Description

During testing of CUDA 12.3 it was found that python user defined functions could generate .pragma instructions that have quotes, so as "nounroll" and "used_bytes_mask N".

The jit parser now makes sure to escape quotes that are part of a .pragma instruction so that it can be properly passed to nvrtc/jitify as a CUDA header.

Checklist

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

During testing of CUDA 12.3 it was found that python user defined
functions could generate .pragma instructions that have quotes,
so as "nounroll" and "used_bytes_mask N".

The jit parser now makes sure to escape quotes that are part
of a `.pragma` instruction so that it can be properly passed
to nvrtc/jitify as a CUDA header.
@robertmaynard robertmaynard added bug Something isn't working 3 - Ready for Review Ready for review by team non-breaking Non-breaking change labels Oct 31, 2023
@robertmaynard robertmaynard requested a review from a team as a code owner October 31, 2023 16:54
@github-actions github-actions bot added libcudf Affects libcudf (C++/CUDA) code. CMake CMake build issue labels Oct 31, 2023
Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

One question about the CMake, otherwise looks good. I'm curious, how did you generate the tests? I assume you didn't write the PTX from scratch. I'm wondering if it would be helpful to include a compilation line in the test file demonstrating how to generate that PTX to make it easier to add future tests if needed.

cpp/tests/CMakeLists.txt Show resolved Hide resolved
@robertmaynard
Copy link
Contributor Author

One question about the CMake, otherwise looks good. I'm curious, how did you generate the tests? I assume you didn't write the PTX from scratch. I'm wondering if it would be helpful to include a compilation line in the test file demonstrating how to generate that PTX to make it easier to add future tests if needed.

I generated the PTX by dumping existing PTX code from libcudf with cuobjdump. From that I selected subsection of existing functions that had relevant bits to test ( differerent pragmas ) and merged it with an empty function signature. Since we only need to parse the PTX I wasn't worried about the correctness of the function, only that it contained valid instructions.

@robertmaynard
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit f5d3fc1 into rapidsai:branch-23.12 Nov 9, 2023
62 checks passed
@robertmaynard robertmaynard deleted the bug/correct_ptx_jit_parser branch November 9, 2023 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working CMake CMake build issue libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants