Skip to content

Commit 69285b3

Browse files
committed
New plan - nbval
1 parent 5d1c296 commit 69285b3

File tree

3 files changed

+11
-26
lines changed

3 files changed

+11
-26
lines changed

docs/source/04-benchmark.ipynb

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -35,42 +35,28 @@
3535
{
3636
"cell_type": "code",
3737
"execution_count": 2,
38-
"metadata": {
39-
"nbreg": {
40-
"diff_replace": [
41-
[
42-
"/outputs",
43-
": +[0-9.]+ nsec .*",
44-
": TIME "
45-
]
46-
]
47-
},
48-
"tags": [
49-
"NOTE: NBREG"
50-
]
51-
},
38+
"metadata": {},
5239
"outputs": [
5340
{
54-
"name": "stdout",
41+
"name": "stderr",
5542
"output_type": "stream",
5643
"text": [
57-
"GFloat scalar : 5843.22 nsec (25 runs at size 10000)\n",
58-
"GFloat vectorized, numpy arrays: 45.12 nsec (25 runs at size 1000000)\n",
59-
"GFloat vectorized, JAX JIT : 2.50 nsec (500 runs at size 1000000)\n",
60-
"ML_dtypes : 2.42 nsec (500 runs at size 1000000)\n"
44+
"An NVIDIA GPU may be present on this machine, but a CUDA-enabled jaxlib is not installed. Falling back to cpu.\n"
6145
]
6246
},
6347
{
64-
"name": "stderr",
48+
"name": "stdout",
6549
"output_type": "stream",
6650
"text": [
67-
"An NVIDIA GPU may be present on this machine, but a CUDA-enabled jaxlib is not installed. Falling back to cpu.\n"
51+
"GFloat scalar : 6306.18 nsec (25 runs at size 10000)\n",
52+
"GFloat vectorized, numpy arrays: 52.52 nsec (25 runs at size 1000000)\n",
53+
"GFloat vectorized, JAX JIT : 3.04 nsec (500 runs at size 1000000)\n",
54+
"ML_dtypes : 2.69 nsec (500 runs at size 1000000)\n"
6855
]
6956
}
7057
],
7158
"source": [
72-
"# Note cell contains additional metadata to make pytest-notebook ignore timing diffs\n",
73-
"# \"nbreg\": { \"diff_replace\": [[\"/outputs\", \": +[0-9.]+ nsec\", \": TIME \"]] }\n",
59+
"# NBVAL_IGNORE_OUTPUT\n",
7460
"\n",
7561
"N = 1_000_000\n",
7662
"a = np.random.rand(N)\n",

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,4 @@ module = "mx.*"
4040
ignore_missing_imports = true
4141

4242
[tool.pytest.ini_options]
43-
nb_test_files = true
44-
nb_diff_ignore = ["/metadata/language_info"]
43+
addopts = "--nbval"

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Requirements for tests (see "requirements-tests.txt" also for direct dependencies)
22
pytest
3-
pytest-notebook
3+
nbval
44
ml_dtypes
55
jaxlib
66
jax

0 commit comments

Comments
 (0)