Skip to content

Commit 4db478f

Browse files
committed
Restore timing accuracy
1 parent 02d8d1a commit 4db478f

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

docs/source/04-benchmark.ipynb

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 2,
5+
"execution_count": 1,
66
"metadata": {},
77
"outputs": [],
88
"source": [
@@ -16,10 +16,7 @@
1616
"from gfloat.formats import format_info_ocp_e5m2\n",
1717
"from timeit import Timer\n",
1818
"\n",
19-
"jax.config.update(\"jax_enable_x64\", True)\n",
20-
"\n",
21-
"%load_ext autoreload\n",
22-
"%autoreload 2"
19+
"jax.config.update(\"jax_enable_x64\", True)"
2320
]
2421
},
2522
{
@@ -37,17 +34,24 @@
3734
},
3835
{
3936
"cell_type": "code",
40-
"execution_count": 5,
37+
"execution_count": 2,
4138
"metadata": {},
4239
"outputs": [
40+
{
41+
"name": "stderr",
42+
"output_type": "stream",
43+
"text": [
44+
"An NVIDIA GPU may be present on this machine, but a CUDA-enabled jaxlib is not installed. Falling back to cpu.\n"
45+
]
46+
},
4347
{
4448
"name": "stdout",
4549
"output_type": "stream",
4650
"text": [
47-
"GFloat scalar : 7518.31 nsec (5 runs at size 10000)\n",
48-
"GFloat vectorized, numpy arrays: 57.95 nsec (5 runs at size 1000000)\n",
49-
"GFloat vectorized, JAX JIT : 4.03 nsec (100 runs at size 1000000)\n",
50-
"ML_dtypes : 3.34 nsec (100 runs at size 1000000)\n"
51+
"GFloat scalar : 6062.08 nsec (25 runs at size 10000)\n",
52+
"GFloat vectorized, numpy arrays: 53.39 nsec (25 runs at size 1000000)\n",
53+
"GFloat vectorized, JAX JIT : 3.48 nsec (500 runs at size 1000000)\n",
54+
"ML_dtypes : 3.27 nsec (500 runs at size 1000000)\n"
5155
]
5256
}
5357
],
@@ -65,7 +69,7 @@
6569
"\n",
6670
"\n",
6771
"# About how many seconds to run for (autorange will take at least .2 sec)\n",
68-
"ACCURACY = 0.2\n",
72+
"ACCURACY = 1.0\n",
6973
"\n",
7074
"\n",
7175
"def time(f, problem_size=1.0):\n",

0 commit comments

Comments
 (0)