Git Product home page Git Product logo

Comments (6)

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

Hi @hgreving2304, thanks for reporting the issue. Will take a look.

from pytorch.

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

Test with the latest PyTorch: 705346b, the result is correct as cpu is tensor([[[-1]]]). @hgreving2304 could you take a try of it?

from pytorch.

hgreving2304 avatar hgreving2304 commented on July 3, 2024

I don't have access right now to the latest version, I can try it out later at home. In the meantime, you could also check whether the emitted C-code correctly shifts a signed vs. an unsigned number in the latest version and whether there was an explicit fix.

from pytorch.

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

Here are the generated code, randint64_cpu returns type of int64 and we use it to do the bit shift.

cpp_fused_bitwise_right_shift_0 = async_compile.cpp_pybinding(['int64_t*'], '''
#include "/tmp/torchinductor_leslie/sk/cskh5dx62fglpphcrl6723dnmowdabouerrzy3dmqcngbxwfa7bv.h"
extern "C" void kernel(int64_t* in_out_ptr0)
{
    {
        auto tmp0 = in_out_ptr0[static_cast<long>(0L)];
        auto tmp1 = static_cast<int32_t>(0);
        auto tmp2 = static_cast<int64_t>(-1);
        auto tmp3 = static_cast<int64_t>(0);
        auto tmp4 = randint64_cpu(tmp0, tmp1, tmp2, tmp3);
        auto tmp5 = static_cast<int64_t>(31);
        auto tmp6 = decltype(tmp4)(tmp4 >> tmp5);
        in_out_ptr0[static_cast<long>(0L)] = tmp6;
    }
}
''')

from pytorch.

hgreving2304 avatar hgreving2304 commented on July 3, 2024

Just tried, with the latest version from Ubuntu I am getting a signed shift, fwiw that's fine. I recommend verifying that there was an explicit fix, thanks..

from pytorch.

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

Hi @hgreving2304, I am going to close this ticket since the UT has added in PyTorch Main. Feel free to reopen if any further discussion.

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.