rapidsai / cudf

cuDF - GPU DataFrame Library
https://docs.rapids.ai/api/cudf/stable/
Apache License 2.0
8.41k stars 899 forks source link

[BUG] Binary operations between `decimal32/64` columns and `Decimal` objects fail #13023

Closed charlesbluca closed 1 year ago

charlesbluca commented 1 year ago

Describe the bug While I am able to do binary operations between decimal128 columns and python Decimal objects, attempting this with decimal32/64 raises a failure at the libcudf level:

```python-traceback ValueError Traceback (most recent call last) Cell In[1], line 19 16 col * Decimal("2.0") 18 # fails ---> 19 f(d.astype(cudf.Decimal32Dtype(1, 0))) 20 f(d.astype(cudf.Decimal64Dtype(1, 0))) Cell In[1], line 7, in f(col) 6 def f(col): ----> 7 col > Decimal("2.0") 8 col >= Decimal("2.0") 9 col < Decimal("2.0") File /datasets/charlesb/mambaforge/envs/decimal/lib/python3.10/site-packages/cudf/core/mixins/mixin_factory.py:11, in _partialmethod..wrapper(self, *args2, **kwargs2) 10 def wrapper(self, *args2, **kwargs2): ---> 11 return method(self, *args1, *args2, **kwargs1, **kwargs2) File /datasets/charlesb/mambaforge/envs/decimal/lib/python3.10/site-packages/cudf/core/indexed_frame.py:3304, in IndexedFrame._binaryop(self, other, op, fill_value, can_reindex, *args, **kwargs) 3300 if operands is NotImplemented: 3301 return NotImplemented 3303 return self._from_data( -> 3304 ColumnAccessor(type(self)._colwise_binop(operands, op)), 3305 index=out_index, 3306 ) File /datasets/charlesb/mambaforge/envs/decimal/lib/python3.10/contextlib.py:79, in ContextDecorator.__call__..inner(*args, **kwds) 76 @wraps(func) 77 def inner(*args, **kwds): 78 with self._recreate_cm(): ---> 79 return func(*args, **kwds) File /datasets/charlesb/mambaforge/envs/decimal/lib/python3.10/site-packages/cudf/core/frame.py:1730, in Frame._colwise_binop(cls, operands, fn) 1722 assert False, "At least one operand must be a column." 1724 # TODO: Disable logical and binary operators between columns that 1725 # are not numerical using the new binops mixin. 1727 outcol = ( 1728 getattr(operator, fn)(right_column, left_column) 1729 if reflect -> 1730 else getattr(operator, fn)(left_column, right_column) 1731 ) 1733 if output_mask is not None: 1734 outcol = outcol.set_mask(output_mask) File /datasets/charlesb/mambaforge/envs/decimal/lib/python3.10/site-packages/cudf/core/mixins/mixin_factory.py:11, in _partialmethod..wrapper(self, *args2, **kwargs2) 10 def wrapper(self, *args2, **kwargs2): ---> 11 return method(self, *args1, *args2, **kwargs1, **kwargs2) File /datasets/charlesb/mambaforge/envs/decimal/lib/python3.10/site-packages/cudf/core/column/decimal.py:96, in DecimalBaseColumn._binaryop(self, other, op) 87 result.dtype.precision = output_type.precision 88 elif op in { 89 "__eq__", 90 "__ne__", (...) 94 "__ge__", 95 }: ---> 96 result = libcudf.binaryop.binaryop(lhs, rhs, op, bool) 97 else: 98 raise TypeError( 99 f"{op} not supported for the following dtypes: " 100 f"{self.dtype}, {other.dtype}" 101 ) File /datasets/charlesb/mambaforge/envs/decimal/lib/python3.10/contextlib.py:79, in ContextDecorator.__call__..inner(*args, **kwds) 76 @wraps(func) 77 def inner(*args, **kwds): 78 with self._recreate_cm(): ---> 79 return func(*args, **kwds) File binaryop.pyx:188, in cudf._lib.binaryop.binaryop() File binaryop.pyx:130, in cudf._lib.binaryop.binaryop_v_s() ValueError: CUDF failure at:/opt/conda/conda-bld/work/cpp/src/binaryop/binaryop.cpp:206: Unsupported operator for these types ```

Steps/Code to reproduce bug

import cudf
from decimal import Decimal

d = cudf.Series([1, 2, 3])

def f(col):
    col > Decimal("2.0")
    col >= Decimal("2.0")
    col < Decimal("2.0")
    col <= Decimal("2.0")
    col == Decimal("2.0")
    col != Decimal("2.0")
    col + Decimal("2.0")
    col - Decimal("2.0")
    col / Decimal("2.0")
    col * Decimal("2.0")

# succeeds
f(d.astype(cudf.Decimal128Dtype(1, 0)))

# fails
f(d.astype(cudf.Decimal32Dtype(1, 0)))
f(d.astype(cudf.Decimal64Dtype(1, 0)))

Expected behavior I would expect this operation to succeed and ideally return a column of the same decimal type.

Environment overview (please complete the following information)

Environment details

