You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by Rahul Utkoor via TVM Discuss <no...@discuss.tvm.ai> on 2020/05/17 17:04:04 UTC

[TVM Discuss] [Questions] Handling mixed floating point datatypes


In the tvm frontend, operations which involves mixed datatypes(float16, float32, float64) as operands are not handled explicitly. I found a condition check which is missing in src/tir/ir.op.cc file for float case. After adding that check I ran TVM unit test suite and noticed that one of the example is failing. “ **verify_callop_float_only(f)** ” function from test_tir_ops.py is getting failed. Inside that function there is a check “ **if 'float' in lhs_dtype and 'float' in rhs_dtype and lhs_dtype != rhs_dtype** ” which allows variables with mixed datatypes execute. If this condition passes, the control goes to below code.

**def check_throws(f):**
**  try:**
**    f()**
**  except tvm.error.TVMError:**
**    pass**
**  else:**
**    raise AssertionError("Should have raised an exception but didn't.")**

Earlier, without my changes this piece of code is going into **except** condition and working properly, now, after adding my change the control is going into **else** condition and asserting error.

**Questions:**

1. Is it expected to not handle mixed float datatypes from tvm frontend?
2. If we allow mixed datatypes, then should I modify the example which is failing?





---
[Visit Topic](https://discuss.tvm.ai/t/handling-mixed-floating-point-datatypes/6702/1) 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/b12207d47e35f7afabd9577c0c43b28aea1d09461c983d525ec30ccb969a2749).