[TVM Discuss] [RFC] Introducing Hexagon backend

2019-07-02 Thread Krzysztof Parzyszek via TVM Discuss


The special runtimes are mostly for offloading to extra devices from host.  ARM 
and X86 are usually the hosts, so the runtime for them is fairly simple.  It's 
still there, look at cpu_device_api.cc for example.





---
[Visit Topic](https://discuss.tvm.ai/t/introducing-hexagon-backend/2421/18) to 
respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.ai/email/unsubscribe/1b8badc1432bf8cd41a1d0b9cc8085d18034dc6bfbf5eb7bd3d5247f2bfec4f0).

Tianqi Chen, UW, Seattle, WA, 98105, United States
http://tracking.discuss.tvm.ai/tracking/unsubscribe?msgid=P2IBsTi74G2tcY7pMUzQvQ2

Re: [dmlc/tvm] [RFC][EXPR] Formalize Integer Arithmetic Analysis (#2588)

2019-07-02 Thread Tianqi Chen
https://github.com/dmlc/tvm/pull/3368 finishes the migration of the analysis 
stack. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/2588#issuecomment-507753372

Re: [dmlc/tvm] [RFC][EXPR] Formalize Integer Arithmetic Analysis (#2588)

2019-07-02 Thread Tianqi Chen
Closed #2588.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/2588#event-2454985179

[dmlc/tvm] [RFC] Build and Evolve Internal Low-level IR (HalideIR) (#3474)

2019-07-02 Thread Tianqi Chen
Dear Community:

TVM makes use of HalideIR as our low-level IR structure, and it has served us 
well. One of the main gains we get is the integer simplification infrastructure 
provided by HalideIR. As the project moves forward, we start to introduce our 
own integer simplification infra to tackle new problems, and as of now, we 
start to use the new integer analysis infra in TVM. 

We also see increasing needs to evolve our own version of low-level IRs. Here 
is a brief summary of needs:

- Introducing new IR nodes to enhance the analysis required by TVM (Reduce, 
ConstraintHints)
- Different dialect and intrinsics support, mainly in the case of pragma, and 
region annotations, both of which will make the IR more coupled with the 
project.
- Examples include dma_copy regions, thread bindings, and bound hints.
 - Unification of the object protocol with the rest of the project, in 
particular, runtime::Object, Node, and NDArray.
- General refactoring concerns to reduce duplicated objects(Var, Range)
- Long term: unification of IR infra, in particular between low-level IR and 
high-level IRs(relay).

These technical needs will require us to evolve the IR more frequently, and it 
starts to make sense to build and evolve our own version of low-level IR.

Action Items
- [ ] Create include/tvm/node to introduce the node infra
- As we start to unify node with objects, we might consider moving certain 
things to runtime.
- [ ] Create include/tvm/ir folder to introduce IR structures, 
- The initial structure will directly reflect the structures in HalideIR 
and new additions like Reduce with clear acknowledgment to the original design 
(Halide).
- Start to evolve new IRs, refactoring and remove duplicated objects and 
further changes as mentioned above.
 
Please share your thoughts and suggestions about the proposal

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/3474

Re: [dmlc/tvm] [RFC][Codegen] Broadcast ops with symbolic shape (#3390)

2019-07-02 Thread Yizhi Liu
close by https://github.com/dmlc/tvm/pull/3389

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/3390#issuecomment-507793738

Re: [dmlc/tvm] [RFC][Codegen] Broadcast ops with symbolic shape (#3390)

2019-07-02 Thread Yizhi Liu
Closed #3390.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/3390#event-2455283439

[dmlc/tvm] [RFC][ARITH] Improving Context-Dependent DivMod Simplifications (#3478)

2019-07-02 Thread Tianqi Chen
Many parts of our code base relies on integer simplifications that involves 
div/mod. These simplifications are in particular tricky due to the different 
division mode, and the dependence on knowing the sign of the operand.

Here is a list of division variants:

## Trunc div/mod
IEEE standard integer division is truncated division, directly maps to the 
hardware. This is the division used by C and TVM by default. The problem of 
trunc div is that we usually relies on knowing the sign of both operands. For 
example, we cannot simplify ```(x * 4 + 3)/4 => x ``` if x can be negative.

## Floor div/mod
Always round down. This is the division mode adopted by python. To simplify 
floordiv, we usually need to know the sign of divisor, but not necessarily the 
sign of dividend  ```floordiv(x * 4 + 3,4) => x ```. 

## Euclidean div/mod
Always ensures that the remainder is non-negative. This is the division mode 
used by Halide by default. Note that when the divisor is positive, Euclidean 
and floordiv are equivalent. But floordiv will produce a negative remainder 
when the divisor is negative.

## Discussion

Different division mode has its own advantage and disadvantages. While Floor 
and Euclidean mode enjoys better invariance in simplification. We will have 
some trouble lowering them into the trunc div/mod, especially when we do not 
know the sign. In general, it is good to know the sign when lowering.  However, 
this will leads to some slight differences, consider the following case:

```c++
for (x = 0; x < 100; x++) {
   // trunc division
   a [(x * 5 + 3)/ 4] =  xyz.
}
```
```(x * 5 + 3)/4``` can be simplified to (x * 5 /4) , if we setup the 
simplifier, with currect context(```x in [0, 100]```). However, there can be 
cases where we forget to do so in our code, i that scenario the simplifcation 
cannot be done. If instead we use

```c++
for (x = 0; x < 100; x++) {
   // floor division
   a [floordiv(x * 5 + 3, 4)] =  xyz.
}
```

```(x * 5 + 3)/4``` can be simplified to floordiv(x * 5, 4) in the analysis. 
However, to get the most efficient version of the code. We need to lower the 
floor division to ```x * 5 / 4``` knowing that x is non-negative. The context 
information is only needed during the floor division lowering.

In summary, using trunc div during analysis requires m
ore information each time we transform it, using floor/euclidean div makes 
simplification easier, but still requires us to provide context information to 
most efficiently lowers to trunc div/mod.

## Proposal to be Discussed: Adding Floor Div/Mod

It might be helpful to encourage the use of floor div/mod for integer analysis 
while providing an effective way to lower to trunc div when necessary. To avoid 
confusion between division mode, I propose we add an explicit floordiv/floormod 
node and operator to the IR. 

The reason to choose floordiv/mod over Euclidean is mainly due to floor is more 
common(used by python) and easier to understand. The difference in behavior 
happens when the divisor is negative, and in most cases, we will know the sign 
of divisor.

The original truc div/mod simplification will be kept around for a while, but 
we will encourage most index calculations to use floordiv/mod, and provide 
rewriter to rewrite truc div/mod into floor version when the sign of the 
dividend is positive





 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/3478

Re: [dmlc/tvm] [RFC][ARITH] Improving Context-Dependent DivMod Simplifications (#3478)

2019-07-02 Thread Tianqi Chen
cc @dmlc/tvm-team 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/3478#issuecomment-507892218

Re: [dmlc/tvm] [DEV] TVM v0.6 Roadmap (#2623)

2019-07-02 Thread Yizhi Liu
# TVM Monthly - June 2019

https://discuss.tvm.ai/t/tvm-monthly-june-2019

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/2623#issuecomment-507917006

[TVM Discuss] [Development] [solved][Relay] Broken case of type infer

2019-07-02 Thread Wuwei Lin via TVM Discuss


solved in latest master





---
[Visit 
Topic](https://discuss.tvm.ai/t/solved-relay-broken-case-of-type-infer/3169/2) 
to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.ai/email/unsubscribe/a3f9cac923e2d47ecfc033511bb3a098a581149c5dcd5c783f341c7ad40ad00a).

Tianqi Chen, UW, Seattle, WA, 98105, United States
http://tracking.discuss.tvm.ai/tracking/unsubscribe?msgid=POy2p6tlX7yfz9M5vbwCdg2

Re: [dmlc/tvm] [RFC][ARITH] Introduce FloorDiv/Mod for Context-Independent Simplifications (#3478)

2019-07-02 Thread Jared Roesch
Can you clarify the example above? the simplifications seem invalid to me, how 
can you drop the addition by 3?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/3478#issuecomment-507935931

Re: [dmlc/tvm] [RFC][ARITH] Introduce FloorDiv/Mod for Context-Independent Simplifications (#3478)

2019-07-02 Thread Tianqi Chen
Sorry it should be ```(x * 4 + 3) / 4=>x```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/3478#issuecomment-507936537