Skip to content

Commit 3752c12

Browse files
author
Awni Hannun
committed
format
1 parent 247fd93 commit 3752c12

64 files changed

Lines changed: 69 additions & 133 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

benchmarks/python/batch_matmul_bench.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
import argparse
44

5-
from time_utils import time_fn
6-
75
import mlx.core as mx
6+
from time_utils import time_fn
87

98
B = 8
109
T = 1024

benchmarks/python/blas/bench_gemm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
import subprocess
77
import time
88

9+
import mlx.core as mx
910
import numpy as np
1011
import torch
1112

12-
import mlx.core as mx
13-
1413
device_name = subprocess.check_output(["sysctl", "-n", "machdep.cpu.brand_string"])
1514
device_name = device_name.decode("utf-8").strip("\n")
1615

benchmarks/python/blas/bench_gemv.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
import time
77

88
import matplotlib.pyplot as plt
9+
import mlx.core as mx
910
import numpy as np
1011
import torch
1112

12-
import mlx.core as mx
13-
1413
results_dir = "./results"
1514

1615
if not os.path.isdir(results_dir):

benchmarks/python/compile_bench.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
import math
55
import random
66

7-
from time_utils import time_fn
8-
97
import mlx.core as mx
8+
from time_utils import time_fn
109

1110

1211
def bench_gelu():

benchmarks/python/conv1d_bench.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
import subprocess
55
import time
66

7+
import mlx.core as mx
78
import numpy as np
89
import torch
910

10-
import mlx.core as mx
11-
1211
device_name = subprocess.check_output(["sysctl", "-n", "machdep.cpu.brand_string"])
1312
device_name = device_name.decode("utf-8").strip("\n")
1413

benchmarks/python/conv2d_bench_cpu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
import math
33
import time
44

5+
import mlx.core as mx
56
import numpy as np
67
import torch
78

8-
import mlx.core as mx
9-
109
N_warmup = 1
1110
N_iter_bench = 10
1211
N_iter_func = 5

benchmarks/python/conv2d_train_bench_cpu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import time
22

3-
import torch
4-
53
import mlx.core as mx
64
import mlx.nn
75
import mlx.optimizers as opt
6+
import torch
87

98

109
def bench_mlx(steps: int = 20) -> float:

benchmarks/python/conv2d_transpose_bench_cpu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
import math
33
import time
44

5+
import mlx.core as mx
56
import numpy as np
67
import torch
78

8-
import mlx.core as mx
9-
109
N_warmup = 1
1110
N_iter_bench = 10
1211
N_iter_func = 5

benchmarks/python/conv3d_bench_cpu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
import math
33
import time
44

5+
import mlx.core as mx
56
import numpy as np
67
import torch
78

8-
import mlx.core as mx
9-
109
N_warmup = 1
1110
N_iter_bench = 10
1211
N_iter_func = 5

benchmarks/python/conv3d_train_bench_cpu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import time
22

3-
import torch
4-
53
import mlx.core as mx
64
import mlx.nn
75
import mlx.optimizers as opt
6+
import torch
87

98

109
def bench_mlx(steps: int = 20, shape=(10, 32, 32, 32, 3)) -> float:

0 commit comments

Comments
 (0)