refactor(debugging): improve error messages of generic functions with floating point inputs

This commit is contained in:
Umut
2021-11-16 11:55:31 +03:00
parent 76272373a4
commit db098fd3a3
2 changed files with 8 additions and 4 deletions

View File

@@ -71,6 +71,13 @@ def check_node_compatibility_with_mlir(
return "only integer constants are supported" # pragma: no cover
elif isinstance(node, intermediate.GenericFunction): # constraints for univariate functions
for inp in inputs:
if not value_is_integer(inp):
return (
f"{node.op_name} with floating-point inputs "
f"is required to be fused to be supported"
)
if node.op_kind == "TLU":
assert_true(
len(
@@ -90,9 +97,6 @@ def check_node_compatibility_with_mlir(
if node.op_name == "TLU": # pragma: no cover
return "only unsigned integer lookup tables are supported"
if node.op_name.startswith("astype"):
return f"{node.op_name} is not supported without fusing"
# e.g., `np.absolute is not supported for the time being`
return f"{node.op_name} is not supported for the time being"
else:

View File

@@ -1101,7 +1101,7 @@ function you are trying to compile isn't supported for MLIR lowering
%8 = mul(%7, %0) # EncryptedScalar<float64>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only integer multiplication is supported
%9 = astype(%8, dtype=int32) # EncryptedScalar<int5>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ astype is not supported without fusing
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ astype with floating-point inputs is required to be fused to be supported
return %9
""".strip() # noqa: E501