@yrchen ,

Few hints from my personal perspective and some experience on the topic:

To add "P" extension to TVM by **avoiding custom runtime** and/or touching 
**upstream LLVM**:

   * add to TVM TOPI catalog [5] **tensorized versions** for the common ops: 
dense  ex: [1] & conv2d
   * tensorization can invoke via C/LLVM machine call to **__asm__(.word 
0xcustomXX)** see ex. [2] & [3] (thus no special LLVM required emitting the "P")
   * invoke in TVM classic **llvm -mcpu=rv32 --mtriple=riscv32-unknown-elf 
-device=riscv-p** but with device target (thus no special runtime might be 
required)
   * discriminate invocation using **-device=riscv-p** as new variation in TVM 
for the new [4] & [5] catalog

[1] 
https://github.com/cbalint13/OLIMP/blob/main/srcs/sims/olimp-vec-gemm.py#L290

[2] 
https://github.com/cbalint13/OLIMP/blob/main/demo/icebreaker/src/firmware.c#L342

[3] 
https://github.com/cbalint13/OLIMP/blob/main/demo/icebreaker/src/rv32-custom.h

[4] https://github.com/apache/tvm/tree/main/python/tvm/relay/op/strategy

[5] https://github.com/apache/tvm/tree/main/python/tvm/topi

The mentioned steps are implemented already (not public yet), hope to release 
them gradually as they are polished.





---
[Visit 
Topic](https://discuss.tvm.apache.org/t/rfc-enable-tvm-qnn-on-risc-v-with-subword-simd-computation/7967/10)
 to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click 
here](https://discuss.tvm.apache.org/email/unsubscribe/8d18575a1f2d6766be15e30d4cf3d08e1509ffb213cb38e8feb35593445219a5).

Reply via email to