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

[FEA] Masked UDF Unary ops #9405

Closed
brandon-b-miller opened this issue Oct 8, 2021 · 0 comments · Fixed by #9409
Closed

[FEA] Masked UDF Unary ops #9405

brandon-b-miller opened this issue Oct 8, 2021 · 0 comments · Fixed by #9409
Assignees
Labels
feature request New feature or request numba Numba issue Python Affects Python cuDF API.

Comments

@brandon-b-miller
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Masked UDFs were implemented starting with binary operations, meaning we enabled this:

df = cudf.DataFrame({
    'a':[1,2,3],
    'b':[4,5,6],
})
def f(row):
    return row['a'] + row['b']

df.apply(f, axis=1)

Now we need the set of unary operations as well, i.e.

def f(row):
    theta = row['b']
    return math.sin(theta)

Describe the solution you'd like
Implement typing and lowering in numba to handle these cases for cudf MaskedType. These should be fairly simple to just plug in without having to touch the overall UDF pipeline.

Describe alternatives you've considered
There are not really alternatives other than not supporting this capability.

Additional context
N/A

@brandon-b-miller brandon-b-miller added feature request New feature or request numba Numba issue Python Affects Python cuDF API. labels Oct 8, 2021
@brandon-b-miller brandon-b-miller self-assigned this Oct 8, 2021
@isVoid isVoid self-assigned this Oct 8, 2021
rapids-bot bot pushed a commit that referenced this issue Oct 19, 2021
This PR adds support for several unary operations in masked udfs. Including trigonometry functions `sin`, `cos`, `tan`; rounding functions `ceil` and `floor`, sign functions `neg` and logic functions `not`.

closes #9405

Authors:
  - Michael Wang (https://github.com/isVoid)

Approvers:
  - https://github.com/brandon-b-miller
  - Graham Markall (https://github.com/gmarkall)

URL: #9409
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request numba Numba issue Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants