tvm-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Haichen Shen <notificati...@github.com>
Subject Re: [dmlc/tvm] [RFC] Register Relay VM design (#2915)
Date Wed, 10 Apr 2019 20:02:01 GMT
I propose two changes to instructions.
- `AllocTensor` uses shape stored in the register instead of hardcode shape in the instruction.
This can help support dynamic shape in VM in the future. We can store constant shapes in the
constant lists, and use `LoadConst` to load them.
- Change `Phi` to `Select` (defined below) that takes a condition register to select two values.
This allows us to map SSA register number to fewer slots to reduce memory footage.

### AllocTensor
```
AllocTenosr $2, $1, dtype  ; %2 = AllocTensor(%1, dtype)
```
Allocate a tensor object with shape stored in register $1 and save to register $2.

### Phi
```
Select $4, $1, $2, $3  ; %4 = (%1) ? %2 : %3
```
Select VMObject either in $2 or $3 based on condition register $1, and store in $4.

cc @tqchen @jroesch @wweic @zhiics @yongwww

-- 
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/2915#issuecomment-481840770
Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message