Skip to content

Commit 373d609

Browse files
factnnclaude
andcommitted
fix: sort feature_dropout correctly in __init__.py and simplify benchmark
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 056be17 commit 373d609

2 files changed

Lines changed: 4 additions & 21 deletions

File tree

benchmark/test_feature_dropout_perf.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,17 @@
22
import torch
33

44
from benchmark.attri_util import FLOAT_DTYPES
5-
from benchmark.performance_utils import GenericBenchmarkExcluse1D
5+
from benchmark.performance_utils import GenericBenchmark2DOnly
66

77

88
def feature_dropout_input_fn(shape, dtype, device):
99
inp = torch.randn(shape, dtype=dtype, device=device)
1010
yield inp, 0.5, True
1111

1212

13-
class FeatureDropoutBenchmark(GenericBenchmarkExcluse1D):
14-
def set_shapes(self, shape_file_path=None):
15-
self.shapes = [
16-
(8, 64),
17-
(16, 128),
18-
(32, 256),
19-
(4, 64, 32, 32),
20-
(8, 128, 16, 16),
21-
(16, 256, 8, 8),
22-
(2, 512, 14, 14),
23-
(4, 1024, 7, 7),
24-
]
25-
26-
def set_more_shapes(self):
27-
return None
28-
29-
3013
@pytest.mark.feature_dropout
3114
def test_perf_feature_dropout():
32-
bench = FeatureDropoutBenchmark(
15+
bench = GenericBenchmark2DOnly(
3316
input_fn=feature_dropout_input_fn,
3417
op_name="feature_dropout",
3518
torch_op=torch.feature_dropout,

src/flag_gems/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ def torch_ge(v):
199199
("expm1_", expm1_),
200200
("expm1.out", expm1_out),
201201
("exponential_", exponential_),
202-
("feature_dropout", feature_dropout),
203-
("feature_dropout_", feature_dropout_),
204202
("eye", eye),
205203
("eye.m", eye_m),
204+
("feature_dropout", feature_dropout),
205+
("feature_dropout_", feature_dropout_),
206206
("fill.Scalar", fill_scalar),
207207
("fill.Scalar_out", fill_scalar_out),
208208
("fill.Tensor", fill_tensor),

0 commit comments

Comments
 (0)