rapidsai / cudf

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

[BUG] Parsing string to float is inconsistent between CSV reader and to_numeric #10599

Open andygrove opened 2 years ago

andygrove commented 2 years ago

Describe the bug The parsing of strings to floats has different results in different contexts, as discussed in https://github.com/NVIDIA/spark-rapids/issues/5035.

Parsing floats from CSV

Given the following input file:

0.1
0.2
0.3

The following code parses the floats as follows.

>>> df  = cudf.read_csv("floats.csv", names=["a"], dtype=["float64"])
>>> df['a'][0]
0.1
>>> df['a'][1]
0.2
>>> df['a'][2]
0.30000000000000004

Parsing floats with to_numeric

Parsing the same values using to_numeric produces different results.

>>> s = cudf.Series(['0.1', '0.2', '0.3'])
>>> x = cudf.to_numeric(s)
>>> x[0]
0.09999999999999999
>>> x[1]
0.19999999999999998
>>> x[2]
0.3

Steps/Code to reproduce bug See above code examples.

Expected behavior These two paths should produce consistent results.

Environment overview (please complete the following information) Bare metal (desktop PC).

Environment details

Click here to see environment details

     **git***
     commit 9932a03894f12f9c3f83ae635792c7d79eb430a1 (HEAD, sperlingxx/enable_zero_backref)
     Author: sperlingxx 
     Date:   Wed Mar 30 08:44:00 2022 +0800

     update
     **git submodules***

     ***OS Information***
     DISTRIB_ID=Ubuntu
     DISTRIB_RELEASE=20.04
     DISTRIB_CODENAME=focal
     DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"
     NAME="Ubuntu"
     VERSION="20.04.3 LTS (Focal Fossa)"
     ID=ubuntu
     ID_LIKE=debian
     PRETTY_NAME="Ubuntu 20.04.3 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 ripper 5.13.0-39-generic #44~20.04.1-Ubuntu SMP Thu Mar 24 16:43:35 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

     ***GPU Information***
     Tue Apr  5 14:53:32 2022
     +-----------------------------------------------------------------------------+
     | NVIDIA-SMI 495.29.05    Driver Version: 495.29.05    CUDA Version: 11.5     |
     |-------------------------------+----------------------+----------------------+
     | 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 ...  On   | 00000000:42:00.0  On |                  N/A |
     |  0%   50C    P5    26W / 320W |   1086MiB / 10014MiB |      5%      Default |
     |                               |                      |                  N/A |
     +-------------------------------+----------------------+----------------------+

     +-----------------------------------------------------------------------------+
     | Processes:                                                                  |
     |  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
     |        ID   ID                                                   Usage      |
     |=============================================================================|
     |    0   N/A  N/A      1714      G   /usr/lib/xorg/Xorg                102MiB |
     |    0   N/A  N/A      2459      G   /usr/lib/xorg/Xorg                605MiB |
     |    0   N/A  N/A      2595      G   /usr/bin/gnome-shell              109MiB |
     |    0   N/A  N/A      3028      G   ...AAAAAAAAA= --shared-files        8MiB |
     |    0   N/A  N/A      3409      G   /usr/lib/firefox/firefox          168MiB |
     |    0   N/A  N/A      9759      G   ...veSuggestionsOnlyOnDemand       51MiB |
     |    0   N/A  N/A     39765      G   ..._20525.log --shared-files        4MiB |
     |    0   N/A  N/A    126249      G   ./jetbrains-toolbox                12MiB |
     |    0   N/A  N/A    147354      G   /usr/lib/firefox/firefox            3MiB |
     |    0   N/A  N/A    190794      G   /usr/lib/firefox/firefox            3MiB |
     +-----------------------------------------------------------------------------+

     ***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):                          48
     On-line CPU(s) list:             0-47
     Thread(s) per core:              2
     Core(s) per socket:              24
     Socket(s):                       1
     NUMA node(s):                    4
     Vendor ID:                       AuthenticAMD
     CPU family:                      23
     Model:                           8
     Model name:                      AMD Ryzen Threadripper 2970WX 24-Core Processor
     Stepping:                        2
     Frequency boost:                 enabled
     CPU MHz:                         2166.041
     CPU max MHz:                     3000.0000
     CPU min MHz:                     2200.0000
     BogoMIPS:                        5988.02
     Virtualization:                  AMD-V
     L1d cache:                       768 KiB
     L1i cache:                       1.5 MiB
     L2 cache:                        12 MiB
     L3 cache:                        64 MiB
     NUMA node0 CPU(s):               0-5,24-29
     NUMA node1 CPU(s):               12-17,36-41
     NUMA node2 CPU(s):               6-11,30-35
     NUMA node3 CPU(s):               18-23,42-47
     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; LFENCE, IBPB conditional, STIBP disabled, 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 amd_dcm 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 skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb hw_pstate ssbd ibpb vmmcall fsgsbase bmi1 avx2 smep bmi2 rdseed adx smap clflushopt sha_ni xsaveopt xsavec xgetbv1 xsaves clzero irperf xsaveerptr arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif overflow_recov succor smca sme sev sev_es

     ***CMake***
     /usr/bin/cmake
     cmake version 3.16.3

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

     ***g++***
     /usr/bin/g++
     g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 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***
     /usr/local/cuda/bin/nvcc
     nvcc: NVIDIA (R) Cuda compiler driver
     Copyright (c) 2005-2021 NVIDIA Corporation
     Built on Thu_Nov_18_09:45:30_PST_2021
     Cuda compilation tools, release 11.5, V11.5.119
     Build cuda_11.5.r11.5/compiler.30672275_0

     ***Python***
     /home/andy/miniconda3/envs/rapids-22.04/bin/python
     Python 3.8.13

     ***Environment Variables***
     PATH                            : /home/andy/miniconda3/envs/rapids-22.04/bin:/home/andy/miniconda3/condabin:/home/andy/.cargo/bin:/home/andy/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/apache-maven-3.8.4/bin:mvnd-0.5.2-linux-amd64/bin:/usr/local/cuda/bin
     LD_LIBRARY_PATH                 : :/usr/local/cuda/targets/x86_64-linux/lib/:/usr/local/cuda/lib64
     NUMBAPRO_NVVM                   :
     NUMBAPRO_LIBDEVICE              :
     CONDA_PREFIX                    : /home/andy/miniconda3/envs/rapids-22.04
     PYTHON_PATH                     :

     ***conda packages***
     /home/andy/miniconda3/condabin/conda
     # packages in environment at /home/andy/miniconda3/envs/rapids-22.04:
     #
     # 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
     aiohttp                   3.8.1            py38h0a891b7_1    conda-forge
     aiosignal                 1.2.0              pyhd8ed1ab_0    conda-forge
     alsa-lib                  1.2.3                h516909a_0    conda-forge
     anyio                     3.5.0            py38h578d9bd_0    conda-forge
     appdirs                   1.4.4              pyh9f0ad1d_0    conda-forge
     argon2-cffi               21.3.0             pyhd8ed1ab_0    conda-forge
     argon2-cffi-bindings      21.2.0           py38h497a2fe_1    conda-forge
     arrow-cpp                 6.0.1           py38h4dc56cc_5_cuda    conda-forge
     arrow-cpp-proc            3.0.0                      cuda    conda-forge
     asgiref                   3.5.0              pyhd8ed1ab_0    conda-forge
     asttokens                 2.0.5              pyhd8ed1ab_0    conda-forge
     async-timeout             4.0.2              pyhd8ed1ab_0    conda-forge
     attrs                     21.4.0             pyhd8ed1ab_0    conda-forge
     aws-c-auth                0.6.8                hadad3cd_1    conda-forge
     aws-c-cal                 0.5.12               h70efedd_7    conda-forge
     aws-c-common              0.6.17               h7f98852_0    conda-forge
     aws-c-compression         0.2.14               h7c7754b_7    conda-forge
     aws-c-event-stream        0.2.7               hd2be095_32    conda-forge
     aws-c-http                0.6.10               h416565a_3    conda-forge
     aws-c-io                  0.10.14              he836878_0    conda-forge
     aws-c-mqtt                0.7.10               h885097b_0    conda-forge
     aws-c-s3                  0.1.29               h8d70ed6_0    conda-forge
     aws-c-sdkutils            0.1.1                h7c7754b_4    conda-forge
     aws-checksums             0.1.12               h7c7754b_6    conda-forge
     aws-crt-cpp               0.17.10              h6ab17b9_5    conda-forge
     aws-sdk-cpp               1.9.160              h36ff4c5_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
     backports.zoneinfo        0.2.1            py38h497a2fe_4    conda-forge
     beautifulsoup4            4.10.0             pyha770c72_0    conda-forge
     bleach                    4.1.0              pyhd8ed1ab_0    conda-forge
     blosc                     1.21.0               h9c3ff4c_0    conda-forge
     bokeh                     2.4.2            py38h578d9bd_0    conda-forge
     boost                     1.74.0           py38h2b96118_5    conda-forge
     boost-cpp                 1.74.0               h312852a_4    conda-forge
     brotli                    1.0.9                h166bdaf_7    conda-forge
     brotli-bin                1.0.9                h166bdaf_7    conda-forge
     brotlipy                  0.7.0           py38h0a891b7_1004    conda-forge
     brunsli                   0.1                  h9c3ff4c_0    conda-forge
     bzip2                     1.0.8                h7f98852_4    conda-forge
     c-ares                    1.18.1               h7f98852_0    conda-forge
     c-blosc2                  2.0.4                h5f21a17_1    conda-forge
     ca-certificates           2021.10.8            ha878542_0    conda-forge
     cachetools                5.0.0              pyhd8ed1ab_0    conda-forge
     cairo                     1.16.0            h6cf1ce9_1008    conda-forge
     certifi                   2021.10.8        py38h578d9bd_2    conda-forge
     cffi                      1.15.0           py38h3931269_0    conda-forge
     cfitsio                   3.470                hb418390_7    conda-forge
     charls                    2.2.0                h9c3ff4c_0    conda-forge
     charset-normalizer        2.0.12             pyhd8ed1ab_0    conda-forge
     click                     8.0.4            py38h578d9bd_0    conda-forge
     click-plugins             1.1.1                      py_0    conda-forge
     cligj                     0.7.2              pyhd8ed1ab_1    conda-forge
     cloudpickle               2.0.0              pyhd8ed1ab_0    conda-forge
     colorama                  0.4.4              pyh9f0ad1d_0    conda-forge
     colorcet                  3.0.0              pyhd8ed1ab_0    conda-forge
     cryptography              36.0.2           py38h2b5fc30_1    conda-forge
     cucim                     22.04.00a220405 cuda_11_py38_g7602774_34    rapidsai-nightly
     cuda-python               11.6.1           py38h3fd9d12_0    nvidia
     cudatoolkit               11.5.1               hcf5317a_9    nvidia
     cudf                      22.04.00a220405 cuda_11_py38_g4c84184a3f_304    rapidsai-nightly
     cudf_kafka                22.04.00a220405 py38_g4c84184a3f_304    rapidsai-nightly
     cugraph                   22.04.00a220405 cuda11_py38_g38be932f_101    rapidsai-nightly
     cuml                      22.04.00a220405 cuda11_py38_g5feaf7b74_107    rapidsai-nightly
     cupy                      9.6.0            py38h177b0fd_0    conda-forge
     curl                      7.82.0               h7bff187_0    conda-forge
     cusignal                  22.04.00a220405 py39_g8878bf7_15    rapidsai-nightly
     cuspatial                 22.04.00a220405 py38_g7709a43_19    rapidsai-nightly
     custreamz                 22.04.00a220405 py38_g4c84184a3f_304    rapidsai-nightly
     cuxfilter                 22.04.00a220405 py38_gf9a106c_18    rapidsai-nightly
     cycler                    0.11.0             pyhd8ed1ab_0    conda-forge
     cyrus-sasl                2.1.27               h230043b_5    conda-forge
     cytoolz                   0.11.2           py38h497a2fe_1    conda-forge
     dask                      2022.3.0           pyhd8ed1ab_1    conda-forge
     dask-core                 2022.3.0           pyhd8ed1ab_0    conda-forge
     dask-cuda                 22.04.00a220405         py38_29    rapidsai-nightly
     dask-cudf                 22.04.00a220405 cuda_11_py38_g4c84184a3f_304    rapidsai-nightly
     dask-sql                  2022.1.1a220405  py_gab2aa5a_33    dask/label/dev
     datashader                0.13.1a                    py_0    rapidsai-nightly
     datashape                 0.5.4                      py_1    conda-forge
     debugpy                   1.5.1            py38h709712a_0    conda-forge
     decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
     defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
     distributed               2022.3.0           pyhd8ed1ab_0    conda-forge
     dlpack                    0.5                  h9c3ff4c_0    conda-forge
     entrypoints               0.4                pyhd8ed1ab_0    conda-forge
     executing                 0.8.3              pyhd8ed1ab_0    conda-forge
     expat                     2.4.8                h27087fc_0    conda-forge
     faiss-proc                1.0.0                      cuda    conda-forge
     fastapi                   0.75.1             pyhd8ed1ab_0    conda-forge
     fastavro                  1.4.10           py38h0a891b7_0    conda-forge
     fastrlock                 0.8              py38hfa26641_1    conda-forge
     fiona                     1.8.20           py38hbb147eb_2    conda-forge
     flit-core                 3.7.1              pyhd8ed1ab_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.14.0               h8e229c2_0    conda-forge
     fonts-conda-ecosystem     1                             0    conda-forge
     fonts-conda-forge         1                             0    conda-forge
     fonttools                 4.31.2           py38h0a891b7_0    conda-forge
     freetype                  2.10.4               h0708190_1    conda-forge
     freexl                    1.0.6                h7f98852_0    conda-forge
     frozenlist                1.3.0            py38h0a891b7_1    conda-forge
     fsspec                    2022.3.0           pyhd8ed1ab_0    conda-forge
     gdal                      3.3.2            py38h81a01a0_3    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.7.0                h08e826d_2    conda-forge
     gettext                   0.19.8.1          h73d1719_1008    conda-forge
     gflags                    2.2.2             he1b5a44_1004    conda-forge
     giflib                    5.2.1                h36c2ea0_2    conda-forge
     glog                      0.5.0                h48cff8f_0    conda-forge
     graphite2                 1.3.13            h58526e2_1001    conda-forge
     grpc-cpp                  1.42.0               ha1441d3_1    conda-forge
     h11                       0.13.0             pyhd8ed1ab_0    conda-forge
     harfbuzz                  2.9.1                h83ec7ef_1    conda-forge
     hdf4                      4.2.15               h10796ff_3    conda-forge
     hdf5                      1.12.1          nompi_h2386368_104    conda-forge
     heapdict                  1.0.1                      py_0    conda-forge
     holoviews                 1.14.6             pyhd8ed1ab_0    conda-forge
     icu                       68.2                 h9c3ff4c_0    conda-forge
     idna                      3.3                pyhd8ed1ab_0    conda-forge
     imagecodecs               2021.8.26        py38hb5ce8f7_1    conda-forge
     imageio                   2.16.1             pyhcf75d05_0    conda-forge
     importlib-metadata        4.11.3           py38h578d9bd_1    conda-forge
     importlib_metadata        4.11.3               hd8ed1ab_1    conda-forge
     importlib_resources       5.6.0              pyhd8ed1ab_0    conda-forge
     ipykernel                 6.12.1           py38h7f3c49e_0    conda-forge
     ipython                   8.2.0            py38h578d9bd_0    conda-forge
     ipython_genutils          0.2.0                      py_1    conda-forge
     ipywidgets                7.7.0              pyhd8ed1ab_0    conda-forge
     jbig                      2.1               h7f98852_2003    conda-forge
     jedi                      0.18.1           py38h578d9bd_1    conda-forge
     jinja2                    3.1.1              pyhd8ed1ab_0    conda-forge
     joblib                    1.1.0              pyhd8ed1ab_0    conda-forge
     jpeg                      9e                   h7f98852_0    conda-forge
     jpype1                    1.3.0            py38h1fd1430_2    conda-forge
     json-c                    0.15                 h98cffda_0    conda-forge
     jsonschema                4.4.0              pyhd8ed1ab_0    conda-forge
     jupyter-server-proxy      3.2.1              pyhd8ed1ab_0    conda-forge
     jupyter_client            7.2.1              pyhd8ed1ab_0    conda-forge
     jupyter_core              4.9.2            py38h578d9bd_0    conda-forge
     jupyter_server            1.16.0             pyhd8ed1ab_1    conda-forge
     jupyterlab_pygments       0.1.2              pyh9f0ad1d_0    conda-forge
     jupyterlab_widgets        1.1.0              pyhd8ed1ab_0    conda-forge
     jxrlib                    1.1                  h7f98852_2    conda-forge
     kealib                    1.4.14               h87e4c3c_3    conda-forge
     keyutils                  1.6.1                h166bdaf_0    conda-forge
     kiwisolver                1.4.2            py38h43d8883_1    conda-forge
     krb5                      1.19.3               h3790be6_0    conda-forge
     lcms2                     2.12                 hddcbb42_0    conda-forge
     ld_impl_linux-64          2.36.1               hea4e1c9_2    conda-forge
     lerc                      3.0                  h9c3ff4c_0    conda-forge
     libaec                    1.0.6                h9c3ff4c_0    conda-forge
     libblas                   3.9.0           13_linux64_openblas    conda-forge
     libbrotlicommon           1.0.9                h166bdaf_7    conda-forge
     libbrotlidec              1.0.9                h166bdaf_7    conda-forge
     libbrotlienc              1.0.9                h166bdaf_7    conda-forge
     libcblas                  3.9.0           13_linux64_openblas    conda-forge
     libcucim                  22.04.00a220405 cuda11_g7602774_34    rapidsai-nightly
     libcudf                   22.04.00a220405 cuda11_g4c84184a3f_304    rapidsai-nightly
     libcudf_kafka             22.04.00a220405 g4c84184a3f_304    rapidsai-nightly
     libcugraph                22.04.00a220405 cuda11_g38be932f_101    rapidsai-nightly
     libcugraph_etl            22.04.00a220405 cuda11_g38be932f_101    rapidsai-nightly
     libcugraphops             22.04.00a220405 cuda11_ga9f323f_32    rapidsai-nightly
     libcuml                   22.04.00a220405 cuda11_g5feaf7b74_107    rapidsai-nightly
     libcumlprims              22.04.00a220324 cuda11_g99e8d8f_15    rapidsai-nightly
     libcurl                   7.82.0               h7bff187_0    conda-forge
     libcusolver               11.3.4.124           h33c3c4e_0    nvidia
     libcuspatial              22.04.00a220405 cuda11_g7709a43_19    rapidsai-nightly
     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               h9b69904_4    conda-forge
     libfaiss                  1.7.0           cuda112h5bea7ad_8_cuda    conda-forge
     libffi                    3.4.2                h7f98852_5    conda-forge
     libgcc-ng                 11.2.0              h1d223b6_14    conda-forge
     libgcrypt                 1.10.0               h7f98852_0    conda-forge
     libgdal                   3.3.2                h6acdded_3    conda-forge
     libgfortran-ng            11.2.0              h69a702a_14    conda-forge
     libgfortran5              11.2.0              h5c6108e_14    conda-forge
     libglib                   2.70.2               h174f98d_4    conda-forge
     libgomp                   11.2.0              h1d223b6_14    conda-forge
     libgpg-error              1.44                 h9eb791d_0    conda-forge
     libgsasl                  1.10.0               h5b4c23d_0    conda-forge
     libhwloc                  2.3.0                h5e5b7d1_1    conda-forge
     libiconv                  1.16                 h516909a_0    conda-forge
     libkml                    1.3.0             h238a007_1014    conda-forge
     liblapack                 3.9.0           13_linux64_openblas    conda-forge
     libllvm11                 11.1.0               hf817b99_3    conda-forge
     libnetcdf                 4.8.1           nompi_hb3fd0d9_101    conda-forge
     libnghttp2                1.47.0               h727a467_0    conda-forge
     libnsl                    2.0.0                h7f98852_0    conda-forge
     libntlm                   1.4               h7f98852_1002    conda-forge
     libopenblas               0.3.18          pthreads_h8fe5266_0    conda-forge
     libpng                    1.6.37               h21135ba_2    conda-forge
     libpq                     13.5                 hd57d9b9_1    conda-forge
     libprotobuf               3.19.4               h780b84a_0    conda-forge
     libraft-distance          22.04.00a220405 cuda11_gc509483_112    rapidsai-nightly
     libraft-headers           22.04.00a220405 cuda11_gc509483_112    rapidsai-nightly
     libraft-nn                22.04.00a220405 cuda11_gc509483_112    rapidsai-nightly
     librdkafka                1.7.0                hc49e61c_1    conda-forge
     librmm                    22.04.00a220405 cuda11_g1420689_48    rapidsai-nightly
     librttopo                 1.1.0                h1185371_6    conda-forge
     libsodium                 1.0.18               h36c2ea0_1    conda-forge
     libspatialindex           1.9.3                h9c3ff4c_4    conda-forge
     libspatialite             5.0.1                h5cf074c_8    conda-forge
     libssh2                   1.10.0               ha56f1ee_2    conda-forge
     libstdcxx-ng              11.2.0              he4da1e4_14    conda-forge
     libthrift                 0.15.0               he6d91bd_1    conda-forge
     libtiff                   4.3.0                h6f004c6_2    conda-forge
     libutf8proc               2.7.0                h7f98852_0    conda-forge
     libuuid                   2.32.1            h7f98852_1000    conda-forge
     libuv                     1.43.0               h7f98852_0    conda-forge
     libwebp                   1.2.2                h3452ae3_0    conda-forge
     libwebp-base              1.2.2                h7f98852_1    conda-forge
     libxcb                    1.13              h7f98852_1004    conda-forge
     libxgboost                1.5.2dev.rapidsai22.04       cuda_11_0    rapidsai-nightly
     libxml2                   2.9.12               h72842e0_0    conda-forge
     libzip                    1.8.0                h4de3113_1    conda-forge
     libzlib                   1.2.11            h166bdaf_1014    conda-forge
     libzopfli                 1.0.3                h9c3ff4c_0    conda-forge
     llvmlite                  0.38.0           py38h38d86a4_1    conda-forge
     locket                    0.2.0                      py_2    conda-forge
     lz4                       4.0.0            py38h1bf946c_1    conda-forge
     lz4-c                     1.9.3                h9c3ff4c_1    conda-forge
     mapclassify               2.4.3              pyhd8ed1ab_0    conda-forge
     markdown                  3.3.6              pyhd8ed1ab_0    conda-forge
     markupsafe                2.1.1            py38h0a891b7_1    conda-forge
     matplotlib-base           3.5.1            py38hf4fb855_0    conda-forge
     matplotlib-inline         0.1.3              pyhd8ed1ab_0    conda-forge
     mistune                   0.8.4           py38h497a2fe_1005    conda-forge
     msgpack-python            1.0.3            py38h43d8883_1    conda-forge
     multidict                 6.0.2            py38h0a891b7_1    conda-forge
     multipledispatch          0.6.0                      py_0    conda-forge
     munch                     2.5.0                      py_0    conda-forge
     munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
     nbclient                  0.5.13             pyhd8ed1ab_0    conda-forge
     nbconvert                 6.4.5              pyhd8ed1ab_2    conda-forge
     nbconvert-core            6.4.5              pyhd8ed1ab_2    conda-forge
     nbconvert-pandoc          6.4.5              pyhd8ed1ab_2    conda-forge
     nbformat                  5.3.0              pyhd8ed1ab_0    conda-forge
     nccl                      2.12.7.1             h0800d71_0    conda-forge
     ncurses                   6.3                  h9c3ff4c_0    conda-forge
     nest-asyncio              1.5.5              pyhd8ed1ab_0    conda-forge
     networkx                  2.6.3              pyhd8ed1ab_1    conda-forge
     nodejs                    14.18.3              h92b4a50_1    conda-forge
     notebook                  6.4.10             pyha770c72_0    conda-forge
     nspr                      4.32                 h9c3ff4c_1    conda-forge
     nss                       3.77                 h2350873_0    conda-forge
     numba                     0.55.1           py38h4bf6c61_0    conda-forge
     numpy                     1.21.5           py38h87f13fb_0    conda-forge
     nvtx                      0.2.3            py38h497a2fe_1    conda-forge
     openjdk                   11.0.9.1             h5cc2fde_1    conda-forge
     openjpeg                  2.4.0                hb52868f_1    conda-forge
     openssl                   1.1.1n               h166bdaf_0    conda-forge
     orc                       1.7.1                h1be678f_1    conda-forge
     packaging                 21.3               pyhd8ed1ab_0    conda-forge
     pandas                    1.3.5            py38h43a58ef_0    conda-forge
     pandoc                    2.17.1.1             ha770c72_0    conda-forge
     pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
     panel                     0.12.7             pyhd8ed1ab_0    conda-forge
     param                     1.12.1             pyh6c4a22f_0    conda-forge
     parquet-cpp               1.5.1                         2    conda-forge
     parso                     0.8.3              pyhd8ed1ab_0    conda-forge
     partd                     1.2.0              pyhd8ed1ab_0    conda-forge
     pcre                      8.45                 h9c3ff4c_0    conda-forge
     pexpect                   4.8.0              pyh9f0ad1d_2    conda-forge
     pickleshare               0.7.5                   py_1003    conda-forge
     pillow                    9.1.0            py38h0ee0e06_0    conda-forge
     pip                       22.0.4             pyhd8ed1ab_0    conda-forge
     pixman                    0.40.0               h36c2ea0_0    conda-forge
     poppler                   21.09.0              ha39eefc_3    conda-forge
     poppler-data              0.4.11               hd8ed1ab_0    conda-forge
     postgresql                13.5                 h2510834_1    conda-forge
     proj                      8.1.0                h277dcde_1    conda-forge
     prometheus_client         0.13.1             pyhd8ed1ab_0    conda-forge
     prompt-toolkit            3.0.29             pyha770c72_0    conda-forge
     protobuf                  3.19.4           py38h709712a_0    conda-forge
     psutil                    5.9.0            py38h0a891b7_1    conda-forge
     pthread-stubs             0.4               h36c2ea0_1001    conda-forge
     ptxcompiler               0.2.0            py38h98f4b32_0    rapidsai-nightly
     ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
     pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
     py-xgboost                1.5.2dev.rapidsai22.04  cuda_11_py38_0    rapidsai-nightly
     pyarrow                   6.0.1           py38ha746e9d_5_cuda    conda-forge
     pycparser                 2.21               pyhd8ed1ab_0    conda-forge
     pyct                      0.4.6                      py_0    conda-forge
     pyct-core                 0.4.6                      py_0    conda-forge
     pydantic                  1.9.0            py38h0a891b7_1    conda-forge
     pydeck                    0.5.0              pyh9f0ad1d_0    conda-forge
     pyee                      8.1.0              pyhd8ed1ab_0    conda-forge
     pygments                  2.11.2             pyhd8ed1ab_0    conda-forge
     pylibcugraph              22.04.00a220405 cuda11_py38_g38be932f_101    rapidsai-nightly
     pynvml                    11.4.1             pyhd8ed1ab_0    conda-forge
     pyopenssl                 22.0.0             pyhd8ed1ab_0    conda-forge
     pyparsing                 3.0.7              pyhd8ed1ab_0    conda-forge
     pyppeteer                 1.0.2              pyhd8ed1ab_0    conda-forge
     pyproj                    3.1.0            py38h3701b11_4    conda-forge
     pyraft                    22.04.00a220405 cuda11_py38_gc509483_112    rapidsai-nightly
     pyrsistent                0.18.1           py38h0a891b7_1    conda-forge
     pysocks                   1.7.1            py38h578d9bd_5    conda-forge
     python                    3.8.13          h582c2e5_0_cpython    conda-forge
     python-confluent-kafka    1.7.0            py38h497a2fe_2    conda-forge
     python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
     python-fastjsonschema     2.15.3             pyhd8ed1ab_0    conda-forge
     python-tzdata             2022.1             pyhd8ed1ab_0    conda-forge
     python_abi                3.8                      2_cp38    conda-forge
     pytz                      2022.1             pyhd8ed1ab_0    conda-forge
     pytz-deprecation-shim     0.1.0.post0      py38h578d9bd_1    conda-forge
     pyviz_comms               2.2.0              pyhd8ed1ab_0    conda-forge
     pywavelets                1.3.0            py38h3ec907f_0    conda-forge
     pyyaml                    6.0              py38h0a891b7_4    conda-forge
     pyzmq                     22.3.0           py38hfc09fa9_2    conda-forge
     rapids                    22.04.00a220405 cuda11_py38_g5d1fba5_121    rapidsai-nightly
     rapids-xgboost            22.04.00a220405 cuda11_py38_g5d1fba5_121    rapidsai-nightly
     re2                       2021.11.01           h9c3ff4c_0    conda-forge
     readline                  8.1                  h46c0cb4_0    conda-forge
     requests                  2.27.1             pyhd8ed1ab_0    conda-forge
     rmm                       22.04.00a220405 cuda11_py38_g1420689_48    rapidsai-nightly
     rtree                     0.9.7            py38h02d302b_3    conda-forge
     s2n                       1.3.0                h9b69904_0    conda-forge
     scikit-image              0.19.2           py38h43a58ef_0    conda-forge
     scikit-learn              1.0.2            py38h1561384_0    conda-forge
     scipy                     1.8.0            py38h56a6a73_1    conda-forge
     send2trash                1.8.0              pyhd8ed1ab_0    conda-forge
     setuptools                59.8.0           py38h578d9bd_1    conda-forge
     shapely                   1.8.0            py38hb7fe4a8_0    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_3    conda-forge
     sortedcontainers          2.4.0              pyhd8ed1ab_0    conda-forge
     soupsieve                 2.3.1              pyhd8ed1ab_0    conda-forge
     spdlog                    1.8.5                h4bd325d_1    conda-forge
     sqlite                    3.37.1               h4ff8645_0    conda-forge
     stack_data                0.2.0              pyhd8ed1ab_0    conda-forge
     starlette                 0.17.1             pyhd8ed1ab_0    conda-forge
     streamz                   0.6.3              pyh6c4a22f_0    conda-forge
     tabulate                  0.8.9              pyhd8ed1ab_0    conda-forge
     tblib                     1.7.0              pyhd8ed1ab_0    conda-forge
     terminado                 0.13.3           py38h578d9bd_1    conda-forge
     testpath                  0.6.0              pyhd8ed1ab_0    conda-forge
     threadpoolctl             3.1.0              pyh8a188c0_0    conda-forge
     tifffile                  2021.11.2          pyhd8ed1ab_0    conda-forge
     tiledb                    2.3.4                he87e0bf_0    conda-forge
     tk                        8.6.12               h27826a3_0    conda-forge
     toolz                     0.11.2             pyhd8ed1ab_0    conda-forge
     tornado                   6.1              py38h0a891b7_3    conda-forge
     tqdm                      4.64.0             pyhd8ed1ab_0    conda-forge
     traitlets                 5.1.1              pyhd8ed1ab_0    conda-forge
     treelite                  2.3.0            py38hdd725b4_0    conda-forge
     treelite-runtime          2.3.0                    pypi_0    pypi
     typing-extensions         4.1.1                hd8ed1ab_0    conda-forge
     typing_extensions         4.1.1              pyha770c72_0    conda-forge
     tzcode                    2022a                h166bdaf_0    conda-forge
     tzdata                    2022a                h191b570_0    conda-forge
     tzlocal                   4.2              py38h578d9bd_0    conda-forge
     ucx                       1.12.0+gd367332      cuda11.2_0    rapidsai-nightly
     ucx-proc                  1.0.0                       gpu    rapidsai-nightly
     ucx-py                    0.25.00a220405  py38_gd367332_13    rapidsai-nightly
     unicodedata2              14.0.0           py38h0a891b7_1    conda-forge
     urllib3                   1.26.9             pyhd8ed1ab_0    conda-forge
     uvicorn                   0.17.6           py38h578d9bd_0    conda-forge
     wcwidth                   0.2.5              pyh9f0ad1d_2    conda-forge
     webencodings              0.5.1                      py_1    conda-forge
     websocket-client          1.3.2              pyhd8ed1ab_0    conda-forge
     websockets                10.2             py38h0a891b7_0    conda-forge
     wheel                     0.37.1             pyhd8ed1ab_0    conda-forge
     widgetsnbextension        3.6.0            py38h578d9bd_0    conda-forge
     xarray                    2022.3.0           pyhd8ed1ab_0    conda-forge
     xerces-c                  3.2.3                h9d8b166_3    conda-forge
     xgboost                   1.5.2dev.rapidsai22.04  cuda_11_py38_0    rapidsai-nightly
     xorg-fixesproto           5.0               h7f98852_1002    conda-forge
     xorg-inputproto           2.3.2             h7f98852_1002    conda-forge
     xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
     xorg-libice               1.0.10               h7f98852_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                h7f98852_0    conda-forge
     xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
     xorg-libxext              1.3.4                h7f98852_1    conda-forge
     xorg-libxfixes            5.0.3             h7f98852_1004    conda-forge
     xorg-libxi                1.7.10               h7f98852_0    conda-forge
     xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
     xorg-libxtst              1.2.3             h7f98852_1002    conda-forge
     xorg-recordproto          1.14.2            h7f98852_1002    conda-forge
     xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
     xorg-xextproto            7.3.0             h7f98852_1002    conda-forge
     xorg-xproto               7.0.31            h7f98852_1007    conda-forge
     xz                        5.2.5                h516909a_1    conda-forge
     yaml                      0.2.5                h7f98852_2    conda-forge
     yarl                      1.7.2            py38h0a891b7_2    conda-forge
     zeromq                    4.3.4                h9c3ff4c_1    conda-forge
     zfp                       0.5.5                h9c3ff4c_8    conda-forge
     zict                      2.1.0              pyhd8ed1ab_0    conda-forge
     zipp                      3.8.0              pyhd8ed1ab_0    conda-forge
     zlib                      1.2.11            h166bdaf_1014    conda-forge
     zstd                      1.5.2                ha95c52a_0    conda-forge

