Git Product home page Git Product logo

Comments (2)

jbschlosser avatar jbschlosser commented on August 19, 2024

Issue 2 makes me sad. AFAICT the symbol is not being simplified out because it's part of guard expressions:

  • Eq(s5*s6*s7, 60) from the view decomp. Solving for s7 gives Eq(s7, 60/(s5*s6)), and then the logic attempts to replace s7 with 60/(s5*s6), but the latter doesn't have is_integer=True, so this branch is skipped:
    if r is not None and all(t.is_integer for t in sympy.preorder_traversal(r[1])):
    new_var = self._find(r[1])
    ok = len(free_unbacked_symbols(new_var)) == 0
    if ok:
    self._set_replacement(cast(sympy.Symbol, free[0]), new_var, "solve")
  • Eq(s7, (15//s6)) doesn't allow for symbol replacement either; it throws here:
    if len(floor_div_atoms) > 0 and any(a.divisor != 1 for a in floor_div_atoms):
    raise NotImplementedError

TL;DR: can't do symbol replacement for any of the guards so the ephemeral symbol created during view replay can't be simplified out

from pytorch.

ezyang avatar ezyang commented on August 19, 2024

Here we know that s5, s6 and s7 divide 60 evenly. Thus, the replacement should be allowed. I would probably try a fix along those lines.

However, I've generally found it is better to express things in terms of s5s6s7, instead of trying to replace s7 with 60/(s5*s6), so it would be good to understand why the replacement is preferred as well.

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.