|
2 | 2 | "cells": [
|
3 | 3 | {
|
4 | 4 | "cell_type": "code",
|
5 |
| - "execution_count": 12, |
| 5 | + "execution_count": 1, |
6 | 6 | "metadata": {},
|
7 |
| - "outputs": [ |
8 |
| - { |
9 |
| - "name": "stdout", |
10 |
| - "output_type": "stream", |
11 |
| - "text": [ |
12 |
| - "The autoreload extension is already loaded. To reload it, use:\n", |
13 |
| - " %reload_ext autoreload\n" |
14 |
| - ] |
15 |
| - } |
16 |
| - ], |
| 7 | + "outputs": [], |
17 | 8 | "source": [
|
18 | 9 | "# Copyright (c) 2024 Graphcore Ltd. All rights reserved.\n",
|
19 | 10 | "\n",
|
|
39 | 30 | "\n",
|
40 | 31 | "The `gfloat` library is designed for readability over performance, and the reference code for computations is the (slow) scalar code e.g. `round_float`.\n",
|
41 | 32 | "\n",
|
42 |
| - "There are vectorized implementations (e.g. `round_ndarray`, and when combined with JAX, these can go reasonably fast).\n", |
| 33 | + "There are vectorized implementations (e.g. `round_ndarray`), and when combined with JAX, these can go reasonably fast.\n", |
43 | 34 | "\n",
|
44 | 35 | "Let's see how long it takes to encoed some values to FP8..."
|
45 | 36 | ]
|
46 | 37 | },
|
47 | 38 | {
|
48 | 39 | "cell_type": "code",
|
49 |
| - "execution_count": null, |
| 40 | + "execution_count": 2, |
50 | 41 | "metadata": {},
|
51 | 42 | "outputs": [
|
| 43 | + { |
| 44 | + "name": "stderr", |
| 45 | + "output_type": "stream", |
| 46 | + "text": [ |
| 47 | + "An NVIDIA GPU may be present on this machine, but a CUDA-enabled jaxlib is not installed. Falling back to cpu.\n" |
| 48 | + ] |
| 49 | + }, |
52 | 50 | {
|
53 | 51 | "name": "stdout",
|
54 | 52 | "output_type": "stream",
|
55 | 53 | "text": [
|
56 |
| - "GFloat scalar : 6996.75 nsec (50 runs at size 10000)\n", |
57 |
| - "GFloat vectorized, numpy arrays: 75.04 nsec (50 runs at size 1000000)\n", |
58 |
| - "GFloat vectorized, JAX JIT : 3.18 nsec (1000 runs at size 1000000)\n", |
59 |
| - "ML_dtypes : 3.13 nsec (1000 runs at size 1000000)\n" |
| 54 | + "GFloat scalar : 6666.04 nsec (50 runs at size 10000)\n", |
| 55 | + "GFloat vectorized, numpy arrays: 57.84 nsec (50 runs at size 1000000)\n", |
| 56 | + "GFloat vectorized, JAX JIT : 3.17 nsec (1000 runs at size 1000000)\n", |
| 57 | + "ML_dtypes : 2.92 nsec (1000 runs at size 1000000)\n" |
60 | 58 | ]
|
61 | 59 | }
|
62 | 60 | ],
|
|
0 commit comments