Additional context See https://github.com/NVIDIA/spark-rapids/issues/5035

GregoryKimball commented 2 years ago

@davidwendt @ttnghia Do you think there is a bug in our device stod function in convert_floats.cu? I also noticed the bugfix in this function from PR #7410.

@vuule @nvdbaranec I suppose there also could be a bug in our parse_numeric function in parsing_utils.cuh.

My thinking is that we should use the device stod function from cpp/src/strings in cuIO, and also make sure the device stod is solid. What do you guys think?

ttnghia commented 2 years ago

That's because we have different string-to-float parsers: One is from convert_floats.cu and one from parsing_utils.cuh. Maybe they are both correct, but they work differently and produce different results. "different" here is just due to floating-point round-off.

Making both of them producing exactly the same result would be difficult, because they are just different. Unless we can refactor them, extracting a shared function that both of them will just call for parsing string-to-float.

ttnghia commented 2 years ago

Even if we hack/fix one of them to produce the same result this time, it is not guaranteed to not produce different results the next time. The only way to completely solve such inconsistency is to use one utility function called from both places.

vuule commented 2 years ago

Even if we hack/fix one of them to produce the same result this time, it is not guaranteed to not produce different results the next time. The only way to completely solve such inconsistency is to use one utility function called from both places.

Yes, ideally we would have a single implementation. But, if we aligned them and added unit tests, would that not be sufficient to keep the consistency over time?

