Git Product home page Git Product logo

Comments (2)

leslie-fang-intel avatar leslie-fang-intel commented on July 18, 2024
  • Eager will compare with BF16 data type in
    iter, [](scalar_t a, scalar_t b) -> bool { return a > b; });
    . For 0.2 and 0.2002, when round to nearest even will all get 0x3E4D in storage.
  • Inductor will convert to FP32 and compare with FP32 as attached Inductor CPP generated code:
cpp_fused_gt_0 = async_compile.cpp_pybinding(['const bfloat16*', 'bool*'], '''
#include "/tmp/torchinductor_leslie/sk/cskh5dx62fglpphcrl6723dnmowdabouerrzy3dmqcngbxwfa7bv.h"
extern "C" void kernel(const bfloat16* in_ptr0,
                       bool* out_ptr0)
{
    {
        #pragma omp simd simdlen(8) 
        for(long x0=static_cast<long>(0L); x0<static_cast<long>(4L); x0+=static_cast<long>(1L))
        {
            auto tmp0 = in_ptr0[static_cast<long>(x0)];
            auto tmp1 = c10::convert<float>(tmp0);
            auto tmp2 = static_cast<float>(0.2);
            auto tmp3 = tmp1 > tmp2;
            out_ptr0[static_cast<long>(x0)] = tmp3;
        }
    }
}
''')

from pytorch.

leslie-fang-intel avatar leslie-fang-intel commented on July 18, 2024

Taking this numerical difference as expected.

from pytorch.

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.