GithubHelp home page GithubHelp logo

Comments (4)

t-vi avatar t-vi commented on July 28, 2024

Trying to produce a minimal example, I got:

RuntimeError: IValue is not a Scalar
The above operation failed in interpreter, with the following stack trace:
at <ipython-input-15-e6d508d37f4e>:3:12
@torch.jit.script
def func(x)->torch.Tensor:
    return x+torch.tanh(x+x)
           ~~~~~~~~~~~~~~~~ <--- HERE

from tvm.

t-vi avatar t-vi commented on July 28, 2024

So the first error seems related to prim::Constant being declared fusible.

As far as I understand, prim::Constant nodes are not usually declared fusible but instead are pulled in (but duplicated) when they are arguments to a fused node. This happens in GraphFuser::mergeNodeIntoGroup:

https://github.com/pytorch/pytorch/blob/2132ea1d8d6ca9cb2ab6c2206c7cdc9203e1908f/torch/csrc/jit/passes/graph_fuser.cpp#L359-L365

from tvm.

ulyssesxxxi avatar ulyssesxxxi commented on July 28, 2024

Hi @t-vi,
I'm experiencing the same issue, while trying to compile a model from maskrcnn-benchmark. Do you know if there is any workaround until the issue is fixed?
Thx.

from tvm.

t-vi avatar t-vi commented on July 28, 2024

Yes, sorry, I have been meaning to send a PR, but you simply need to remove prim::Constant fusion:

if (node->kind() == prim::Constant) {

I see, however, that #72 is moving away from the CustomGraphFuser (which ironically seems to be doing funny const handling, too, when the current approach makes fixing this simple).

from tvm.

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.