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] cudaErrorInvalidValue when creating cudf.Series from float16 CuPy Series #9065

Closed
dantegd opened this issue Aug 18, 2021 · 15 comments · Fixed by #9069
Closed

[BUG] cudaErrorInvalidValue when creating cudf.Series from float16 CuPy Series #9065

dantegd opened this issue Aug 18, 2021 · 15 comments · Fixed by #9069
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@dantegd
Copy link
Member

dantegd commented Aug 18, 2021

Describe the bug
Getting an error when creating a Series from float16 CuPy objects, which I believe was not present before #8949

Steps/Code to reproduce bug

>>> a = cp.ones(10, dtype=cp.float16)
>>> b = cudf.Series(a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/galahad/miniconda3/envs/ns0817b/lib/python3.8/site-packages/cudf/core/series.py", line 257, in __init__
    data = column.as_column(data, nan_as_null=nan_as_null, dtype=dtype)
  File "/home/galahad/miniconda3/envs/ns0817b/lib/python3.8/site-packages/cudf/core/column/column.py", line 1780, in as_column
    mask = libcudf.transform.nans_to_nulls(col.fillna(np.nan))
  File "/home/galahad/miniconda3/envs/ns0817b/lib/python3.8/site-packages/cudf/core/column/numerical.py", line 397, in fillna
    return super(NumericalColumn, col).fillna(fill_value, method)
  File "/home/galahad/miniconda3/envs/ns0817b/lib/python3.8/site-packages/cudf/core/column/column.py", line 640, in fillna
    return libcudf.replace.replace_nulls(
  File "cudf/_lib/replace.pyx", line 140, in cudf._lib.replace.replace_nulls
  File "cudf/_lib/replace.pyx", line 89, in cudf._lib.replace.replace_nulls_scalar
RuntimeError: CUDA error at: /home/galahad/miniconda3/envs/ns0817b/include/rmm/device_buffer.hpp:422: cudaErrorInvalidValue invalid argument

Expected behavior
Not failing, or if it is not supported, then fail gracefully as opposed to a cuda error.

Environment overview (please complete the following information)

  • Environment location: Bare metal
  • Method of cuDF install: conda

Environment details

Click here to see environment details
 **git***
 commit 907ac6f6f139169eb9e47ff4968f78857b5fe351 (HEAD -> 2110-fix-cudf-init, origin/2110-fix-cudf-init)
 Author: Dante Gama Dessavre <dante.gamadessavre@gmail.com>
 Date:   Tue Aug 17 22:50:34 2021 -0500

 FIX missing import path in cuML.dask
 **git submodules***

 ***OS Information***
 DISTRIB_ID=Ubuntu
 DISTRIB_RELEASE=20.04
 DISTRIB_CODENAME=focal
 DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"
 NAME="Ubuntu"
 VERSION="20.04.2 LTS (Focal Fossa)"
 ID=ubuntu
 ID_LIKE=debian
 PRETTY_NAME="Ubuntu 20.04.2 LTS"
 VERSION_ID="20.04"
 HOME_URL="https://www.ubuntu.com/"
 SUPPORT_URL="https://help.ubuntu.com/"
 BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
 PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
 VERSION_CODENAME=focal
 UBUNTU_CODENAME=focal
 Linux schwifty1 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

 ***GPU Information***
 Wed Aug 18 10:13:48 2021
 +-----------------------------------------------------------------------------+
 | NVIDIA-SMI 470.57.02    Driver Version: 470.57.02    CUDA Version: 11.4     |
 |-------------------------------+----------------------+----------------------+
 | GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
 | Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
 |                               |                      |               MIG M. |
 |===============================+======================+======================|
 |   0  NVIDIA GeForce ...  Off  | 00000000:0B:00.0 Off |                  N/A |
 |  0%   32C    P8    11W / 320W |    131MiB /  9995MiB |      0%      Default |
 |                               |                      |                  N/A |
 +-------------------------------+----------------------+----------------------+

 +-----------------------------------------------------------------------------+
 | Processes:                                                                  |
 |  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
 |        ID   ID                                                   Usage      |
 |=============================================================================|
 |    0   N/A  N/A      1432      G   /usr/lib/xorg/Xorg                117MiB |
 |    0   N/A  N/A      1585      G   /usr/bin/gnome-shell               12MiB |
 +-----------------------------------------------------------------------------+

 ***CPU***
 Architecture:                    x86_64
 CPU op-mode(s):                  32-bit, 64-bit
 Byte Order:                      Little Endian
 Address sizes:                   43 bits physical, 48 bits virtual
 CPU(s):                          24
 On-line CPU(s) list:             0-23
 Thread(s) per core:              2
 Core(s) per socket:              12
 Socket(s):                       1
 NUMA node(s):                    1
 Vendor ID:                       AuthenticAMD
 CPU family:                      23
 Model:                           113
 Model name:                      AMD Ryzen 9 3900X 12-Core Processor
 Stepping:                        0
 Frequency boost:                 disabled
 CPU MHz:                         3992.170
 CPU max MHz:                     4000.0000
 CPU min MHz:                     2200.0000
 BogoMIPS:                        7999.94
 Virtualization:                  AMD-V
 L1d cache:                       384 KiB
 L1i cache:                       384 KiB
 L2 cache:                        6 MiB
 L3 cache:                        64 MiB
 NUMA node0 CPU(s):               0-23
 Vulnerability Itlb multihit:     Not affected
 Vulnerability L1tf:              Not affected
 Vulnerability Mds:               Not affected
 Vulnerability Meltdown:          Not affected
 Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
 Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
 Vulnerability Spectre v2:        Mitigation; Full AMD retpoline, IBPB conditional, STIBP conditional, RSB filling
 Vulnerability Srbds:             Not affected
 Vulnerability Tsx async abort:   Not affected
 Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate sme ssbd mba sev ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif umip rdpid overflow_recov succor smca

 ***CMake***
 /home/galahad/miniconda3/envs/ns0817b/bin/cmake
 cmake version 3.20.5

 CMake suite maintained and supported by Kitware (kitware.com/cmake).

 ***g++***
 /usr/bin/g++
 g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
 Copyright (C) 2019 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 ***nvcc***
 /usr/local/cuda-11.4/bin/nvcc
 nvcc: NVIDIA (R) Cuda compiler driver
 Copyright (c) 2005-2021 NVIDIA Corporation
 Built on Wed_Jun__2_19:15:15_PDT_2021
 Cuda compilation tools, release 11.4, V11.4.48
 Build cuda_11.4.r11.4/compiler.30033411_0

 ***Python***
 /home/galahad/miniconda3/envs/ns0817b/bin/python
 Python 3.8.10

 ***Environment Variables***
 PATH                            : /usr/local/cuda-11.4/bin:/usr/local/cuda-11.4/nsight-compute-2021.2.0:/home/galahad/miniconda3/envs/ns0817b/bin:/home/galahad/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
 LD_LIBRARY_PATH                 : /usr/local/cuda-11.4/lib64
 NUMBAPRO_NVVM                   :
 NUMBAPRO_LIBDEVICE              :
 CONDA_PREFIX                    : /home/galahad/miniconda3/envs/ns0817b
 PYTHON_PATH                     :

 ***conda packages***
 /home/galahad/miniconda3/envs/ns0817b/bin/conda
 # packages in environment at /home/galahad/miniconda3/envs/ns0817b:
 #
 # Name                    Version                   Build  Channel
 _libgcc_mutex             0.1                 conda_forge    conda-forge
 _openmp_mutex             4.5                       1_gnu    conda-forge
 abseil-cpp                20210324.2           h9c3ff4c_0    conda-forge
 aiobotocore               1.3.3              pyhd8ed1ab_0    conda-forge
 aiohttp                   3.7.4.post0      py38h497a2fe_0    conda-forge
 aioitertools              0.8.0              pyhd8ed1ab_0    conda-forge
 alabaster                 0.7.12                     py_0    conda-forge
 anyio                     3.3.0            py38h578d9bd_0    conda-forge
 appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
 argon2-cffi               20.1.0           py38h497a2fe_2    conda-forge
 arrow-cpp                 5.0.0           py38hfd64638_1_cuda    conda-forge
 arrow-cpp-proc            3.0.0                      cuda    conda-forge
 asn1crypto                1.4.0              pyh9f0ad1d_0    conda-forge
 asvdb                     0.4.1               gd6cd8f2_36    rapidsai
 async-timeout             3.0.1                   py_1000    conda-forge
 async_generator           1.10                       py_0    conda-forge
 atk-1.0                   2.36.0               h3371d22_4    conda-forge
 attrs                     21.2.0             pyhd8ed1ab_0    conda-forge
 autoconf                  2.69            pl5320h36c2ea0_10    conda-forge
 automake                  1.16.2          pl5320ha770c72_3    conda-forge
 aws-c-cal                 0.5.11               h95a6274_0    conda-forge
 aws-c-common              0.6.2                h7f98852_0    conda-forge
 aws-c-event-stream        0.2.7               h3541f99_13    conda-forge
 aws-c-io                  0.10.5               hfb6a706_0    conda-forge
 aws-checksums             0.1.11               ha31a3da_7    conda-forge
 aws-sam-translator        1.38.0             pyhd8ed1ab_0    conda-forge
 aws-sdk-cpp               1.8.186              hb4091e7_3    conda-forge
 aws-xray-sdk              2.8.0              pyhd8ed1ab_0    conda-forge
 babel                     2.9.1              pyh44b312d_0    conda-forge
 backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
 backports                 1.0                        py_2    conda-forge
 backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
 beautifulsoup4            4.9.3              pyhb0f4dca_0    conda-forge
 benchmark                 1.5.1                he1b5a44_2    conda-forge
 binutils_impl_linux-64    2.36.1               h193b22a_2    conda-forge
 black                     19.10b0                  py38_0    conda-forge
 blas                      1.1                    openblas    conda-forge
 bleach                    4.0.0              pyhd8ed1ab_0    conda-forge
 blinker                   1.4                        py_1    conda-forge
 blosc                     1.21.0               h9c3ff4c_0    conda-forge
 bokeh                     2.3.3            py38h578d9bd_0    conda-forge
 boost                     1.72.0           py38h1e42940_1    conda-forge
 boost-cpp                 1.72.0               h312852a_5    conda-forge
 boto3                     1.17.106           pyhd8ed1ab_0    conda-forge
 botocore                  1.20.106           pyhd8ed1ab_0    conda-forge
 brotli                    1.0.9                h7f98852_5    conda-forge
 brotli-bin                1.0.9                h7f98852_5    conda-forge
 brotlipy                  0.7.0           py38h497a2fe_1001    conda-forge
 brunsli                   0.1                  he1b5a44_0    conda-forge
 bzip2                     1.0.8                h7f98852_4    conda-forge
 c-ares                    1.17.1               h7f98852_1    conda-forge
 ca-certificates           2021.5.30            ha878542_0    conda-forge
 cachetools                4.2.2              pyhd8ed1ab_0    conda-forge
 cairo                     1.16.0            h6cf1ce9_1008    conda-forge
 certifi                   2021.5.30        py38h578d9bd_0    conda-forge
 cffi                      1.14.6           py38ha65f79e_0    conda-forge
 cfitsio                   3.470                hb418390_7    conda-forge
 cfn-lint                  0.53.0           py38h578d9bd_0    conda-forge
 chardet                   4.0.0            py38h578d9bd_1    conda-forge
 charls                    2.2.0                h9c3ff4c_0    conda-forge
 charset-normalizer        2.0.0              pyhd8ed1ab_0    conda-forge
 clang                     11.0.0               ha770c72_2    conda-forge
 clang-11                  11.0.0          default_ha5c780c_2    conda-forge
 clang-tools               11.0.0          default_ha5c780c_2    conda-forge
 clangxx                   11.0.0          default_ha5c780c_2    conda-forge
 click                     7.1.2              pyh9f0ad1d_0    conda-forge
 click-plugins             1.1.1                      py_0    conda-forge
 cligj                     0.7.2              pyhd8ed1ab_0    conda-forge
 cloudpickle               1.6.0                      py_0    conda-forge
 cmake                     3.20.5               h8897547_0    conda-forge
 cmake-format              0.6.11             pyh9f0ad1d_0    conda-forge
 cmake_setuptools          0.1.3                      py_0    rapidsai
 cmarkgfm                  0.6.0            py38h497a2fe_0    conda-forge
 colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
 colorcet                  2.0.6              pyhd8ed1ab_0    conda-forge
 commonmark                0.9.1                      py_0    conda-forge
 conda                     4.10.3           py38h578d9bd_0    conda-forge
 conda-build               3.20.3           py38h32f6830_0    conda-forge
 conda-package-handling    1.7.3            py38h497a2fe_0    conda-forge
 conda-verify              3.1.1           py38h578d9bd_1003    conda-forge
 coverage                  5.5              py38h497a2fe_0    conda-forge
 cryptography              3.4.7            py38ha5dfef3_0    conda-forge
 cudatoolkit               11.4.1               h8ab8bb3_9    nvidia
 cudf                      21.10.00a210817 cuda_11.4_py38_g368890ff33_198    rapidsai-nightly
 cupy                      9.3.0            py38ha96c4f3_0    rapidsai
 curl                      7.78.0               hea6ffbf_0    conda-forge
 cycler                    0.10.0                     py_2    conda-forge
 cyrus-sasl                2.1.27               h230043b_2    conda-forge
 cython                    0.29.24          py38h709712a_0    conda-forge
 cytoolz                   0.11.0           py38h497a2fe_3    conda-forge
 dask                      2021.8.0+6.gbb0a2d2f          pypi_0    pypi
 dask-cuda                 21.10.00a210817         py38_27    rapidsai-nightly
 dask-cudf                 21.10.00a210817 py38_g368890ff33_198    rapidsai-nightly
 dask-glm                  0.2.0                      py_1    conda-forge
 dask-labextension         5.1.0              pyhd8ed1ab_0    conda-forge
 dask-ml                   1.9.0              pyhd8ed1ab_0    conda-forge
 dataclasses               0.8                pyhc8e2a94_3    conda-forge
 datashader                0.11.1             pyh9f0ad1d_0    conda-forge
 datashape                 0.5.4                      py_1    conda-forge
 dbus                      1.13.6               h48d8840_2    conda-forge
 decorator                 4.4.2                      py_0    conda-forge
 defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
 distributed               2021.8.0+7.g5467f9c1          pypi_0    pypi
 dlpack                    0.5                  h9c3ff4c_0    conda-forge
 docker-py                 5.0.0            py38h578d9bd_0    conda-forge
 docker-pycreds            0.4.0                      py_0    conda-forge
 docutils                  0.16             py38h578d9bd_3    conda-forge
 double-conversion         3.1.5                he1b5a44_2    conda-forge
 doxygen                   1.8.20               had0d8f1_0    conda-forge
 ecdsa                     0.17.0             pyhd8ed1ab_0    conda-forge
 entrypoints               0.3             py38h32f6830_1002    conda-forge
 execnet                   1.9.0              pyhd8ed1ab_0    conda-forge
 expat                     2.4.1                h9c3ff4c_0    conda-forge
 fa2                       0.3.5            py38h1e0a361_0    conda-forge
 faiss-proc                1.0.0                      cuda    rapidsai
 fastavro                  1.4.4            py38h497a2fe_0    conda-forge
 fastrlock                 0.6              py38h709712a_1    conda-forge
 feather-format            0.4.1              pyh9f0ad1d_0    conda-forge
 filelock                  3.0.12             pyh9f0ad1d_0    conda-forge
 filterpy                  1.4.5                      py_1    conda-forge
 fiona                     1.8.20           py38hdb5a769_0    conda-forge
 flake8                    3.8.4                      py_0    conda-forge
 flask                     2.0.1              pyhd8ed1ab_0    conda-forge
 flask_cors                3.0.10             pyhd3deb0d_0    conda-forge
 font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
 font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
 font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
 font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
 fontconfig                2.13.1            hba837de_1005    conda-forge
 fonts-conda-ecosystem     1                             0    conda-forge
 fonts-conda-forge         1                             0    conda-forge
 freetype                  2.10.4               h0708190_1    conda-forge
 freexl                    1.0.6                h7f98852_0    conda-forge
 fribidi                   1.0.10               h516909a_0    conda-forge
 fsspec                    2021.7.0           pyhd8ed1ab_0    conda-forge
 future                    0.18.2           py38h578d9bd_3    conda-forge
 gcc_impl_linux-64         9.3.0               h70c0ae5_19    conda-forge
 gcsfs                     2021.7.0           pyhd8ed1ab_0    conda-forge
 gdal                      3.2.2            py38h507a4fd_7    conda-forge
 gdk-pixbuf                2.42.6               h04a7f16_0    conda-forge
 geopandas                 0.9.0              pyhd8ed1ab_1    conda-forge
 geopandas-base            0.9.0              pyhd8ed1ab_1    conda-forge
 geos                      3.9.1                h9c3ff4c_2    conda-forge
 geotiff                   1.6.0                h4f31c25_6    conda-forge
 gettext                   0.19.8.1          h0b5b191_1005    conda-forge
 gflags                    2.2.2             he1b5a44_1004    conda-forge
 giflib                    5.2.1                h516909a_2    conda-forge
 git                       2.32.0          pl5321hc30692c_0    conda-forge
 glib                      2.68.3               h9c3ff4c_0    conda-forge
 glib-tools                2.68.3               h9c3ff4c_0    conda-forge
 glob2                     0.7                        py_0    conda-forge
 glog                      0.5.0                h48cff8f_0    conda-forge
 gmock                     1.10.0               h4bd325d_7    conda-forge
 gmp                       6.2.1                h58526e2_0    conda-forge
 google-auth               1.34.0             pyh6c4a22f_0    conda-forge
 google-auth-oauthlib      0.4.5              pyhd8ed1ab_0    conda-forge
 graphite2                 1.3.13            he1b5a44_1001    conda-forge
 graphviz                  2.48.0               h85b4f2f_0    conda-forge
 grpc-cpp                  1.39.0               h36ce80c_1    conda-forge
 gtest                     1.10.0               h4bd325d_7    conda-forge
 gtk2                      2.24.33              h539f30e_1    conda-forge
 gts                       0.7.6                h64030ff_2    conda-forge
 harfbuzz                  2.8.2                h83ec7ef_0    conda-forge
 hdbscan                   0.8.27           py38h5c078b8_0    conda-forge
 hdf4                      4.2.15               h10796ff_3    conda-forge
 hdf5                      1.10.6          nompi_h6a2412b_1114    conda-forge
 heapdict                  1.0.1                      py_0    conda-forge
 holoviews                 1.14.5             pyhd8ed1ab_0    conda-forge
 html5lib                  1.1                pyh9f0ad1d_0    conda-forge
 httpretty                 1.1.4              pyhd8ed1ab_0    conda-forge
 huggingface_hub           0.0.15             pyhd8ed1ab_0    conda-forge
 hypothesis                6.14.8             pyhd8ed1ab_0    conda-forge
 icu                       68.1                 h58526e2_0    conda-forge
 idna                      2.10               pyh9f0ad1d_0    conda-forge
 imagecodecs               2021.7.30        py38hb5ce8f7_0    conda-forge
 imageio                   2.9.0                      py_0    conda-forge
 imagesize                 1.2.0                      py_0    conda-forge
 importlib-metadata        4.6.4            py38h578d9bd_0    conda-forge
 importlib_metadata        4.6.4                hd8ed1ab_0    conda-forge
 inflection                0.5.1              pyh9f0ad1d_0    conda-forge
 iniconfig                 1.1.1              pyh9f0ad1d_0    conda-forge
 ipykernel                 5.5.5            py38hd0cf306_0    conda-forge
 ipython                   7.15.0           py38h32f6830_0    conda-forge
 ipython_genutils          0.2.0                      py_1    conda-forge
 ipywidgets                7.6.3              pyhd3deb0d_0    conda-forge
 isort                     5.6.4                      py_0    conda-forge
 itsdangerous              2.0.1              pyhd8ed1ab_0    conda-forge
 jedi                      0.17.2           py38h578d9bd_1    conda-forge
 jeepney                   0.7.1              pyhd8ed1ab_0    conda-forge
 jinja2                    3.0.1              pyhd8ed1ab_0    conda-forge
 jmespath                  0.10.0             pyh9f0ad1d_0    conda-forge
 joblib                    1.0.1              pyhd8ed1ab_0    conda-forge
 jpeg                      9d                   h516909a_0    conda-forge
 json-c                    0.15                 h98cffda_0    conda-forge
 json5                     0.9.5              pyh9f0ad1d_0    conda-forge
 jsondiff                  1.2.0                      py_1    conda-forge
 jsonpatch                 1.24                       py_0    conda-forge
 jsonpointer               2.0                        py_0    conda-forge
 jsonschema                3.2.0            py38h32f6830_1    conda-forge
 junit-xml                 1.9                pyh9f0ad1d_0    conda-forge
 jupyter-packaging         0.7.12             pyhd8ed1ab_0    conda-forge
 jupyter-server-proxy      3.1.0              pyhd8ed1ab_0    conda-forge
 jupyter_client            6.1.12             pyhd8ed1ab_0    conda-forge
 jupyter_core              4.7.1            py38h578d9bd_0    conda-forge
 jupyter_server            1.10.2             pyhd8ed1ab_0    conda-forge
 jupyter_sphinx            0.3.1            py38h578d9bd_1    conda-forge
 jupyterlab                3.1.7              pyhd8ed1ab_0    conda-forge
 jupyterlab-nvdashboard    0.6.0                      py_0    rapidsai
 jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
 jupyterlab_server         2.7.1              pyhd8ed1ab_0    conda-forge
 jupyterlab_widgets        1.0.0              pyhd8ed1ab_1    conda-forge
 jxrlib                    1.1                  h516909a_2    conda-forge
 kealib                    1.4.14               hcc255d8_2    conda-forge
 kernel-headers_linux-64   2.6.32              he073ed8_14    conda-forge
 keyring                   23.1.0           py38h578d9bd_0    conda-forge
 kiwisolver                1.3.1            py38h1fd1430_1    conda-forge
 krb5                      1.19.2               hcc1bbae_0    conda-forge
 lapack                    3.9.0                    netlib    conda-forge
 lcms2                     2.12                 hddcbb42_0    conda-forge
 ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
 lerc                      2.2.1                h9c3ff4c_0    conda-forge
 libaec                    1.0.5                h9c3ff4c_0    conda-forge
 libarchive                3.5.1                hccf745f_2    conda-forge
 libblas                   3.9.0           11_linux64_openblas    conda-forge
 libbrotlicommon           1.0.9                h7f98852_5    conda-forge
 libbrotlidec              1.0.9                h7f98852_5    conda-forge
 libbrotlienc              1.0.9                h7f98852_5    conda-forge
 libcblas                  3.9.0           11_linux64_openblas    conda-forge
 libclang-cpp11            11.0.0          default_ha5c780c_2    conda-forge
 libcudf                   21.10.00a210817 cuda11.4_g368890ff33_198    rapidsai-nightly
 libcuml                   21.10.00a210817 cuda11.4_g387c81293_55    rapidsai-nightly
 libcumlprims              21.10.00a210728 cuda11.4_gd50c4b0_0    rapidsai-nightly
 libcurl                   7.78.0               h2574ce0_0    conda-forge
 libcypher-parser          0.6.2                         1    rapidsai
 libdap4                   3.20.6               hd7c4107_2    conda-forge
 libdeflate                1.8                  h7f98852_0    conda-forge
 libedit                   3.1.20191231         he28a2e2_2    conda-forge
 libev                     4.33                 h516909a_1    conda-forge
 libevent                  2.1.10               hcdb4288_3    conda-forge
 libfaiss                  1.7.0           cuda114hda32b58_8_cuda    rapidsai
 libffi                    3.3                  h58526e2_2    conda-forge
 libgcc-devel_linux-64     9.3.0               h7864c58_19    conda-forge
 libgcc-ng                 9.3.0               h2828fa1_19    conda-forge
 libgcrypt                 1.9.3                h7f98852_1    conda-forge
 libgd                     2.3.2                h78a0170_0    conda-forge
 libgdal                   3.2.2                h8f005ca_7    conda-forge
 libgfortran-ng            9.3.0               hff62375_19    conda-forge
 libgfortran5              9.3.0               hff62375_19    conda-forge
 libglib                   2.68.3               h3e27bee_0    conda-forge
 libgomp                   9.3.0               h2828fa1_19    conda-forge
 libgpg-error              1.42                 h9c3ff4c_0    conda-forge
 libgsasl                  1.8.0                         2    conda-forge
 libhwloc                  2.3.0                h5e5b7d1_1    conda-forge
 libiconv                  1.16                 h516909a_0    conda-forge
 libkml                    1.3.0             hd79254b_1012    conda-forge
 liblapack                 3.9.0           11_linux64_openblas    conda-forge
 liblief                   0.11.5               h9c3ff4c_0    conda-forge
 libllvm10                 10.0.1               he513fc3_3    conda-forge
 libllvm11                 11.0.1               hf817b99_0    conda-forge
 libnetcdf                 4.8.0           nompi_hcd642e3_103    conda-forge
 libnghttp2                1.43.0               h812cca2_0    conda-forge
 libntlm                   1.4               h516909a_1002    conda-forge
 libopenblas               0.3.17          pthreads_h8fe5266_1    conda-forge
 libpng                    1.6.37               hed695b0_2    conda-forge
 libpq                     13.3                 hd57d9b9_0    conda-forge
 libprotobuf               3.16.0               h780b84a_0    conda-forge
 librdkafka                1.6.1                hc49e61c_1    conda-forge
 librmm                    21.10.00a210817 cuda11.4_g0ab6ab1_20    rapidsai-nightly
 librsvg                   2.50.7               hc3c00ef_0    conda-forge
 librttopo                 1.1.0                h1185371_6    conda-forge
 libsodium                 1.0.18               h516909a_1    conda-forge
 libspatialindex           1.9.3                h9c3ff4c_4    conda-forge
 libspatialite             5.0.1                h8694cbe_5    conda-forge
 libssh2                   1.9.0                ha56f1ee_6    conda-forge
 libstdcxx-ng              9.3.0               h6de172a_19    conda-forge
 libthrift                 0.14.2               he6d91bd_1    conda-forge
 libtiff                   4.3.0                hf544144_0    conda-forge
 libtool                   2.4.6             h58526e2_1007    conda-forge
 libutf8proc               2.6.1                h7f98852_0    conda-forge
 libuuid                   2.32.1            h14c3975_1000    conda-forge
 libuv                     1.42.0               h7f98852_0    conda-forge
 libwebp                   1.2.0                h3452ae3_0    conda-forge
 libwebp-base              1.2.0                h7f98852_2    conda-forge
 libxcb                    1.13              h7f98852_1003    conda-forge
 libxml2                   2.9.12               h72842e0_0    conda-forge
 libxslt                   1.1.33               h15afd5d_2    conda-forge
 libzip                    1.8.0                h4de3113_0    conda-forge
 libzopfli                 1.0.3                he1b5a44_0    conda-forge
 lightgbm                  3.2.1            py38h709712a_0    conda-forge
 llvmlite                  0.36.0           py38h4630a5e_0    conda-forge
 locket                    0.2.0                      py_2    conda-forge
 lxml                      4.6.3            py38hf1fe3a4_0    conda-forge
 lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
 lzo                       2.10              h516909a_1000    conda-forge
 m4                        1.4.18            h516909a_1001    conda-forge
 make                      4.3                  hd18ef5c_1    conda-forge
 mapclassify               2.4.3              pyhd8ed1ab_0    conda-forge
 markdown                  3.3.4              pyhd8ed1ab_0    conda-forge
 markupsafe                2.0.1            py38h497a2fe_0    conda-forge
 matplotlib-base           3.4.2            py38hcc49a3a_0    conda-forge
 mccabe                    0.6.1                      py_1    conda-forge
 mimesis                   4.0.0              pyh9f0ad1d_0    conda-forge
 mistune                   0.8.4           py38h497a2fe_1004    conda-forge
 mock                      4.0.3            py38h578d9bd_1    conda-forge
 more-itertools            8.8.0              pyhd8ed1ab_0    conda-forge
 moto                      2.2.0              pyhd8ed1ab_0    conda-forge
 msgpack-python            1.0.2            py38h1fd1430_1    conda-forge
 multidict                 5.1.0            py38h497a2fe_1    conda-forge
 multipledispatch          0.6.0                      py_0    conda-forge
 munch                     2.5.0                      py_0    conda-forge
 mypy                      0.782                      py_0    conda-forge
 mypy_extensions           0.4.3            py38h578d9bd_3    conda-forge
 nbclassic                 0.3.1              pyhd8ed1ab_1    conda-forge
 nbclient                  0.5.4              pyhd8ed1ab_0    conda-forge
 nbconvert                 6.1.0            py38h578d9bd_0    conda-forge
 nbformat                  5.1.3              pyhd8ed1ab_0    conda-forge
 nbsphinx                  0.8.7              pyhd8ed1ab_0    conda-forge
 nccl                      2.10.3.1             hcad2f07_0    nvidia
 ncurses                   6.2                  h58526e2_4    conda-forge
 nest-asyncio              1.5.1              pyhd8ed1ab_0    conda-forge
 networkx                  2.6.2              pyhd8ed1ab_0    conda-forge
 ninja                     1.10.2               h4bd325d_0    conda-forge
 nltk                      3.6.2              pyhd8ed1ab_0    conda-forge
 nodejs                    14.17.4              h92b4a50_0    conda-forge
 notebook                  6.4.3              pyha770c72_0    conda-forge
 numba                     0.53.1           py38h8b71fd7_1    conda-forge
 numpy                     1.21.1           py38h9894fe3_0    conda-forge
 numpydoc                  1.1.0                      py_1    conda-forge
 nvtx                      0.2.3            py38h497a2fe_0    conda-forge
 oauthlib                  3.1.1              pyhd8ed1ab_0    conda-forge
 olefile                   0.46               pyh9f0ad1d_1    conda-forge
 openblas                  0.3.17          pthreads_h4748800_1    conda-forge
 openjpeg                  2.4.0                hb52868f_1    conda-forge
 openslide                 3.4.1                h978ee9a_4    conda-forge
 openssl                   1.1.1k               h7f98852_0    conda-forge
 orc                       1.6.9                h58a87f1_0    conda-forge
 packaging                 21.0               pyhd8ed1ab_0    conda-forge
 pandas                    1.2.5            py38h1abd341_0    conda-forge
 pandoc                    1.19.2                        0    conda-forge
 pandocfilters             1.4.2                      py_1    conda-forge
 panel                     0.12.1             pyhd8ed1ab_0    conda-forge
 pango                     1.48.7               hb8ff022_0    conda-forge
 param                     1.11.1             pyh6c4a22f_0    conda-forge
 parquet-cpp               1.5.1                         1    conda-forge
 parso                     0.7.1              pyh9f0ad1d_0    conda-forge
 partd                     1.2.0              pyhd8ed1ab_0    conda-forge
 patchelf                  0.13                 h58526e2_0    conda-forge
 pathspec                  0.9.0              pyhd8ed1ab_0    conda-forge
 patsy                     0.5.1                      py_0    conda-forge
 pcre                      8.45                 h9c3ff4c_0    conda-forge
 pcre2                     10.37                h032f7d1_0    conda-forge
 perl                      5.32.1          0_h7f98852_perl5    conda-forge
 pexpect                   4.8.0            py38h32f6830_1    conda-forge
 pickleshare               0.7.5           py38h32f6830_1002    conda-forge
 pillow                    8.3.1            py38h8e6f84c_0    conda-forge
 pip                       21.2.4             pyhd8ed1ab_0    conda-forge
 pixman                    0.40.0               h36c2ea0_0    conda-forge
 pkg-config                0.29.2            h516909a_1008    conda-forge
 pkginfo                   1.7.1              pyhd8ed1ab_0    conda-forge
 pluggy                    0.13.1           py38h578d9bd_4    conda-forge
 pooch                     1.4.0              pyhd8ed1ab_0    conda-forge
 poppler                   21.03.0              h93df280_0    conda-forge
 poppler-data              0.4.10                        0    conda-forge
 postgresql                13.3                 h2510834_0    conda-forge
 proj                      8.0.1                h277dcde_0    conda-forge
 prometheus_client         0.11.0             pyhd8ed1ab_0    conda-forge
 prompt-toolkit            3.0.19             pyha770c72_0    conda-forge
 prompt_toolkit            3.0.19               hd8ed1ab_0    conda-forge
 protobuf                  3.16.0           py38h709712a_0    conda-forge
 psutil                    5.8.0            py38h497a2fe_1    conda-forge
 pthread-stubs             0.4               h36c2ea0_1001    conda-forge
 ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
 py                        1.10.0             pyhd3deb0d_0    conda-forge
 py-cpuinfo                8.0.0              pyhd8ed1ab_0    conda-forge
 py-lief                   0.11.5           py38h709712a_0    conda-forge
 pyarrow                   5.0.0           py38hed47224_1_cuda    conda-forge
 pyasn1                    0.4.8                      py_0    conda-forge
 pyasn1-modules            0.2.7                      py_0    conda-forge
 pycodestyle               2.6.0              pyh9f0ad1d_0    conda-forge
 pycosat                   0.6.3           py38h497a2fe_1006    conda-forge
 pycparser                 2.20               pyh9f0ad1d_2    conda-forge
 pyct                      0.4.6                      py_0    conda-forge
 pyct-core                 0.4.6                      py_0    conda-forge
 pydata-sphinx-theme       0.6.3              pyhd8ed1ab_0    conda-forge
 pydeck                    0.5.0              pyh9f0ad1d_0    conda-forge
 pydocstyle                6.1.1              pyhd8ed1ab_0    conda-forge
 pyflakes                  2.2.0              pyh9f0ad1d_0    conda-forge
 pygments                  2.10.0             pyhd8ed1ab_0    conda-forge
 pyjwt                     2.1.0              pyhd8ed1ab_0    conda-forge
 pynndescent               0.5.4              pyh6c4a22f_0    conda-forge
 pynvml                    11.0.0             pyhd8ed1ab_0    conda-forge
 pyopenssl                 20.0.1             pyhd8ed1ab_0    conda-forge
 pyorc                     0.4.0            py38hd75a9e7_4    conda-forge
 pyparsing                 2.4.7              pyh9f0ad1d_0    conda-forge
 pyproj                    3.1.0            py38h03a1999_3    conda-forge
 pyrsistent                0.17.3           py38h497a2fe_2    conda-forge
 pysocks                   1.7.1            py38h578d9bd_3    conda-forge
 pytest                    6.2.4            py38h578d9bd_0    conda-forge
 pytest-asyncio            0.12.0           py38h32f6830_2    conda-forge
 pytest-benchmark          3.4.1              pyhd8ed1ab_0    conda-forge
 pytest-cov                2.12.1             pyhd8ed1ab_0    conda-forge
 pytest-forked             1.3.0              pyhd3deb0d_0    conda-forge
 pytest-timeout            1.4.2              pyh9f0ad1d_0    conda-forge
 pytest-xdist              2.3.0              pyhd8ed1ab_0    conda-forge
 python                    3.8.10          h49503c6_1_cpython    conda-forge
 python-confluent-kafka    1.6.0            py38h497a2fe_1    conda-forge
 python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
 python-jose               3.3.0              pyh6c4a22f_1    conda-forge
 python-libarchive-c       3.1              py38h578d9bd_0    conda-forge
 python-louvain            0.15               pyhd3deb0d_0    conda-forge
 python_abi                3.8                      2_cp38    conda-forge
 pytz                      2021.1             pyhd8ed1ab_0    conda-forge
 pyu2f                     0.1.5              pyhd8ed1ab_0    conda-forge
 pyviz_comms               2.1.0              pyhd8ed1ab_0    conda-forge
 pywavelets                1.1.1            py38hab2c0dc_3    conda-forge
 pyyaml                    5.4.1            py38h497a2fe_0    conda-forge
 pyzmq                     22.1.0           py38h2035c66_0    conda-forge
 rapidjson                 1.1.0             hf484d3e_1002    conda-forge
 rapids-build-env          21.10.00a210817 cuda11.4_py38_g92d61ce_50    rapidsai-nightly
 rapids-doc-env            21.10.00a210817 py38_g92d61ce_50    rapidsai-nightly
 rapids-notebook-env       21.10.00a210817 cuda11.4_py38_g92d61ce_50    rapidsai-nightly
 re2                       2021.06.01           h9c3ff4c_0    conda-forge
 readline                  8.1                  h46c0cb4_0    conda-forge
 readme_renderer           27.0               pyh9f0ad1d_0    conda-forge
 recommonmark              0.7.1              pyhd8ed1ab_0    conda-forge
 regex                     2021.8.3         py38h497a2fe_0    conda-forge
 requests                  2.26.0             pyhd8ed1ab_0    conda-forge
 requests-oauthlib         1.3.0              pyh9f0ad1d_0    conda-forge
 requests-toolbelt         0.9.1                      py_0    conda-forge
 requests-unixsocket       0.2.0                      py_0    conda-forge
 responses                 0.13.4             pyhd8ed1ab_0    conda-forge
 rfc3986                   1.5.0              pyhd8ed1ab_0    conda-forge
 rhash                     1.4.1                h7f98852_0    conda-forge
 ripgrep                   13.0.0               habb4d0f_0    conda-forge
 rmm                       21.10.00a210817 cuda_11.4_py38_g0ab6ab1_20    rapidsai-nightly
 rsa                       4.7.2              pyh44b312d_0    conda-forge
 rtree                     0.9.7            py38h02d302b_2    conda-forge
 ruamel_yaml               0.15.80         py38h497a2fe_1004    conda-forge
 s2n                       1.0.10               h9b69904_0    conda-forge
 s3fs                      2021.7.0           pyhd8ed1ab_0    conda-forge
 s3transfer                0.4.2              pyhd8ed1ab_0    conda-forge
 sacremoses                0.0.43             pyh9f0ad1d_0    conda-forge
 scikit-image              0.18.2           py38h1abd341_0    conda-forge
 scikit-learn              0.23.1           py38h3a94b23_0    conda-forge
 scipy                     1.6.0            py38hb2138dd_0    conda-forge
 seaborn                   0.11.2               hd8ed1ab_0    conda-forge
 seaborn-base              0.11.2             pyhd8ed1ab_0    conda-forge
 secretstorage             3.3.1            py38h578d9bd_0    conda-forge
 send2trash                1.8.0              pyhd8ed1ab_0    conda-forge
 setuptools                57.4.0           py38h578d9bd_0    conda-forge
 shapely                   1.7.1            py38haeee4fe_5    conda-forge
 shellcheck                0.7.2                ha770c72_1    conda-forge
 simpervisor               0.4                pyhd8ed1ab_0    conda-forge
 six                       1.16.0             pyh6c4a22f_0    conda-forge
 snappy                    1.1.8                he1b5a44_3    conda-forge
 sniffio                   1.2.0            py38h578d9bd_1    conda-forge
 snowballstemmer           2.1.0              pyhd8ed1ab_0    conda-forge
 sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
 soupsieve                 2.0.1            py38h32f6830_0    conda-forge
 spdlog                    1.8.5                h4bd325d_0    conda-forge
 sphinx                    4.1.2              pyh6c4a22f_1    conda-forge
 sphinx-click              3.0.1              pyhd8ed1ab_0    conda-forge
 sphinx-copybutton         0.4.0              pyhd8ed1ab_0    conda-forge
 sphinx-markdown-tables    0.0.15             pyhd3deb0d_0    conda-forge
 sphinx_rtd_theme          0.5.2              pyhd8ed1ab_1    conda-forge
 sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
 sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
 sphinxcontrib-htmlhelp    2.0.0              pyhd8ed1ab_0    conda-forge
 sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
 sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
 sphinxcontrib-serializinghtml 1.1.5              pyhd8ed1ab_0    conda-forge
 sphinxcontrib-websupport  1.2.4              pyh9f0ad1d_0    conda-forge
 sqlite                    3.36.0               h9cd32fc_0    conda-forge
 sshpubkeys                3.1.0                      py_0    conda-forge
 statsmodels               0.12.2           py38h5c078b8_0    conda-forge
 streamz                   0.6.2              pyh44b312d_0    conda-forge
 sysroot_linux-64          2.12                he073ed8_14    conda-forge
 tbb                       2020.2               h4bd325d_4    conda-forge
 tblib                     1.7.0              pyhd8ed1ab_0    conda-forge
 terminado                 0.10.1           py38h578d9bd_0    conda-forge
 testpath                  0.5.0              pyhd8ed1ab_0    conda-forge
 threadpoolctl             2.2.0              pyh8a188c0_0    conda-forge
 tifffile                  2021.8.8           pyhd8ed1ab_0    conda-forge
 tiledb                    2.3.2                he87e0bf_0    conda-forge
 tk                        8.6.10               hed695b0_1    conda-forge
 tokenizers                0.10.1           py38hb63a372_0    conda-forge
 toml                      0.10.2             pyhd8ed1ab_0    conda-forge
 toolz                     0.11.1                     py_0    conda-forge
 tornado                   6.1              py38h497a2fe_1    conda-forge
 tqdm                      4.62.1             pyhd8ed1ab_0    conda-forge
 traitlets                 5.0.5                      py_0    conda-forge
 transformers              4.6.1              pyhd8ed1ab_0    conda-forge
 treelite                  2.0.0            py38hd08a91b_0    conda-forge
 treelite-runtime          2.0.0                    pypi_0    pypi
 twine                     3.4.2              pyhd8ed1ab_0    conda-forge
 typed-ast                 1.4.3            py38h497a2fe_0    conda-forge
 typing-extensions         3.10.0.0             hd8ed1ab_0    conda-forge
 typing_extensions         3.10.0.0           pyha770c72_0    conda-forge
 tzcode                    2021a                h7f98852_2    conda-forge
 tzdata                    2021a                he74cb21_1    conda-forge
 ucx                       1.9.0+gcd9efd3       cuda11.4_0    rapidsai
 ucx-proc                  1.0.0                       gpu    rapidsai
 ucx-py                    0.21.0          py38_gcd9efd3_0    rapidsai
 umap-learn                0.5.1            py38h578d9bd_1    conda-forge
 urllib3                   1.26.6             pyhd8ed1ab_0    conda-forge
 wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
 webencodings              0.5.1                      py_1    conda-forge
 websocket-client          0.57.0           py38h578d9bd_4    conda-forge
 werkzeug                  2.0.1              pyhd8ed1ab_0    conda-forge
 wheel                     0.37.0             pyhd8ed1ab_1    conda-forge
 widgetsnbextension        3.5.1            py38h578d9bd_4    conda-forge
 wrapt                     1.12.1           py38h497a2fe_3    conda-forge
 xarray                    0.19.0             pyhd8ed1ab_1    conda-forge
 xerces-c                  3.2.3                h9d8b166_2    conda-forge
 xmltodict                 0.12.0                     py_0    conda-forge
 xorg-kbproto              1.0.7             h14c3975_1002    conda-forge
 xorg-libice               1.0.10               h516909a_0    conda-forge
 xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
 xorg-libx11               1.7.2                h7f98852_0    conda-forge
 xorg-libxau               1.0.9                h14c3975_0    conda-forge
 xorg-libxdmcp             1.1.3                h516909a_0    conda-forge
 xorg-libxext              1.3.4                h7f98852_1    conda-forge
 xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
 xorg-renderproto          0.11.1            h14c3975_1002    conda-forge
 xorg-xextproto            7.3.0             h14c3975_1002    conda-forge
 xorg-xproto               7.0.31            h14c3975_1007    conda-forge
 xz                        5.2.5                h516909a_1    conda-forge
 yaml                      0.2.5                h516909a_0    conda-forge
 yarl                      1.6.3            py38h497a2fe_2    conda-forge
 zeromq                    4.3.4                h9c3ff4c_0    conda-forge
 zfp                       0.5.5                h9c3ff4c_5    conda-forge
 zict                      2.0.0                      py_0    conda-forge
 zipp                      3.5.0              pyhd8ed1ab_0    conda-forge
 zlib                      1.2.11            h516909a_1010    conda-forge
 zstd                      1.5.0                ha95c52a_0    conda-forge

@dantegd dantegd added bug Something isn't working Needs Triage Need team to review and classify labels Aug 18, 2021
@harrism
Copy link
Member

harrism commented Aug 18, 2021

Not saying a CUDA runtime error should happen here, but does cuDF support float16? We certainly don't support it in libcudf.

@harrism
Copy link
Member

harrism commented Aug 18, 2021

Also, why the heck would your code result in a call to replace_nulls? There are no nulls that I can see in the repro.

@vyasr
Copy link
Contributor

vyasr commented Aug 18, 2021

The problem is coming from these changes in the PR you pointed to. The issue is that we're now calling cudf.type to get the current dtype, and that function automatically casts float16->float32 so a couple lines later when we check if the current and desired dtypes match, we always find that they do because both variables upcasted rather than only one of them (which is how it used to work).

@shwina @galipremsagar I'm not 100% sure what the right solution is here. My two cents: we probably want cudf.dtype not to perform conversions like this where the actual data type is different, as compared to cases where we're just converting to our version of the same dtype e.g. pandas categorical to ours. Places that need to do this kind of specific conversion should either call a different method if it's a common operation, or just inline the necessary logic if it's rare. Thoughts?

Also, why the heck would your code result in a call to replace_nulls? There are no nulls that I can see in the repro.

In cases where we're creating cuDF columns from objects supporting the __cuda_array_interface__ protocol it looks like we perform a nans->nulls replacement if that conversion is requested (the default) whether or not NaNs are present in the input.

@harrism
Copy link
Member

harrism commented Aug 18, 2021

I added some print statements in rmm::device_buffer C++ to sanity check and I get this output:

Of note, the error is on the cudaMemcpyAsync but it's possible the error is from a prior, asynchronous CUDA API call. The parameters to the cudaMemcpyAsync all look valid (40 bytes, stream 0, pointers look sane) so I'm not sure how they could cause a cudaErrorInvalidValue.

In [3]: a = cp.ones(10, dtype=cp.float16)
Device buffer allocating 20 on stream: 0

In [4]: b = cudf.Series(a)
Device buffer allocating 64 on stream: 0
Device buffer allocating 4 on stream: 0
Device buffer allocating 1 on stream: 0
Device buffer allocating 4 on stream: 0
Device buffer allocating 0 on stream: 0
Device buffer allocating 40 on stream: 0
Device buffer copying 40 from: 0x7fe0ade00000 to: 0x7fe0ade00600 on stream: 0
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-291547e6af13> in <module>
----> 1 b = cudf.Series(a)

~/cudf/python/cudf/cudf/core/series.py in __init__(self, data, index, dtype, name, nan_as_null)
    255 
    256         if not isinstance(data, column.ColumnBase):
--> 257             data = column.as_column(data, nan_as_null=nan_as_null, dtype=dtype)
    258         else:
    259             if dtype is not None:

~/cudf/python/cudf/cudf/core/column/column.py in as_column(arbitrary, nan_as_null, dtype, length)
   1778         elif np.issubdtype(col.dtype, np.floating):
   1779             if nan_as_null or (mask is None and nan_as_null is None):
-> 1780                 mask = libcudf.transform.nans_to_nulls(col.fillna(np.nan))
   1781                 col = col.set_mask(mask)
   1782         elif np.issubdtype(col.dtype, np.datetime64):

~/cudf/python/cudf/cudf/core/column/numerical.py in fillna(self, fill_value, method, dtype, fill_nan)
    395                 fill_value = fill_value.astype(col.dtype)
    396 
--> 397         return super(NumericalColumn, col).fillna(fill_value, method)
    398 
    399     def find_first_value(

~/cudf/python/cudf/cudf/core/column/column.py in fillna(self, value, method, dtype)
    639         """
    640         return libcudf.replace.replace_nulls(
--> 641             input_col=self, replacement=value, method=method, dtype=dtype
    642         )
    643 

~/cudf/python/cudf/cudf/_lib/replace.pyx in cudf._lib.replace.replace_nulls()

~/cudf/python/cudf/cudf/_lib/replace.pyx in cudf._lib.replace.replace_nulls_scalar()

RuntimeError: CUDA error at: /home/mharris/rapids/rmm/include/rmm/device_buffer.hpp:426: cudaErrorInvalidValue invalid argument

@vyasr
Copy link
Contributor

vyasr commented Aug 19, 2021

@harrism to clarify my previous comment, the problem is that previously cuDF was converting the float16 array into a float32 array before any libcudf calls could happen, whereas now it is not. I haven't delved into why exactly the error is showing up in rmm, but it's likely just breaking at whatever the first libcudf call is since we don't support float16 in libcudf (and probably before hitting something like the type_dispatcher that might give us more useful errors). The open question for me is what the right way is to fix it, since the regression was introduced by a change that is otherwise something that we want (providing a single point of entry for converting dtypes from arbitrary sources into a known set of cuDF dtypes).

@galipremsagar galipremsagar self-assigned this Aug 19, 2021
@galipremsagar galipremsagar added Python Affects Python cuDF API. and removed Needs Triage Need team to review and classify labels Aug 19, 2021
@galipremsagar
Copy link
Contributor

galipremsagar commented Aug 19, 2021

The fix to this issue is here: #9069

The root cause was that because of using cudf.dtype for __cuda_array_interface__ inputs that are only numeric types which can be read by np.dtype, we already have the dtype upscaling logic inplace but a call to cudf.dtype instead of np.dtype averted that logic.

@vyasr I thought of two approaches:

  1. That is in PR: [REVIEW] Preserve float16 upscaling #9069
  2. Introduce a up_cast flag to cudf.dtype which will decide if we should be upcasting incase of float16. But this looks too specific to just one dtype and hence went with approach 1, let me know what your thoughts are.

@harrism
Copy link
Member

harrism commented Aug 19, 2021

I don't like it that an error at the Python level can result in a CUDA runtime error in RMM which is hard to diagnose. Instead, it should result in a libcudf exception thrown before getting to RMM. This indicates a hole in our C++ test coverage. That's why I am trying to understand this at the libcudf level (I still don't, because I don't know how to hit the C++ debugger from Python code).

@vyasr
Copy link
Contributor

vyasr commented Aug 19, 2021

The fix to this issue is here: #9069
...

@galipremsagar discussing the tradeoffs between these two approaches is exactly what I was thinking about in my previous comment. I agree that having some sort of cast parameter seems too specific since we don't have any other cases of data types where we want to convert like this in cudf.dtype. More importantly though, I think we need to clarify exactly what that function means, because there are two different questions that we could be trying to answer: 1) What does some arbitrary dtype translate to in cudf code, vs 2) What dtypes have an exact equivalent in cudf. I think (2) is closer to what we want, which makes me think that cudf.dtype should be throwing an exception for float16 (and then other code paths that need to support it via conversion to float32 should do what you did in #9069). What do you think?

@dantegd how urgent is it to get this fixed? @shwina is out until next week and it would be nice to get his take as well. If we need this soon we can always move forward with #9069 as is but leave this issue unresolved until we've answered the deeper questions about how cudf.dtype should behave.

@vyasr
Copy link
Contributor

vyasr commented Aug 19, 2021

I don't like it that an error at the Python level can result in a CUDA runtime error in RMM which is hard to diagnose. Instead, it should result in a libcudf exception thrown before getting to RMM. This indicates a hole in our C++ test coverage. That's why I am trying to understand this at the libcudf level (I still don't, because I don't know how to hit the C++ debugger from Python code).

@harrism Agreed we should definitely be catching this somewhere in libcudf. I don't use VSCode so I can't help you on that front, but using the debugger directly from the CLI on C++ code should work. Once you have a debug (or at least compiled with debug symbols) build of libcudf, running gdb python and then executing run myscript.py inside the debugger should drop you into the stack frame that failed.

@beckernick beckernick added this to the CuDF Python Refactoring milestone Aug 23, 2021
@harrism
Copy link
Member

harrism commented Aug 23, 2021

@vyasr was hoping someone who is already working on debugging it could take this. To save waiting for a debug build, could someone figure out what inputs Python is/was passing that resulted in the runtime error? Then we could create a gtest which would repro the problem and then fix the test so it throws before calling whatever is getting the CUDA runtime error.

@galipremsagar
Copy link
Contributor

@vyasr @harrism I was planning to triage this and get back, will update here what I find.

@shwina
Copy link
Contributor

shwina commented Aug 24, 2021

My two cents: we probably want cudf.dtype not to perform conversions like this where the actual data type is different, as compared to cases where we're just converting to our version of the same dtype e.g. pandas categorical to ours.

I would agree. We probably don't want cudf.dtype("float16") -> np.dtype("float32"), although that was one of the requirements we initially listed here. I think it's cleaner for downstream code to handle inputs like that on a case-by-case basis.

@vyasr
Copy link
Contributor

vyasr commented Aug 24, 2021

@galipremsagar would you be able to update #9069 to also reflect that change? It's possible that change will reveal other cases where this float16->float32 conversion inside cudf.dtype is either causing problems or hiding conversions that should be performed by downstream code.

@galipremsagar
Copy link
Contributor

galipremsagar commented Aug 25, 2021

  1. I have reverted the float16->float32 conversion inside cudf.dtype and found multiple places where the floating conversions had to be fixed, I have updated [REVIEW] Preserve float16 upscaling #9069 with those changes. Give the nature of our utility functions, majority of the changes are localized to utility functions only.

  2. However, after doing some digging while creating an Column we have a check that validates the buffer size with dtype size here: https://github.com/rapidsai/cudf/blob/branch-21.10/python/cudf/cudf/core/column/numerical.py#L61-L62. This is the only point where we have a check in python side, but this check too passes as we are anyways having the wrong dtype and not actually inspecting the data at the data pointer obtained from __cuda_array_interface__. So this allows Column creation successfully and whatever libcudf operation that will be invoked next would crash/fail with irrelevant errors.

@harrism
Copy link
Member

harrism commented Aug 25, 2021

@galipremsagar if you see a place where libcudf could provide a more helpful error and fail gracefully rather than crashing, please file an issue!

rapids-bot bot pushed a commit that referenced this issue Aug 26, 2021
Fixes: #9065 

This PR enables using `np.dtype` only for `__cuda_array_interface__` scenario in `as_column`. The dtype in this array interface is guaranteed to be numeric which `np.dtype` can handle. Also there is `float16` dtype upcasting logic already inplace below i.e., at line 1760.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Ashwin Srinath (https://github.com/shwina)

URL: #9069
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants