We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
torch.rand
torch.randn
1 parent f3a8db1 commit a9cefabCopy full SHA for a9cefab
2 files changed
add.py
@@ -11,8 +11,8 @@
11
dtype = torch.float16
12
device = "cuda"
13
14
- input = torch.rand(size, dtype=dtype, device=device)
15
- other = torch.rand(size, dtype=dtype, device=device)
+ input = torch.randn(size, dtype=dtype, device=device)
+ other = torch.randn(size, dtype=dtype, device=device)
16
17
ninetoothed_output = ops.ninetoothed.torch.add(input, other)
18
torch_output = input + other
swiglu.py
@@ -20,9 +20,9 @@ def torch_swiglu(
20
21
22
23
- a = torch.rand(shape, dtype=dtype, device=device)
24
- b = torch.rand(shape, dtype=dtype, device=device)
25
- c = torch.rand(shape, dtype=dtype, device=device)
+ a = torch.randn(shape, dtype=dtype, device=device)
+ b = torch.randn(shape, dtype=dtype, device=device)
+ c = torch.randn(shape, dtype=dtype, device=device)
26
27
ninetoothed_output = ops.ninetoothed.torch.swiglu(a, b)
28
torch_output = torch_swiglu(a, b)
@@ -58,8 +58,8 @@ def torch_swiglu(
58
def benchmark(m, n, provider):
59
shape = (m, n)
60
61
62
63
64
if provider == "ninetoothed":
65
ms = triton.testing.do_bench(lambda: ops.ninetoothed.torch.swiglu(a, b))
0 commit comments