Click here to see environment details

     **git***
print_env.sh: 11: [: true: unexpected operator
     Not inside a git repository

     ***OS Information***
     DGX_NAME="DGX Server"
     DGX_PRETTY_NAME="NVIDIA DGX Server"
     DGX_SWBUILD_DATE="2020-03-04"
     DGX_SWBUILD_VERSION="4.4.0"
     DGX_COMMIT_ID="ee09ebc"
     DGX_PLATFORM="DGX Server for DGX-1"
     DGX_SERIAL_NUMBER="QTFCOU8220020"

     DGX_R418_REPO_ENABLED=20220727-142459

     DGX_OTA_VERSION="4.13.0"
     DGX_OTA_DATE="Wed Jul 27 14:36:02 PDT 2022"
     DISTRIB_ID=Ubuntu
     DISTRIB_RELEASE=18.04
     DISTRIB_CODENAME=bionic
     DISTRIB_DESCRIPTION="Ubuntu 18.04.6 LTS"
     NAME="Ubuntu"
     VERSION="18.04.6 LTS (Bionic Beaver)"
     ID=ubuntu
     ID_LIKE=debian
     PRETTY_NAME="Ubuntu 18.04.6 LTS"
     VERSION_ID="18.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=bionic
     UBUNTU_CODENAME=bionic
     Linux dgx13 4.15.0-189-generic #200-Ubuntu SMP Wed Jun 22 19:53:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

     ***GPU Information***
     Tue Mar 28 08:16:49 2023       
     +-----------------------------------------------------------------------------+
     | NVIDIA-SMI 510.73.08    Driver Version: 510.73.08    CUDA Version: 11.6     |
     |-------------------------------+----------------------+----------------------+
     | 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  Tesla V100-SXM2...  On   | 00000000:06:00.0 Off |                    0 |
     | N/A   33C    P0    55W / 300W |   2137MiB / 32768MiB |      0%      Default |
     |                               |                      |                  N/A |
     +-------------------------------+----------------------+----------------------+
     |   1  Tesla V100-SXM2...  On   | 00000000:07:00.0 Off |                    0 |
     | N/A   32C    P0    55W / 300W |    306MiB / 32768MiB |      0%      Default |
     |                               |                      |                  N/A |
     +-------------------------------+----------------------+----------------------+
     |   2  Tesla V100-SXM2...  On   | 00000000:0A:00.0 Off |                    0 |
     | N/A   34C    P0    54W / 300W |    306MiB / 32768MiB |      0%      Default |
     |                               |                      |                  N/A |
     +-------------------------------+----------------------+----------------------+
     |   3  Tesla V100-SXM2...  On   | 00000000:0B:00.0 Off |                    0 |
     | N/A   30C    P0    54W / 300W |    812MiB / 32768MiB |      0%      Default |
     |                               |                      |                  N/A |
     +-------------------------------+----------------------+----------------------+
     |   4  Tesla V100-SXM2...  On   | 00000000:85:00.0 Off |                    0 |
     | N/A   33C    P0    55W / 300W |    786MiB / 32768MiB |      0%      Default |
     |                               |                      |                  N/A |
     +-------------------------------+----------------------+----------------------+
     |   5  Tesla V100-SXM2...  On   | 00000000:86:00.0 Off |                    0 |
     | N/A   32C    P0    55W / 300W |    306MiB / 32768MiB |      0%      Default |
     |                               |                      |                  N/A |
     +-------------------------------+----------------------+----------------------+
     |   6  Tesla V100-SXM2...  On   | 00000000:89:00.0 Off |                    0 |
     | N/A   36C    P0    56W / 300W |    808MiB / 32768MiB |      0%      Default |
     |                               |                      |                  N/A |
     +-------------------------------+----------------------+----------------------+
     |   7  Tesla V100-SXM2...  On   | 00000000:8A:00.0 Off |                    0 |
     | N/A   31C    P0    53W / 300W |    306MiB / 32768MiB |      0%      Default |
     |                               |                      |                  N/A |
     +-------------------------------+----------------------+----------------------+

     +-----------------------------------------------------------------------------+
     | Processes:                                                                  |
     |  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
     |        ID   ID                                                   Usage      |
     |=============================================================================|
     |    0   N/A  N/A     41212      C   ...-apply-fix/bin/python3.10      763MiB |
     |    0   N/A  N/A     52670      C   ...vs/decimal/bin/python3.10      303MiB |
     |    0   N/A  N/A     53767      C   ...-apply-fix/bin/python3.10      303MiB |
     |    0   N/A  N/A     76592      C   ...vs/decimal/bin/python3.10      763MiB |
     |    1   N/A  N/A     53771      C   ...-apply-fix/bin/python3.10      303MiB |
     |    2   N/A  N/A     53774      C   ...-apply-fix/bin/python3.10      303MiB |
     |    3   N/A  N/A     53777      C   ...-apply-fix/bin/python3.10      809MiB |
     |    4   N/A  N/A     53780      C   ...-apply-fix/bin/python3.10      783MiB |
     |    5   N/A  N/A     53783      C   ...-apply-fix/bin/python3.10      303MiB |
     |    6   N/A  N/A     53787      C   ...-apply-fix/bin/python3.10      805MiB |
     |    7   N/A  N/A     53789      C   ...-apply-fix/bin/python3.10      303MiB |
     +-----------------------------------------------------------------------------+

     ***CPU***
     Architecture:        x86_64
     CPU op-mode(s):      32-bit, 64-bit
     Byte Order:          Little Endian
     CPU(s):              80
     On-line CPU(s) list: 0-79
     Thread(s) per core:  2
     Core(s) per socket:  20
     Socket(s):           2
     NUMA node(s):        2
     Vendor ID:           GenuineIntel
     CPU family:          6
     Model:               79
     Model name:          Intel(R) Xeon(R) CPU E5-2698 v4 @ 2.20GHz
     Stepping:            1
     CPU MHz:             2681.262
     CPU max MHz:         3600.0000
     CPU min MHz:         1200.0000
     BogoMIPS:            4390.08
     Virtualization:      VT-x
     L1d cache:           32K
     L1i cache:           32K
     L2 cache:            256K
     L3 cache:            51200K
     NUMA node0 CPU(s):   0-19,40-59
     NUMA node1 CPU(s):   20-39,60-79
     Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap intel_pt xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts md_clear flush_l1d

     ***CMake***
     /usr/bin/cmake
     cmake version 3.10.2

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

     ***g++***
     /usr/bin/g++
     g++ (Ubuntu 9.4.0-1ubuntu1~18.04) 9.4.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***
     /datasets/charlesb/mambaforge/envs/decimal/bin/nvcc
     nvcc: NVIDIA (R) Cuda compiler driver
     Copyright (c) 2005-2023 NVIDIA Corporation
     Built on Tue_Feb__7_19:32:13_PST_2023
     Cuda compilation tools, release 12.1, V12.1.66
     Build cuda_12.1.r12.1/compiler.32415258_0

     ***Python***
     /datasets/charlesb/mambaforge/envs/decimal/bin/python
     Python 3.10.9

     ***Environment Variables***
     PATH                            : /home/nfs/charlesb/.local/bin:/home/nfs/charlesb/.vscode-server/bin/ee2b180d582a7f601fa6ecfdad8d9fd269ab1884/bin/remote-cli:/datasets/charlesb/mambaforge/envs/decimal/bin:/datasets/charlesb/mambaforge/condabin:/home/nfs/charlesb/.local/bin:/usr/local/cuda/bin:/opt/bin:/home/nfs/charlesb/.cargo/bin:/usr/local/cuda/bin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
     LD_LIBRARY_PATH                 : 
     NUMBAPRO_NVVM                   : 
     NUMBAPRO_LIBDEVICE              : 
     CONDA_PREFIX                    : /datasets/charlesb/mambaforge/envs/decimal
     PYTHON_PATH                     : 

     ***conda packages***
     conda is /datasets/charlesb/mambaforge/condabin/conda
     /datasets/charlesb/mambaforge/condabin/conda
     # packages in environment at /datasets/charlesb/mambaforge/envs/decimal:
     #
     # Name                    Version                   Build  Channel
     _libgcc_mutex             0.1                 conda_forge    conda-forge
     _openmp_mutex             4.5                       2_gnu    conda-forge
     adagio                    0.2.4              pyhd8ed1ab_0    conda-forge
     alabaster                 0.7.13             pyhd8ed1ab_0    conda-forge
     alembic                   1.10.2             pyhd8ed1ab_0    conda-forge
     antlr-python-runtime      4.12.0             pyhd8ed1ab_0    conda-forge
     antlr4-python3-runtime    4.12.0             pyh1a96a4e_0    conda-forge
     anyio                     3.6.2              pyhd8ed1ab_0    conda-forge
     appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
     arrow-cpp                 10.0.1          ha770c72_17_cpu    conda-forge
     asttokens                 2.2.1              pyhd8ed1ab_0    conda-forge
     attrs                     22.2.0             pyh71513ae_0    conda-forge
     aws-c-auth                0.6.26               hdca2abe_0    conda-forge
     aws-c-cal                 0.5.21               h48707d8_2    conda-forge
     aws-c-common              0.8.14               h0b41bf4_0    conda-forge
     aws-c-compression         0.2.16               h03acc5a_5    conda-forge
     aws-c-event-stream        0.2.20               h00877a2_4    conda-forge
     aws-c-http                0.7.5                hf342b9f_5    conda-forge
     aws-c-io                  0.13.19              hef0810e_1    conda-forge
     aws-c-mqtt                0.8.6               h337b09f_11    conda-forge
     aws-c-s3                  0.2.7                hde0a405_0    conda-forge
     aws-c-sdkutils            0.1.8                h03acc5a_0    conda-forge
     aws-checksums             0.1.14               h03acc5a_5    conda-forge
     aws-crt-cpp               0.19.8              h85f3b07_11    conda-forge
     aws-sdk-cpp               1.10.57              h17c43bd_8    conda-forge
     babel                     2.12.1             pyhd8ed1ab_1    conda-forge
     backcall                  0.2.0              pyh9f0ad1d_0    conda-forge
     backports                 1.0                pyhd8ed1ab_3    conda-forge
     backports.functools_lru_cache 1.6.4              pyhd8ed1ab_0    conda-forge
     bcrypt                    3.2.2           py310h5764c6d_1    conda-forge
     blinker                   1.5                pyhd8ed1ab_0    conda-forge
     bokeh                     2.4.3              pyhd8ed1ab_3    conda-forge
     brotli                    1.0.9                h166bdaf_8    conda-forge
     brotli-bin                1.0.9                h166bdaf_8    conda-forge
     brotlipy                  0.7.0           py310h5764c6d_1005    conda-forge
     bzip2                     1.0.8                h7f98852_4    conda-forge
     c-ares                    1.18.1               h7f98852_0    conda-forge
     ca-certificates           2022.12.7            ha878542_0    conda-forge
     cachetools                5.3.0              pyhd8ed1ab_0    conda-forge
     certifi                   2022.12.7          pyhd8ed1ab_0    conda-forge
     cffi                      1.15.1          py310h255011f_3    conda-forge
     cfgv                      3.3.1              pyhd8ed1ab_0    conda-forge
     charset-normalizer        2.1.1              pyhd8ed1ab_0    conda-forge
     ciso8601                  2.3.0           py310h1fa729e_0    conda-forge
     click                     8.1.3           unix_pyhd8ed1ab_2    conda-forge
     cloudpickle               2.2.1              pyhd8ed1ab_0    conda-forge
     colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
     configparser              5.3.0              pyhd8ed1ab_0    conda-forge
     contourpy                 1.0.7           py310hdf3cbec_0    conda-forge
     coverage                  7.2.2           py310h1fa729e_0    conda-forge
     cryptography              39.0.2          py310h34c0648_0    conda-forge
     cubinlinker               0.2.2           py310hf09951c_0    rapidsai
     cuda-cccl                 12.1.55                       0    nvidia
     cuda-command-line-tools   12.1.0                        0    nvidia
     cuda-compiler             12.1.0                        0    nvidia
     cuda-cudart               12.1.55                       0    nvidia
     cuda-cudart-dev           12.1.55                       0    nvidia
     cuda-cuobjdump            12.1.55                       0    nvidia
     cuda-cupti                12.1.62                       0    nvidia
     cuda-cuxxfilt             12.1.55                       0    nvidia
     cuda-documentation        12.1.55                       0    nvidia
     cuda-driver-dev           12.1.55                       0    nvidia
     cuda-gdb                  12.1.55                       0    nvidia
     cuda-libraries            11.8.0                        0    nvidia
     cuda-libraries-dev        11.8.0                        0    nvidia
     cuda-nsight               12.1.55                       0    nvidia
     cuda-nsight-compute       12.1.0                        0    nvidia
     cuda-nvcc                 12.1.66                       0    nvidia
     cuda-nvdisasm             12.1.55                       0    nvidia
     cuda-nvml-dev             12.1.55                       0    nvidia
     cuda-nvprof               12.1.55                       0    nvidia
     cuda-nvprune              12.1.55                       0    nvidia
     cuda-nvrtc                12.1.55                       0    nvidia
     cuda-nvrtc-dev            12.1.55                       0    nvidia
     cuda-nvtx                 12.1.66                       0    nvidia
     cuda-nvvp                 12.1.55                       0    nvidia
     cuda-profiler-api         11.8.86                       0    nvidia
     cuda-python               11.8.1          py310h3fd9d12_0    nvidia
     cuda-sanitizer-api        12.1.55                       0    nvidia
     cuda-toolkit              11.8.0                        0    nvidia
     cuda-tools                11.8.0                        0    nvidia
     cuda-visual-tools         11.8.0                        0    nvidia
     cudatoolkit               11.5.1               hcf5317a_9    nvidia
     cudf                      23.04.00a       cuda_11_py310_230321_g84ac1d5a87_208    rapidsai-nightly
     cuml                      23.04.00a       cuda11_py310_230320_g6976c8b89_91    rapidsai-nightly
     cupy                      11.6.0          py310h9216885_0    conda-forge
     cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
     cytoolz                   0.12.0          py310h5764c6d_1    conda-forge
     dask                      2023.3.1           pyhd8ed1ab_0    conda-forge
     dask-core                 2023.3.1           pyhd8ed1ab_0    conda-forge
     dask-cuda                 23.04.00a       py310_230313_gec2de78_38    rapidsai-nightly
     dask-cudf                 23.04.00a       cuda_11_py310_230321_g84ac1d5a87_208    rapidsai-nightly
     dask-sql                  2023.2.0+48.gb65c40e           dev_0    
     databricks-cli            0.17.5             pyhd8ed1ab_0    conda-forge
     deap                      1.3.3           py310h769672d_1    conda-forge
     decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
     distlib                   0.3.6              pyhd8ed1ab_0    conda-forge
     distributed               2023.3.1           pyhd8ed1ab_0    conda-forge
     dlpack                    0.5                  h9c3ff4c_0    conda-forge
     docker-py                 6.0.0              pyhd8ed1ab_0    conda-forge
     docutils                  0.19            py310hff52083_1    conda-forge
     entrypoints               0.4                pyhd8ed1ab_0    conda-forge
     exceptiongroup            1.1.1              pyhd8ed1ab_0    conda-forge
     execnet                   1.9.0              pyhd8ed1ab_0    conda-forge
     executing                 1.2.0              pyhd8ed1ab_0    conda-forge
     faiss-proc                1.0.0                      cuda    rapidsai
     fastapi                   0.86.0             pyhd8ed1ab_0    conda-forge
     fastavro                  1.7.3           py310h1fa729e_0    conda-forge
     fastrlock                 0.8             py310hd8f1fbe_3    conda-forge
     filelock                  3.10.0             pyhd8ed1ab_0    conda-forge
     flask                     2.2.3              pyhd8ed1ab_0    conda-forge
     fmt                       9.1.0                h924138e_0    conda-forge
     fonttools                 4.39.2          py310h1fa729e_0    conda-forge
     freetype                  2.12.1               hca18f0e_1    conda-forge
     fs                        2.4.15             pyhd8ed1ab_0    conda-forge
     fsspec                    2023.3.0           pyhd8ed1ab_1    conda-forge
     fugue                     0.8.1              pyhd8ed1ab_0    conda-forge
     fugue-sql-antlr           0.1.5              pyhd8ed1ab_0    conda-forge
     future                    0.18.3             pyhd8ed1ab_0    conda-forge
     gds-tools                 1.6.0.25                      0    nvidia
     gflags                    2.2.2             he1b5a44_1004    conda-forge
     gitdb                     4.0.10             pyhd8ed1ab_0    conda-forge
     gitpython                 3.1.31             pyhd8ed1ab_0    conda-forge
     glog                      0.6.0                h6f12383_0    conda-forge
     greenlet                  2.0.2           py310heca2aa9_0    conda-forge
     gunicorn                  20.1.0          py310hff52083_3    conda-forge
     h11                       0.14.0             pyhd8ed1ab_0    conda-forge
     heapdict                  1.0.1                      py_0    conda-forge
     identify                  2.5.21             pyhd8ed1ab_0    conda-forge
     idna                      3.4                pyhd8ed1ab_0    conda-forge
     imagesize                 1.4.1              pyhd8ed1ab_0    conda-forge
     importlib-metadata        6.0.0              pyha770c72_0    conda-forge
     importlib_resources       5.12.0             pyhd8ed1ab_0    conda-forge
     iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
     intake                    0.6.8              pyhd8ed1ab_0    conda-forge
     ipython                   8.11.0             pyh41d4057_0    conda-forge
     itsdangerous              2.1.2              pyhd8ed1ab_0    conda-forge
     jedi                      0.18.2             pyhd8ed1ab_0    conda-forge
     jinja2                    3.1.2              pyhd8ed1ab_1    conda-forge
     joblib                    1.2.0              pyhd8ed1ab_0    conda-forge
     jsonschema                4.17.3             pyhd8ed1ab_0    conda-forge
     keyutils                  1.6.1                h166bdaf_0    conda-forge
     kiwisolver                1.4.4           py310hbf28c38_1    conda-forge
     krb5                      1.20.1               h81ceb04_0    conda-forge
     lcms2                     2.15                 haa2dc70_1    conda-forge
     ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
     lerc                      4.0.0                h27087fc_0    conda-forge
     libabseil                 20230125.0      cxx17_hcb278e6_1    conda-forge
     libarrow                  10.0.1          h51ec05e_17_cpu    conda-forge
     libblas                   3.9.0           16_linux64_openblas    conda-forge
     libbrotlicommon           1.0.9                h166bdaf_8    conda-forge
     libbrotlidec              1.0.9                h166bdaf_8    conda-forge
     libbrotlienc              1.0.9                h166bdaf_8    conda-forge
     libcblas                  3.9.0           16_linux64_openblas    conda-forge
     libcrc32c                 1.1.2                h9c3ff4c_0    conda-forge
     libcublas                 11.11.3.6                     0    nvidia
     libcublas-dev             11.11.3.6                     0    nvidia
     libcudf                   23.04.00a       cuda11_230317_gd9e1b90dc1_196    rapidsai-nightly
     libcufft                  10.9.0.58                     0    nvidia
     libcufft-dev              10.9.0.58                     0    nvidia
     libcufile                 1.6.0.25                      0    nvidia
     libcufile-dev             1.6.0.25                      0    nvidia
     libcuml                   23.04.00a       cuda11_230317_g417a36e22_87    rapidsai-nightly
     libcumlprims              23.04.00a       cuda11_230208_gc3bf2c8_4    rapidsai-nightly
     libcurand                 10.3.0.86                     0    nvidia
     libcurand-dev             10.3.0.86                     0    nvidia
     libcurl                   7.88.1               hdc1c0ab_0    conda-forge
     libcusolver               11.4.1.48                     0    nvidia
     libcusolver-dev           11.4.1.48                     0    nvidia
     libcusparse               11.7.5.86                     0    nvidia
     libcusparse-dev           11.7.5.86                     0    nvidia
     libdeflate                1.17                 h0b41bf4_0    conda-forge
     libedit                   3.1.20191231         he28a2e2_2    conda-forge
     libev                     4.33                 h516909a_1    conda-forge
     libevent                  2.1.10               h28343ad_4    conda-forge
     libfaiss                  1.7.2           cuda112hb18a002_3_cuda    conda-forge
     libffi                    3.4.2                h7f98852_5    conda-forge
     libgcc-ng                 12.2.0              h65d4601_19    conda-forge
     libgfortran-ng            12.2.0              h69a702a_19    conda-forge
     libgfortran5              12.2.0              h337968e_19    conda-forge
     libgomp                   12.2.0              h65d4601_19    conda-forge
     libgoogle-cloud           2.8.0                h0bc5f78_1    conda-forge
     libgrpc                   1.52.1               hcf146ea_1    conda-forge
     libjpeg-turbo             2.1.5.1              h0b41bf4_0    conda-forge
     liblapack                 3.9.0           16_linux64_openblas    conda-forge
     libllvm11                 11.1.0               he0ac6c6_5    conda-forge
     libnghttp2                1.52.0               h61bc06f_0    conda-forge
     libnpp                    12.0.2.50                     0    nvidia
     libnpp-dev                12.0.2.50                     0    nvidia
     libnsl                    2.0.0                h7f98852_0    conda-forge
     libnvjpeg                 12.1.0.39                     0    nvidia
     libnvjpeg-dev             12.1.0.39                     0    nvidia
     libopenblas               0.3.21          pthreads_h78a6416_3    conda-forge
     libpng                    1.6.39               h753d276_0    conda-forge
     libpq                     15.2                 hb675445_0    conda-forge
     libprotobuf               3.21.12              h3eb15da_0    conda-forge
     libraft-distance          23.04.00a       cuda11_230317_g40f246dd_101    rapidsai-nightly
     libraft-headers           23.04.00a       cuda11_230317_g40f246dd_101    rapidsai-nightly
     libraft-nn                23.04.00a       cuda11_230317_g40f246dd_101    rapidsai-nightly
     librmm                    23.04.00a       cuda11_230316_gd26ebfc9_31    rapidsai-nightly
     libsodium                 1.0.18               h36c2ea0_1    conda-forge
     libsqlite                 3.40.0               h753d276_0    conda-forge
     libssh2                   1.10.0               hf14f497_3    conda-forge
     libstdcxx-ng              12.2.0              h46fd767_19    conda-forge
     libthrift                 0.18.1               h5e4af38_0    conda-forge
     libtiff                   4.5.0                hddfeb54_5    conda-forge
     libutf8proc               2.8.0                h166bdaf_0    conda-forge
     libuuid                   2.32.1            h7f98852_1000    conda-forge
     libwebp-base              1.3.0                h0b41bf4_0    conda-forge
     libxcb                    1.13              h7f98852_1004    conda-forge
     libxgboost                1.7.1dev.rapidsai23.04       cuda_11_3    rapidsai-nightly
     libzlib                   1.2.13               h166bdaf_4    conda-forge
     lightgbm                  3.3.5           py310heca2aa9_0    conda-forge
     llvmlite                  0.39.1          py310h58363a5_1    conda-forge
     locket                    1.0.0              pyhd8ed1ab_0    conda-forge
     lz4                       4.3.2           py310h0cfdcf0_0    conda-forge
     lz4-c                     1.9.4                hcb278e6_0    conda-forge
     mako                      1.2.4              pyhd8ed1ab_0    conda-forge
     markdown                  3.4.1              pyhd8ed1ab_0    conda-forge
     markupsafe                2.1.2           py310h1fa729e_0    conda-forge
     matplotlib-base           3.7.1           py310he60537e_0    conda-forge
     matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
     maturin                   0.14.15         py310h4426083_0    conda-forge
     mlflow                    2.2.2           py310ha13cd29_0    conda-forge
     mock                      5.0.1              pyhd8ed1ab_0    conda-forge
     msgpack-python            1.0.5           py310hdf3cbec_0    conda-forge
     munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
     nccl                      2.14.3.1             h0800d71_0    conda-forge
     ncurses                   6.3                  h27087fc_1    conda-forge
     nodeenv                   1.7.0              pyhd8ed1ab_0    conda-forge
     nsight-compute            2023.1.0.15                   0    nvidia
     numba                     0.56.4          py310ha5257ce_0    conda-forge
     numpy                     1.23.5          py310h53a5b5f_0    conda-forge
     nvtx                      0.2.3           py310h5764c6d_2    conda-forge
     oauthlib                  3.2.2              pyhd8ed1ab_0    conda-forge
     openjpeg                  2.5.0                hfec8fc6_2    conda-forge
     openssl                   3.1.0                h0b41bf4_0    conda-forge
     orc                       1.8.3                hfdbbad2_0    conda-forge
     packaging                 23.0               pyhd8ed1ab_0    conda-forge
     pandas                    1.5.3           py310h9b08913_0    conda-forge
     paramiko                  3.1.0              pyhd8ed1ab_0    conda-forge
     parquet-cpp               1.5.1                         2    conda-forge
     parso                     0.8.3              pyhd8ed1ab_0    conda-forge
     partd                     1.3.0              pyhd8ed1ab_0    conda-forge
     pexpect                   4.8.0              pyh1a96a4e_2    conda-forge
     pickleshare               0.7.5                   py_1003    conda-forge
     pillow                    9.4.0           py310h065c6d2_2    conda-forge
     pip                       23.0.1             pyhd8ed1ab_0    conda-forge
     pkgutil-resolve-name      1.3.10             pyhd8ed1ab_0    conda-forge
     platformdirs              3.1.1              pyhd8ed1ab_0    conda-forge
     pluggy                    1.0.0              pyhd8ed1ab_5    conda-forge
     pooch                     1.7.0              pyhd8ed1ab_0    conda-forge
     pre-commit                3.2.0              pyha770c72_0    conda-forge
     prometheus_client         0.16.0             pyhd8ed1ab_0    conda-forge
     prometheus_flask_exporter 0.22.3             pyhd8ed1ab_0    conda-forge
     prompt-toolkit            3.0.38             pyha770c72_0    conda-forge
     prompt_toolkit            3.0.38               hd8ed1ab_0    conda-forge
     protobuf                  4.21.12         py310heca2aa9_0    conda-forge
     psutil                    5.9.4           py310h5764c6d_0    conda-forge
     psycopg2                  2.9.3           py310h416cc33_2    conda-forge
     pthread-stubs             0.4               h36c2ea0_1001    conda-forge
     ptxcompiler               0.7.0           py310h01a121a_3    conda-forge
     ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
     pure-sasl                 0.6.2              pyhd8ed1ab_0    conda-forge
     pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
     py                        1.11.0             pyh6c4a22f_0    conda-forge
     py-xgboost                1.7.1dev.rapidsai23.04 cuda_11_py310_3    rapidsai-nightly
     pyarrow                   10.0.1          py310h633f555_17_cpu    conda-forge
     pycparser                 2.21               pyhd8ed1ab_0    conda-forge
     pydantic                  1.10.6          py310h1fa729e_0    conda-forge
     pygments                  2.14.0             pyhd8ed1ab_0    conda-forge
     pyhive                    0.6.5              pyhd8ed1ab_0    conda-forge
     pyjwt                     2.6.0              pyhd8ed1ab_0    conda-forge
     pylibraft                 23.04.00a       cuda11_py310_230317_g40f246dd_101    rapidsai-nightly
     pynacl                    1.5.0           py310h5764c6d_2    conda-forge
     pynvml                    11.4.1             pyhd8ed1ab_0    conda-forge
     pyopenssl                 23.0.0             pyhd8ed1ab_0    conda-forge
     pyparsing                 3.0.9              pyhd8ed1ab_0    conda-forge
     pyrsistent                0.19.3          py310h1fa729e_0    conda-forge
     pysocks                   1.7.1              pyha2e5f31_6    conda-forge
     pytest                    7.2.2              pyhd8ed1ab_0    conda-forge
     pytest-cov                4.0.0              pyhd8ed1ab_0    conda-forge
     pytest-rerunfailures      11.1.2             pyhd8ed1ab_0    conda-forge
     pytest-xdist              3.2.1              pyhd8ed1ab_0    conda-forge
     python                    3.10.9          he550d4f_0_cpython    conda-forge
     python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
     python-tzdata             2022.7             pyhd8ed1ab_0    conda-forge
     python_abi                3.10                    3_cp310    conda-forge
     pytz                      2022.7.1           pyhd8ed1ab_0    conda-forge
     pytz-deprecation-shim     0.1.0.post0     py310hff52083_3    conda-forge
     pywin32-on-windows        0.1.0              pyh1179c8e_3    conda-forge
     pyyaml                    6.0             py310h5764c6d_5    conda-forge
     qpd                       0.4.0              pyhd8ed1ab_0    conda-forge
     querystring_parser        1.2.4                      py_0    conda-forge
     raft-dask                 23.04.00a       cuda11_py310_230317_g40f246dd_101    rapidsai-nightly
     re2                       2023.02.02           hcb278e6_0    conda-forge
     readline                  8.1.2                h0f457ee_0    conda-forge
     requests                  2.28.2             pyhd8ed1ab_0    conda-forge
     rmm                       23.04.00a       cuda11_py310_230316_gd26ebfc9_31    rapidsai-nightly
     s2n                       1.3.39               h3358134_0    conda-forge
     scikit-learn              1.2.2           py310h209a8ca_0    conda-forge
     scipy                     1.10.1          py310h8deb116_0    conda-forge
     semantic_version          2.10.0             pyhd8ed1ab_0    conda-forge
     setuptools                67.6.0             pyhd8ed1ab_0    conda-forge
     setuptools-rust           1.5.2              pyhd8ed1ab_0    conda-forge
     shap                      0.41.0          py310h769672d_0    conda-forge
     six                       1.16.0             pyh6c4a22f_0    conda-forge
     slicer                    0.0.7              pyhd8ed1ab_0    conda-forge
     smmap                     3.0.5              pyh44b312d_0    conda-forge
     snappy                    1.1.10               h9fff704_0    conda-forge
     sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
     snowballstemmer           2.2.0              pyhd8ed1ab_0    conda-forge
     sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
     spdlog                    1.11.0               h9b3ece8_1    conda-forge
     sphinx                    6.1.3              pyhd8ed1ab_0    conda-forge
     sphinxcontrib-applehelp   1.0.4              pyhd8ed1ab_0    conda-forge
     sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
     sphinxcontrib-htmlhelp    2.0.1              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_2    conda-forge
     sqlalchemy                1.4.46          py310h1fa729e_0    conda-forge
     sqlglot                   11.3.7             pyhd8ed1ab_0    conda-forge
     sqlparse                  0.4.3              pyhd8ed1ab_0    conda-forge
     stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
     starlette                 0.20.4             pyhd8ed1ab_1    conda-forge
     stopit                    1.1.2                      py_0    conda-forge
     tabulate                  0.9.0              pyhd8ed1ab_1    conda-forge
     tblib                     1.7.0              pyhd8ed1ab_0    conda-forge
     threadpoolctl             3.1.0              pyh8a188c0_0    conda-forge
     thrift                    0.18.1          py310heca2aa9_0    conda-forge
     thrift_sasl               0.4.3              pyhd8ed1ab_2    conda-forge
     tk                        8.6.12               h27826a3_0    conda-forge
     toml                      0.10.2             pyhd8ed1ab_0    conda-forge
     tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
     toolz                     0.12.0             pyhd8ed1ab_0    conda-forge
     tornado                   6.2             py310h5764c6d_1    conda-forge
     tpot                      0.11.7             pyhd8ed1ab_1    conda-forge
     tqdm                      4.65.0             pyhd8ed1ab_1    conda-forge
     traitlets                 5.9.0              pyhd8ed1ab_0    conda-forge
     treelite                  3.1.0           py310h168469b_0    conda-forge
     treelite-runtime          3.1.0                    pypi_0    pypi
     triad                     0.8.3              pyhd8ed1ab_0    conda-forge
     typing-extensions         4.5.0                hd8ed1ab_0    conda-forge
     typing_extensions         4.5.0              pyha770c72_0    conda-forge
     tzdata                    2022g                h191b570_0    conda-forge
     tzlocal                   4.3             py310hff52083_0    conda-forge
     ucx                       1.13.1               h538f049_1    conda-forge
     ucx-proc                  1.0.0                       gpu    rapidsai
     ucx-py                    0.31.00a230203  py310_g3806c64_4    rapidsai-nightly
     ukkonen                   1.0.1           py310hbf28c38_3    conda-forge
     unicodedata2              15.0.0          py310h5764c6d_0    conda-forge
     update_checker            0.18.0             pyh9f0ad1d_0    conda-forge
     urllib3                   1.26.15            pyhd8ed1ab_0    conda-forge
     uvicorn                   0.21.1          py310hff52083_0    conda-forge
     virtualenv                20.21.0            pyhd8ed1ab_0    conda-forge
     wcwidth                   0.2.6              pyhd8ed1ab_0    conda-forge
     websocket-client          1.5.1              pyhd8ed1ab_0    conda-forge
     werkzeug                  2.2.3              pyhd8ed1ab_0    conda-forge
     wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
     xgboost                   1.7.1dev.rapidsai23.04 cuda_11_py310_3    rapidsai-nightly
     xorg-libxau               1.0.9                h7f98852_0    conda-forge
     xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
     xz                        5.2.6                h166bdaf_0    conda-forge
     yaml                      0.2.5                h7f98852_2    conda-forge
     zict                      2.2.0              pyhd8ed1ab_0    conda-forge
     zipp                      3.15.0             pyhd8ed1ab_0    conda-forge
     zlib                      1.2.13               h166bdaf_4    conda-forge
     zstd                      1.5.2                h3eb15da_6    conda-forge

Additional context This is coming up as part of adding support for decimal columns in dask-sql with https://github.com/dask-contrib/dask-sql/pull/1073.

Digging through the traceback, it seems like the underlying issue here is that Decimal32Column/Decimal64Column._wrap_binop_normalization normalize Decimal objects to cudf.Scalar(..., dtype=decimal128) when it seems like they should be normalize to their corresponding size. I also notice that for binary arithmetic we're seemingly upcasting to decimal128 following the operation:

https://github.com/rapidsai/cudf/blob/173fde9d9ae335014a1aa6de60b417f6f245dcf2/python/cudf/cudf/core/column/decimal.py#L83-L87

But I'm not sure if this is intentional.

charlesbluca commented 1 year ago

Closing out as a duplicate of #12958