tvm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-tvm] yongfeng-nv commented on issue #5367: Improve IntervalSet's floormod
Date Wed, 22 Apr 2020 15:47:41 GMT

yongfeng-nv commented on issue #5367:
URL: https://github.com/apache/incubator-tvm/pull/5367#issuecomment-617861746


   > > It would be great if we can dissect it down to specific cases in mind and discuss
how to solve these cases, I see two kinds of problems:
   > > 
   > > * (1) EvalSet need to be aware of the bound of Vars
   > >   
   > >   * Ideally these bounds should be populated in the analyzer via bind.
   > > * (2) `floormod([13, 15], 10) => [3, 5]` : This seems to be a clean case that
we can fix first(independent from the Var bound problem), how about we create a separate PR
for the var bound case and aim at fixing this one?
   > >   
   > >   * For `floormod([a, b], c)`:  check if we can prove `floordiv(a, c) == floordiv(b,
c)`, if so, we rewrite to `[a - floordiv(a, c) * c, b -  floordiv(b, c) * c]`, otherwise,
follow the old rule.
   > >   * Same rule can be applied to ConstIntBound
   > 
   > This is also how I categorized the issues. I can certainly make the second part a
separated PR.
   
   While implementing a separate PR, I got a test failure: floormod([z*8+x*4, z*8+x*4+3],
8)
   
   The suggested logic falls back to [0, 7], because it can't prove floordiv(x*4, 8) == floordiv(x*4+3,
8). 
    The current implementation is better, returning [(x*4-floordiv(x, 2)*8, x*4+3-floordiv(x*4+3,
8)*8)].
   
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message