From 770cf3d915f68c0ce9f1acbd45198624ee9304c0 Mon Sep 17 00:00:00 2001 From: Zonglin Peng Date: Fri, 31 Oct 2025 11:11:53 -0700 Subject: [PATCH] [Jarvis][Nightly] address error in jarvis-nightly-operators-test-aten-leaky-relu-out https://docs.google.com/spreadsheets/d/12DsKcvPcGgxnZ8shgn6j8PmoOQUfy5GgUg974g1iO18/edit?gid=0#gid=0 Differential Revision: [D85364558](https://our.internmc.facebook.com/intern/diff/D85364558/) [ghstack-poisoned] --- backends/cadence/utils/facto_util.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backends/cadence/utils/facto_util.py b/backends/cadence/utils/facto_util.py index 518018c6d98..e8d48007516 100644 --- a/backends/cadence/utils/facto_util.py +++ b/backends/cadence/utils/facto_util.py @@ -390,6 +390,12 @@ def random_size_constraint(deps: object, r: int, d: int) -> int: cp.Value.Le(lambda deps, dtype, struct: 2**2), cp.Size.Le(lambda deps, r, d: 2**3), ] + case "leaky_relu.default": + tensor_constraints.extend( + [ + cp.Dtype.In(lambda deps: [torch.float32]), + ] + ) case "_softmax.default": tensor_constraints.extend( [ @@ -442,6 +448,14 @@ def facto_testcase_gen( # noqa: C901 spec.inspec[index].constraints.extend( [cp.Value.Ge(lambda deps, _: deps[1])] ) + elif in_spec.name == "negative_slope" and op_name == "leaky_relu.default": + # For leaky_relu, negative_slope should be in typical range (0, 1] + spec.inspec[index].constraints.extend( + [ + cp.Value.Gt(lambda deps, dtype: 0), + cp.Value.Le(lambda deps, dtype: 1.0), + ] + ) else: spec.inspec[index].constraints.extend( [