diff --git a/backends/cadence/fusion_g3/operators/op_cat.cpp b/backends/cadence/fusion_g3/operators/op_cat.cpp index 84224b37b04..7f8e1ee8710 100644 --- a/backends/cadence/fusion_g3/operators/op_cat.cpp +++ b/backends/cadence/fusion_g3/operators/op_cat.cpp @@ -115,7 +115,8 @@ Tensor& cat_out( (out.scalar_type() == ScalarType::Char) || (out.scalar_type() == ScalarType::UInt32) || (out.scalar_type() == ScalarType::UInt16) || - (out.scalar_type() == ScalarType::Byte)) { + (out.scalar_type() == ScalarType::Byte) || + (out.scalar_type() == ScalarType::Float)) { XT_KERNEL_CHECK( ctx, out, diff --git a/backends/cadence/fusion_g3/operators/op_slice_copy.cpp b/backends/cadence/fusion_g3/operators/op_slice_copy.cpp index 9158eecf133..249da9144a9 100644 --- a/backends/cadence/fusion_g3/operators/op_slice_copy.cpp +++ b/backends/cadence/fusion_g3/operators/op_slice_copy.cpp @@ -101,7 +101,8 @@ Tensor& slice_copy_Tensor_out( (out.scalar_type() == ScalarType::Char) || (out.scalar_type() == ScalarType::UInt32) || (out.scalar_type() == ScalarType::UInt16) || - (out.scalar_type() == ScalarType::Byte))) { + (out.scalar_type() == ScalarType::Byte) || + (out.scalar_type() == ScalarType::Float))) { XT_KERNEL_CHECK( ctx, out, @@ -132,4 +133,4 @@ Tensor& slice_copy_Tensor_out( } // namespace native } // namespace G3 } // namespace impl -} // namespace cadence \ No newline at end of file +} // namespace cadence diff --git a/backends/cadence/fusion_g3/operators/xt_utils.h b/backends/cadence/fusion_g3/operators/xt_utils.h index 443d68d0609..14b9b6f4981 100644 --- a/backends/cadence/fusion_g3/operators/xt_utils.h +++ b/backends/cadence/fusion_g3/operators/xt_utils.h @@ -19,6 +19,8 @@ inline int get_element_size(ScalarType dtype) { return sizeof(short); } else if ((dtype == ScalarType::Char) || (dtype == ScalarType::Byte)) { return sizeof(char); + } else if (dtype == ScalarType::Float) { + return sizeof(float); } return 0; } diff --git a/backends/cadence/utils/facto_util.py b/backends/cadence/utils/facto_util.py index 2fa0787a08e..74f846aa706 100644 --- a/backends/cadence/utils/facto_util.py +++ b/backends/cadence/utils/facto_util.py @@ -18,6 +18,7 @@ # seed to generate identical cases every run to reproduce from bisect random_manager.seed(1729) +MAX_CASES = 50 def apply_tensor_contraints(op_name: str, tensor_constraints: list[object]) -> None: @@ -46,6 +47,14 @@ def apply_tensor_contraints(op_name: str, tensor_constraints: list[object]) -> N cp.Value.Le(lambda deps, dtype, struct: 2**2), ] ) + case "slice_copy.Tensor": + tensor_constraints.extend( + [ + cp.Rank.Le(lambda deps: 2), + cp.Value.Ge(lambda deps, dtype, struct: 1), + cp.Value.Le(lambda deps, dtype, struct: 2), + ] + ) case _: tensor_constraints.extend( [ @@ -124,4 +133,4 @@ def facto_testcase_gen(op_name: str) -> List[Tuple[List[str], OrderedDict[str, s return [ (posargs, inkwargs) for posargs, inkwargs, _ in ArgumentTupleGenerator(spec).gen() - ] + ][:MAX_CASES]