[TVM Discuss] [Development/RFC] [RFC] Add bfloat16 data type

2020-05-24 Thread Menooker via TVM Discuss
Updated design details # Details on legalization Since most of the HW has no native support for computation on bf16, we added a pass `BF16Legalization` to use fp32 computing bf16 data. It has 3 sub-passes: `Promotion`, `Elimilination` and `Lowering`. ## BF16Promotion It adds `cast_to_fp32()

[TVM Discuss] [Development/RFC] [RFC] Add bfloat16 data type

2020-05-23 Thread Menooker via TVM Discuss
ok, working on it to implement a new legalization pass --- [Visit Topic](https://discuss.tvm.ai/t/rfc-add-bfloat16-data-type/6778/4) to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsub

[TVM Discuss] [Development/RFC] [RFC] Add bfloat16 data type

2020-05-22 Thread Menooker via TVM Discuss
@tqchen As you have proposed to eliminate "bfloat16" dtype after the legalization pass, I have two concerns. * The legalization pass will be more compilicated. It has to check every TIR node to replace the bf16 dtype * As the casting between bf16 and fp32 will be lowered as function calls as

[TVM Discuss] [Development/RFC] Add bfloat16 data type

2020-05-22 Thread Menooker via TVM Discuss
Hi all, We have completed a workable draft of bfloat16 (bf16) in TVM and the bf16 related codegen in LLVM. We add bfloat16 as a new type named "bf16" in the frontend. Completed LLVM backend for generating bf16. * Use int16 as the storage type in LLVM * Add legalization to enable computation