GregoryKimball commented 2 years ago

I would prefer to have a matching device version of std::stod and use that everywhere. Does NVIDIA already have another implementation of this parser somewhere?

jrhemstad commented 2 years ago

I would prefer to have a matching device version of std::stod and use that everywhere.

Agreed, though I'm not sure if a standard implementation of std::stod would work because it doesn't understand unicode characters. @davidwendt I assume this would be a problem? Or do these functions assume to be working on ASCI characters?

Does NVIDIA already have another implementation of this parser somewhere?

Nope. Doing this right would mean porting the <string> header in libcu++, which would likely be a huge lift, but extremely worthwhile.

davidwendt commented 2 years ago

The std::stod depends mostly on ASCII for the digits and scientific notation, etc. Unfortunately, the standard implementation of std::stod is technically locale dependent. This is one of the many problems with porting the <string> device functions -- the locale classes and data have to be ported as well.

One thing to be aware of is that printing a floating point number involves converting it back to a string in base10 which is also inaccurate. So what is printed does not necessarily reflect how the bits are set in the actual float or double. That said, I will try to investigate why the bits appear to be different in the two implementations.

vuule commented 2 years ago

I think the only difference in capability is that the cuIO version supports hexadecimal values. Good news is that the number base is a template parameter, so stod and parse_numeric are equivalent in some instantiations.

