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

[BUG] AST fails with zero-row inputs #13236

Closed
aocsa opened this issue Apr 27, 2023 · 1 comment · Fixed by #13245
Closed

[BUG] AST fails with zero-row inputs #13236

aocsa opened this issue Apr 27, 2023 · 1 comment · Fixed by #13245
Assignees
Labels
bug Something isn't working libcudf Affects libcudf (C++/CUDA) code.

Comments

@aocsa
Copy link
Contributor

aocsa commented Apr 27, 2023

Describe the bug

AST can't handle inputs with zero rows because it can't get the right numbers of kernel's blocks for this case. This is an edge case, but it should be covered as pandas do.

C++ exception with description "CUDF failure at: /opt/mambaforge/conda-bld/libcudf-ext_1681746453367/work/cpp/include/cudf/detail/utilities/cuda.cuh:66: num_blocks must be > 0" thrown in the test body.

Steps/Code to reproduce bug

import cudf
df = cudf.DataFrame({'A': [], 'B': []})
df.eval('A + B')

RuntimeError: CUDF failure at: /opt/conda/conda-bld/work/cpp/include/cudf/detail/utilities/cuda.cuh:66: num_blocks must be > 0

Expected behavior

For the example above it should return a column with zero rows.

import pandas as pd
df = pd.DataFrame({'A': [], 'B': []})
df.eval('A + B')
Out[10]: Series([], dtype: float64)

Environment overview (please complete the following information)

  • Environment location: conda
  • Method of cuDF install: conda
  • branch-23.04, origin/branch-23.04
@aocsa aocsa added Needs Triage Need team to review and classify bug Something isn't working labels Apr 27, 2023
@wence- wence- self-assigned this Apr 28, 2023
wence- added a commit to wence-/cudf that referenced this issue Apr 28, 2023
@wence- wence- added libcudf Affects libcudf (C++/CUDA) code. and removed Needs Triage Need team to review and classify labels Apr 28, 2023
@wence-
Copy link
Contributor

wence- commented Apr 28, 2023

Thanks, agreed. I think that #13245 fixes this correctly. I still run through the parser to infer types but just don't launch the kernel if the input is empty.

rapids-bot bot pushed a commit that referenced this issue May 2, 2023
If the input table is empty we can still produce an output of
appropriate type by letting the parser run and inferring types.
In this case though, we do not want to actually run a kernel,
since we would try and launch with zero blocks which is not
allowed.

Closes #13236.

Authors:
  - Lawrence Mitchell (https://github.com/wence-)
  - Vukasin Milovanovic (https://github.com/vuule)

Approvers:
  - Vukasin Milovanovic (https://github.com/vuule)
  - Vyas Ramasubramani (https://github.com/vyasr)

URL: #13245
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working libcudf Affects libcudf (C++/CUDA) code.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants