Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion backends/cadence/fusion_g3/operators/op_cat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions backends/cadence/fusion_g3/operators/op_slice_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -132,4 +133,4 @@ Tensor& slice_copy_Tensor_out(
} // namespace native
} // namespace G3
} // namespace impl
} // namespace cadence
} // namespace cadence
2 changes: 2 additions & 0 deletions backends/cadence/fusion_g3/operators/xt_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
11 changes: 10 additions & 1 deletion backends/cadence/utils/facto_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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(
[
Expand Down Expand Up @@ -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]
Loading