Skip to content

Commit fe3e460

Browse files
zonglinpengfacebook-github-bot
authored andcommitted
add size and rank of nightly facto
Summary: x2 scale number of testcases Differential Revision: D68690963
1 parent e78ed83 commit fe3e460

File tree

1 file changed

+11
-28
lines changed

1 file changed

+11
-28
lines changed

examples/cadence/operators/facto_util.py

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,56 +20,39 @@ def apply_tensor_contraints(op_name: str, tensor_constraints: list[object]) -> N
2020
match op_name:
2121
case (
2222
"sigmoid.default"
23-
| "_softmax.default"
2423
| "rsqrt.default"
25-
| "exp.default"
26-
| "mul.Tensor"
27-
| "div.Tensor"
2824
):
2925
tensor_constraints.extend(
3026
[
3127
cp.Dtype.In(lambda deps: [torch.float]),
32-
cp.Size.Le(lambda deps, r, d: 2),
33-
cp.Rank.Le(lambda deps: 2),
28+
cp.Rank.Le(lambda deps: 2**3),
3429
]
3530
)
3631
case (
37-
"add.Tensor"
38-
| "sub.Tensor"
39-
| "add.Scalar"
40-
| "sub.Scalar"
41-
| "mul.Scalar"
42-
| "div.Scalar"
32+
"exp.default"
4333
):
4434
tensor_constraints.extend(
4535
[
46-
cp.Dtype.In(lambda deps: [torch.float, torch.int32]),
47-
cp.Size.Le(lambda deps, r, d: 2),
48-
cp.Rank.Le(lambda deps: 2),
49-
]
50-
)
51-
case "native_layer_norm.default":
52-
tensor_constraints.extend(
53-
[
54-
cp.Dtype.In(lambda deps: [torch.float, torch.int32]),
55-
cp.Size.Le(lambda deps, r, d: 2**4),
56-
cp.Rank.Le(lambda deps: 2**4),
36+
cp.Rank.Le(lambda deps: 2**3),
37+
cp.Value.Ge(lambda deps, dtype, struct: -1),
38+
cp.Value.Le(lambda deps, dtype, struct: 1),
5739
]
5840
)
5941
case _:
6042
tensor_constraints.extend(
6143
[
62-
cp.Dtype.In(lambda deps: [torch.float, torch.int32]),
63-
cp.Size.Le(lambda deps, r, d: 2),
64-
cp.Rank.Le(lambda deps: 2),
44+
cp.Rank.Le(lambda deps: 2**2),
6545
]
6646
)
6747
tensor_constraints.extend(
6848
[
69-
cp.Value.Ge(lambda deps, dtype, struct: -(2**8)),
70-
cp.Value.Le(lambda deps, dtype, struct: 2**8),
49+
cp.Dtype.In(lambda deps: [torch.int, torch.float]),
50+
cp.Dtype.NotIn(lambda deps: [torch.int64, torch.float64]),
51+
cp.Value.Ge(lambda deps, dtype, struct: -(2**4)),
52+
cp.Value.Le(lambda deps, dtype, struct: 2**4),
7153
cp.Rank.Ge(lambda deps: 1),
7254
cp.Size.Ge(lambda deps, r, d: 1),
55+
cp.Size.Le(lambda deps, r, d: 2**9),
7356
]
7457
)
7558

0 commit comments

Comments
 (0)