FWIW, we can reorganize how the calling cuIO code is SFINAEd and use stod when parsing decimal floating point values. That gives us the desired alignment, unless parsing hexfloats (it's a thing).

vuule commented 2 years ago

Just realized that the cuIO version also allows for different decimal point characters and thousand separators :( We can't meaningfully switch to stod without changing it.

github-actions[bot] commented 2 years ago

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

karthikeyann commented 2 years ago

Invalid floating pointer number has different behavior in stod and parse_numeric<float>. in stod, an invalid floating pointer number, returns a valid number until it becomes invalid. (use in string column convert to floats) in parse_numeric<float>, it returns NAN error_result = std::numeric_limits<T>::quiet_NaN() (used in cuio)

karthikeyann commented 2 years ago

Initially I modified stod to take care of invalid characters similar to parse_numeric. All tests passed. But io parsing is 20% slower, convert_floats is 6-10% slower After @davidwendt suggestion, I updated parse_numeric as is_float + stod to just take care of extra decimal and thousands characters, similarly is_float(). All tests passed. But io 30% slower, convert_floats no slowdown

karthikeyann commented 2 years ago

Computed difference for few testcases among pandas.read_csv, io (parse_numeric/cudf.read_csv), cudf_stod (cudf.to_numeric), and Cython std::stod.

[ i]                   pdf-stl_stod                    io-stl_stod             cudf_stod-stl_stod       string
[ 0]                            0.0                            0.0                            0.0       0.1
[ 1]                            0.0                            0.0                            0.0       0.2
[ 2]                            0.0          5.551115123125783e-17                            0.0       0.3
[ 3]         -8.326672684688674e-17                            0.0                            0.0       0.123456789012345678901234567890123456780123456780
[ 4]                         -1e-21           1.88079096131566e-37                            0.0       0.000000000000000000001
[ 5]                            0.0          2.220446049250313e-16                            0.0       1.4503599627370496999
[ 6]                            0.0                         -512.0                            0.0       4503599627370496999
GregoryKimball commented 2 years ago

Thank you @karthikeyann for running these test cases. I think the floating point errors you showed above are within the expected range. 20% slower parsing for floats is a concern but not a deal-breaker. Is there no impact to parsing for non-float types? Would you please share the microbenchmark results?

Have you considered @vuule's comments above about decimal and thousands separators?

karthikeyann commented 2 years ago

Is there no impact to parsing for non-float types? Would you please share the microbenchmark results?

Integral types are affected. The most impact is in float types.

./_deps/benchmark-src/tools/compare.py benchmarks OLD/CSV_READER_BENCH.json NEW/CSV_READER_BENCH.json 
Comparing OLD/CSV_READER_BENCH.json to NEW/CSV_READER_BENCH.json
Benchmark                                                          Time             CPU      Time Old      Time New       CPU Old       CPU New
-----------------------------------------------------------------------------------------------------------------------------------------------
CsvRead/integral_file_input/29/0/manual_time                    +0.1396         +0.1361           227           258           227           258
CsvRead/integral_buffer_input/29/1/manual_time                  +0.1888         +0.1862           196           233           195           232
CsvRead/floats_file_input/31/0/manual_time                      +0.2058         +0.2091           261           315           260           315
CsvRead/floats_buffer_input/31/1/manual_time                    +0.2132         +0.2089           229           277           229           277
CsvRead/decimal_file_input/35/0/manual_time                     +0.0259         +0.0245           149           153           149           153
CsvRead/decimal_buffer_input/35/1/manual_time                   +0.0347         +0.0347           118           123           118           122
CsvRead/timestamps_file_input/33/0/manual_time                  +0.1058         +0.1030           501           554           500           551
CsvRead/timestamps_buffer_input/33/1/manual_time                +0.0875         +0.0853           441           479           441           478
CsvRead/durations_file_input/34/0/manual_time                   +0.0823         +0.0777           635           687           635           684
CsvRead/durations_buffer_input/34/1/manual_time                 +0.0890         +0.0890           559           609           559           609
CsvRead/string_file_input/23/0/manual_time                      +0.0006         +0.0083           149           149           148           149
CsvRead/string_buffer_input/23/1/manual_time                    +0.0110         +0.0147           125           126           124           126
CsvRead/column_selection/0/0/1/manual_time                      +0.0872         +0.0872           288           313           288           313
CsvRead/column_selection/1/0/1/manual_time                      +0.1099         +0.1114           207           230           206           229
CsvRead/column_selection/2/0/1/manual_time                      +0.1147         +0.1146           209           233           209           233
CsvRead/column_selection/3/0/1/manual_time                      +0.1056         +0.1083           211           234           211           234
CsvRead/row_selection/0/1/1/manual_time                         +0.0894         +0.0894           287           312           287           312
CsvRead/row_selection/0/2/1/manual_time                         +0.0862         +0.0932           289           314           287           314
CsvRead/row_selection/0/3/1/manual_time                         +0.0914         +0.0868           287           313           287           312
CsvRead/row_selection/0/1/8/manual_time                         +0.1829         +0.1284           268           317           266           300
CsvRead/row_selection/0/2/8/manual_time                         +0.0735         +0.0691           621           666           620           663
CsvRead/row_selection/0/3/8/manual_time                         +0.0475         +0.0535           960          1006           952          1002
./_deps/benchmark-src/tools/compare.py benchmarks OLD/STRINGS_BENCH.json NEW/STRINGS_BENCH.json
StringsToNumeric/strings_to_float32/1024/manual_time                             +0.0613         +0.0381            26            27            45            46
StringsToNumeric/strings_to_float32/4096/manual_time                             +0.0576         +0.0370            26            27            45            46
StringsToNumeric/strings_to_float32/16384/manual_time                            +0.0464         +0.0283            28            29            46            48
StringsToNumeric/strings_to_float32/65536/manual_time                            +0.0634         +0.0442            30            32            48            51
StringsToNumeric/strings_to_float32/131072/manual_time                           +0.1007         +0.0672            34            38            53            56
StringsToNumeric/strings_to_float64/1024/manual_time                             +0.0561         +0.0326            26            27            45            46
StringsToNumeric/strings_to_float64/4096/manual_time                             +0.0464         +0.0278            27            28            46            47
StringsToNumeric/strings_to_float64/16384/manual_time                            +0.0543         +0.0335            28            29            46            48
StringsToNumeric/strings_to_float64/65536/manual_time                            +0.0564         +0.0353            30            32            49            51
StringsToNumeric/strings_to_float64/131072/manual_time                           +0.0957         +0.0610            35            38            54            57

Have you considered @vuule's comments above about decimal and thousands separators?

Yes. I updated stod to take care of user given decimal and thousands separators. All the unit tests passed before running benchmarks.

GregoryKimball commented 2 years ago

Thanks @karthikeyann for sharing this benchmark update. Looking into the integral and timestamp columns, are you using is_float + stod, and do you think the is_integer + string_to_integer_fn in convert_integers.cu could be better?

GregoryKimball commented 2 years ago

It seems weird that we would get a 30 ms slowdown in CsvRead when we are converting from StringsToNumeric in < 50 us per 100K elements. image

nvdbaranec commented 2 years ago

Semi-tangential, but the casting work I'm doing right now involves a stod() function that is much more parallel. Instead of one-thread-per-string, it's one-warp-per-string.

karthikeyann commented 2 years ago

@GregoryKimball integers are not affected by accuracy concerns. So, it does not need any change.

karthikeyann commented 2 years ago

Semi-tangential, but the casting work I'm doing right now involves a stod() function that is much more parallel. Instead of one-thread-per-string, it's one-warp-per-string.

Great idea. memory coalescing on string will impact speedup. This could be useful for convert_float (cudf.to_numeric), but not for cuio code (Could be possible with shared memory).

github-actions[bot] commented 2 years ago

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.