Giter VIP home page Giter VIP logo

Comments (5)

pmattione-nvidia avatar pmattione-nvidia commented on July 23, 2024

what if we do fixed-point -> float, and we exceed e.g. DBL_MAX. Do we want null here too, or return a double with value infinity?

from cudf.

davidwendt avatar davidwendt commented on July 23, 2024

Creating nulls for overflow is not something we do in general for other operations (e.g. casting float to integer). Usually nulls identify unvalid input rows and are not used to communicate any operation exceptions in this way. Just wanted to point this out. Perhaps an exception is needed for fixed-point.

from cudf.

ttnghia avatar ttnghia commented on July 23, 2024

I agree with that. Yes, nullifying the output rows may not be a generic solution to fix all cases. A more comprehensive solution is probably to return a boolean value after nullifying the output rows indicating whether such replacements have happened.

FYI, in Spark, we either choose to nullify the output rows or throw an exception depending on what the user wants (through a config value).

from cudf.

pmattione-nvidia avatar pmattione-nvidia commented on July 23, 2024

When we say exception here, do we mean throw a normal C++ exception? Can we do that from kernel code? Do we even want to?

For float -> fixed-point, the conversion could return a std::optional, which is std::nullopt_t if the value overflowed. Upstream code (e.g. the kernel) can then decide what to do with this (Null or exception).

from cudf.

ttnghia avatar ttnghia commented on July 23, 2024

What I do in such cases is nullify the output row, and also set a boolean flag (which will be returned) indicating that such overflow occurred during conversion.

from cudf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.