Skip to content

Commit 3b77a76

Browse files
committed
remove 'precision' in tests
1 parent e2bdf9c commit 3b77a76

12 files changed

Lines changed: 11 additions & 35 deletions

tests/py/dynamo/automatic_plugin/test_flashinfer_rmsnorm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def forward(self, input, weight):
5959
torch.randn(weight_shape, device="cuda", dtype=data_type),
6060
]
6161

62-
self.run_test(rmsnorm(), inputs, precision=dtype.f16)
62+
self.run_test(rmsnorm(), inputs)
6363

6464

6565
if __name__ == "__main__":

tests/py/dynamo/conversion/harness.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def run_test_with_error(self, mod, inputs, interpreter, expect_error):
272272
cuda_inputs.append(i.cuda())
273273

274274
mod.eval()
275-
interpreter.run(precision=torch.float)
275+
interpreter.run()
276276

277277
def assert_has_op(self, mod, ops):
278278
ops_in_mod = set()

tests/py/dynamo/conversion/test_attention.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ def forward(self, query, key, value):
2727
inputs,
2828
rtol=1e-2,
2929
atol=1e-2,
30-
precision=torch.float16,
3130
enable_passes=True,
3231
decompose_attention=True,
3332
)
@@ -63,7 +62,6 @@ def forward(self, query, key, value):
6362
inputs,
6463
rtol=1e-2,
6564
atol=1e-2,
66-
precision=torch.float16,
6765
enable_passes=True,
6866
decompose_attention=True,
6967
)
@@ -96,7 +94,6 @@ def forward(self, query, key, value):
9694
inputs,
9795
rtol=1e-2,
9896
atol=1e-2,
99-
precision=torch.float16,
10097
enable_passes=True,
10198
decompose_attention=True,
10299
)

tests/py/dynamo/conversion/test_attention_aten.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ def forward(self, query, key, value, attn_mask=None):
139139
inputs,
140140
rtol=1e-2,
141141
atol=1e-2,
142-
precision=dtype,
143142
enable_passes=True,
144143
)
145144

@@ -274,7 +273,6 @@ def forward(self, query, key, value, attn_mask=None):
274273
inputs,
275274
rtol=1e-2,
276275
atol=1e-2,
277-
precision=dtype,
278276
enable_passes=True,
279277
)
280278

@@ -513,7 +511,6 @@ def forward(self, query, key, value, attn_bias=None):
513511
inputs,
514512
rtol=1e-2,
515513
atol=1e-2,
516-
precision=dtype,
517514
enable_passes=True,
518515
)
519516

@@ -630,7 +627,6 @@ def forward(self, query, key, value, attn_bias=None):
630627
inputs,
631628
rtol=1e-2,
632629
atol=1e-2,
633-
precision=dtype,
634630
enable_passes=True,
635631
)
636632

tests/py/dynamo/conversion/test_casts.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ def forward(self, x):
4747
y = torch.ops.aten._to_copy.default(x, dtype=torch.half)
4848
return y
4949

50-
inputs = [torch.rand((1, 3, 10))]
50+
inputs = [torch.rand((1, 3, 10), dtype=torch.half)]
5151
self.run_test(
5252
ToCopyHalf(),
5353
inputs,
54-
precision=torch.half,
5554
)
5655

5756
def test_to_copy_float(self):
@@ -60,11 +59,10 @@ def forward(self, x):
6059
y = torch.ops.aten._to_copy.default(x, dtype=torch.float)
6160
return y
6261

63-
inputs = [torch.rand((1, 3, 10)).half()]
62+
inputs = [torch.rand((1, 3, 10), dtype=torch.float)]
6463
self.run_test(
6564
ToCopyFloat(),
6665
inputs,
67-
precision=torch.float,
6866
)
6967

7068
def test_to_copy_bfloat16(self):
@@ -74,11 +72,10 @@ def forward(self, x):
7472
y = y**2
7573
return y
7674

77-
inputs = [torch.rand((1, 3, 10), dtype=torch.float32)]
75+
inputs = [torch.rand((1, 3, 10), dtype=torch.bfloat16)]
7876
self.run_test(
7977
ToCopyBFloat16(),
8078
inputs,
81-
precision=torch.float,
8279
)
8380

8481
def test_to_copy_i64b(self):
@@ -102,11 +99,10 @@ def forward(self, x):
10299
z = torch.ops.aten._to_copy.default(x_1, dtype=torch.float)
103100
return y, z
104101

105-
inputs = [torch.rand((1, 3, 10))]
102+
inputs = [torch.rand((1, 3, 10), dtype=torch.float)]
106103
self.run_test(
107104
ToCopyReturns(),
108105
inputs,
109-
precision=torch.float,
110106
)
111107

112108

tests/py/dynamo/conversion/test_embedding_bag_aten.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ def forward(self, weight, indices):
146146
self.run_test(
147147
TestEmbeddingBag(),
148148
inputs=[weight, indices],
149-
precision=weight.dtype,
150149
enable_passes=True,
151150
propagate_shapes=True,
152151
immutable_weights=True,
@@ -345,7 +344,6 @@ def forward(self, weight, indices, offsets):
345344
self.run_test(
346345
TestEmbeddingBag(),
347346
inputs=[weight, indices, offsets],
348-
precision=weight.dtype,
349347
enable_passes=True,
350348
propagate_shapes=True,
351349
immutable_weights=True,
@@ -410,7 +408,6 @@ def forward(self, weight, indices, offsets):
410408
self.run_test(
411409
TestEmbeddingBag(),
412410
inputs=[weight, indices, offsets],
413-
precision=weight.dtype,
414411
enable_passes=True,
415412
propagate_shapes=True,
416413
immutable_weights=True,

tests/py/dynamo/conversion/test_erf_aten.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def forward(self, input):
2222
return torch.ops.aten.erf.default(input)
2323

2424
inputs = [torch.randn(x, dtype=type)]
25-
self.run_test(erf(), inputs, precision=type)
25+
self.run_test(erf(), inputs)
2626

2727
@parameterized.expand(
2828
[

tests/py/dynamo/conversion/test_group_norm_aten.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def forward(self, x, weight, bias):
4242
self.run_test(
4343
GroupNorm(),
4444
inputs,
45-
precision=torch.half,
4645
use_dynamo_tracer=True,
4746
enable_passes=True,
4847
)

tests/py/dynamo/conversion/test_hard_sigmoid_aten.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ class TestModule(nn.Module):
5151
def forward(self, x):
5252
return torch.ops.aten.hardsigmoid.default(x)
5353

54-
inputs = [torch.randn(1, 10)]
54+
inputs = [torch.randn(1, 10, dtype=torch.float16)]
5555
self.run_test(
5656
TestModule(),
5757
inputs,
58-
precision=torch.half,
5958
check_dtype=False,
6059
)
6160

tests/py/dynamo/conversion/test_neg_aten.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class neg(nn.Module):
2121
def forward(self, input):
2222
return torch.ops.aten.neg.default(input)
2323

24-
inputs = [torch.randn(x, dtype=type)]
25-
self.run_test(neg(), inputs, precision=type)
24+
inputs = [torch.randn(x, dtype=type).cuda()]
25+
self.run_test(neg(), inputs)
2626

2727
@parameterized.expand(
2828
[

0 commit comments

Comments
 (0)