Last active
October 14, 2020 15:27
-
-
Save yuxuanzhuang/82e1e7b57d0cda80ac964d1cd138f618 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 40, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import numpy as np\n", | |
"import matplotlib.pyplot as plt\n", | |
"import timeit\n", | |
"%matplotlib inline" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 41, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from threadpoolctl import threadpool_limits " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 42, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import time" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 43, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"The line_profiler extension is already loaded. To reload it, use:\n", | |
" %reload_ext line_profiler\n" | |
] | |
} | |
], | |
"source": [ | |
"%load_ext line_profiler" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Without np.dot" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Time profile" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 55, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def thread_effect_on_numpy(size, n_thread):\n", | |
" with threadpool_limits(n_thread):\n", | |
" for i in range(20):\n", | |
" ts = np.random.rand(size,3)\n", | |
"# _ = np.dot(ts, np.random.rand(3,3))\n", | |
" _ = ts + np.random.rand(size,3)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 56, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"70.7 ms ± 811 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" | |
] | |
} | |
], | |
"source": [ | |
"%timeit thread_effect_on_numpy(100000, 1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 57, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"70.4 ms ± 383 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" | |
] | |
} | |
], | |
"source": [ | |
"%timeit thread_effect_on_numpy(100000, 6)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 58, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"70.2 ms ± 442 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" | |
] | |
} | |
], | |
"source": [ | |
"%timeit thread_effect_on_numpy(100000, 12)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Line profile" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 62, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def thread_effect_on_numpy(size, n_thread):\n", | |
" with threadpool_limits(n_thread):\n", | |
" for i in range(20):\n", | |
" ts = np.random.rand(size,3)\n", | |
"# _ = np.dot(ts, np.random.rand(3,3))\n", | |
" _ = ts + np.random.rand(size,3)\n", | |
" time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 63, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.0906 s\n", | |
"File: <ipython-input-62-69068f548b95>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 5194.0 5194.0 0.1 with threadpool_limits(n_thread):\n", | |
" 3 21 139.0 6.6 0.0 for i in range(20):\n", | |
" 4 20 35716.0 1785.8 0.4 ts = np.random.rand(size,3)\n", | |
" 5 # _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 37070.0 1853.5 0.4 _ = ts + np.random.rand(size,3)\n", | |
" 7 20 10012475.0 500623.8 99.2 time.sleep(0.5)" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 64, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.0891 s\n", | |
"File: <ipython-input-62-69068f548b95>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 4964.0 4964.0 0.0 with threadpool_limits(n_thread):\n", | |
" 3 21 135.0 6.4 0.0 for i in range(20):\n", | |
" 4 20 34964.0 1748.2 0.3 ts = np.random.rand(size,3)\n", | |
" 5 # _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 37132.0 1856.6 0.4 _ = ts + np.random.rand(size,3)\n", | |
" 7 20 10011892.0 500594.6 99.2 time.sleep(0.5)" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 2)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 65, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.0892 s\n", | |
"File: <ipython-input-62-69068f548b95>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 5189.0 5189.0 0.1 with threadpool_limits(n_thread):\n", | |
" 3 21 134.0 6.4 0.0 for i in range(20):\n", | |
" 4 20 34625.0 1731.2 0.3 ts = np.random.rand(size,3)\n", | |
" 5 # _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 37139.0 1857.0 0.4 _ = ts + np.random.rand(size,3)\n", | |
" 7 20 10012092.0 500604.6 99.2 time.sleep(0.5)" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 6)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 66, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.0891 s\n", | |
"File: <ipython-input-62-69068f548b95>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 5152.0 5152.0 0.1 with threadpool_limits(n_thread):\n", | |
" 3 21 134.0 6.4 0.0 for i in range(20):\n", | |
" 4 20 34760.0 1738.0 0.3 ts = np.random.rand(size,3)\n", | |
" 5 # _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 37205.0 1860.2 0.4 _ = ts + np.random.rand(size,3)\n", | |
" 7 20 10011816.0 500590.8 99.2 time.sleep(0.5)" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 12)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# With np.dot" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Time profile" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 51, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def thread_effect_on_numpy(size, n_thread):\n", | |
" with threadpool_limits(n_thread):\n", | |
" for i in range(20):\n", | |
" ts = np.random.rand(size,3)\n", | |
" _ = np.dot(ts, np.random.rand(3,3))\n", | |
" _ = ts + np.random.rand(size,3)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 52, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"88.1 ms ± 516 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" | |
] | |
} | |
], | |
"source": [ | |
"%timeit thread_effect_on_numpy(100000, 1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 53, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"81.8 ms ± 349 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" | |
] | |
} | |
], | |
"source": [ | |
"%timeit thread_effect_on_numpy(100000, 6)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 54, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"162 ms ± 3.74 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)\n" | |
] | |
} | |
], | |
"source": [ | |
"%timeit thread_effect_on_numpy(100000, 12)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Line profile" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 67, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def thread_effect_on_numpy(size, n_thread):\n", | |
" with threadpool_limits(n_thread):\n", | |
" for i in range(20):\n", | |
" ts = np.random.rand(size,3)\n", | |
" _ = np.dot(ts, np.random.rand(3,3))\n", | |
" _ = ts + np.random.rand(size,3)\n", | |
" time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 68, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.1036 s\n", | |
"File: <ipython-input-67-7d449ec863ee>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 5224.0 5224.0 0.1 with threadpool_limits(n_thread):\n", | |
" 3 21 136.0 6.5 0.0 for i in range(20):\n", | |
" 4 20 34411.0 1720.5 0.3 ts = np.random.rand(size,3)\n", | |
" 5 20 14159.0 708.0 0.1 _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 37360.0 1868.0 0.4 _ = ts + np.random.rand(size,3)\n", | |
" 7 20 10012273.0 500613.7 99.1 time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 69, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.1006 s\n", | |
"File: <ipython-input-67-7d449ec863ee>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 5138.0 5138.0 0.1 with threadpool_limits(n_thread):\n", | |
" 3 21 138.0 6.6 0.0 for i in range(20):\n", | |
" 4 20 34689.0 1734.5 0.3 ts = np.random.rand(size,3)\n", | |
" 5 20 9780.0 489.0 0.1 _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 38269.0 1913.5 0.4 _ = ts + np.random.rand(size,3)\n", | |
" 7 20 10012557.0 500627.8 99.1 time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 2)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 70, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.0969 s\n", | |
"File: <ipython-input-67-7d449ec863ee>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 5083.0 5083.0 0.1 with threadpool_limits(n_thread):\n", | |
" 3 21 131.0 6.2 0.0 for i in range(20):\n", | |
" 4 20 34686.0 1734.3 0.3 ts = np.random.rand(size,3)\n", | |
" 5 20 6795.0 339.8 0.1 _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 38038.0 1901.9 0.4 _ = ts + np.random.rand(size,3)\n", | |
" 7 20 10012139.0 500607.0 99.2 time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 6)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 71, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.1305 s\n", | |
"File: <ipython-input-67-7d449ec863ee>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 4809.0 4809.0 0.0 with threadpool_limits(n_thread):\n", | |
" 3 21 136.0 6.5 0.0 for i in range(20):\n", | |
" 4 20 34591.0 1729.5 0.3 ts = np.random.rand(size,3)\n", | |
" 5 20 6837.0 341.9 0.1 _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 72670.0 3633.5 0.7 _ = ts + np.random.rand(size,3)\n", | |
" 7 20 10011480.0 500574.0 98.8 time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 12)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Non-numpy Operation after np.dot" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 77, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def thread_effect_on_numpy(size, n_thread):\n", | |
" with threadpool_limits(n_thread):\n", | |
" for i in range(20):\n", | |
" ts = np.random.rand(size,3)\n", | |
" _ = np.dot(ts, np.random.rand(3,3))\n", | |
" _ = [i * i for i in range(100000)]\n", | |
" time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 78, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.2795 s\n", | |
"File: <ipython-input-77-1bc3cbed1859>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 4985.0 4985.0 0.0 with threadpool_limits(n_thread):\n", | |
" 3 21 148.0 7.0 0.0 for i in range(20):\n", | |
" 4 20 35276.0 1763.8 0.3 ts = np.random.rand(size,3)\n", | |
" 5 20 26085.0 1304.2 0.3 _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 201422.0 10071.1 2.0 _ = [i * i for i in range(100000)]\n", | |
" 7 20 10011595.0 500579.8 97.4 time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 79, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.2745 s\n", | |
"File: <ipython-input-77-1bc3cbed1859>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 4776.0 4776.0 0.0 with threadpool_limits(n_thread):\n", | |
" 3 21 143.0 6.8 0.0 for i in range(20):\n", | |
" 4 20 34844.0 1742.2 0.3 ts = np.random.rand(size,3)\n", | |
" 5 20 21775.0 1088.8 0.2 _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 200999.0 10050.0 2.0 _ = [i * i for i in range(100000)]\n", | |
" 7 20 10011933.0 500596.7 97.4 time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 2)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 82, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.5088 s\n", | |
"File: <ipython-input-77-1bc3cbed1859>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 4823.0 4823.0 0.0 with threadpool_limits(n_thread):\n", | |
" 3 21 135.0 6.4 0.0 for i in range(20):\n", | |
" 4 20 34576.0 1728.8 0.3 ts = np.random.rand(size,3)\n", | |
" 5 20 29308.0 1465.4 0.3 _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 428546.0 21427.3 4.1 _ = [i * i for i in range(100000)]\n", | |
" 7 20 10011364.0 500568.2 95.3 time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 6)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 81, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Timer unit: 1e-06 s\n", | |
"\n", | |
"Total time: 10.5215 s\n", | |
"File: <ipython-input-77-1bc3cbed1859>\n", | |
"Function: thread_effect_on_numpy at line 1\n", | |
"\n", | |
"Line # Hits Time Per Hit % Time Line Contents\n", | |
"==============================================================\n", | |
" 1 def thread_effect_on_numpy(size, n_thread):\n", | |
" 2 1 5186.0 5186.0 0.0 with threadpool_limits(n_thread):\n", | |
" 3 21 131.0 6.2 0.0 for i in range(20):\n", | |
" 4 20 34568.0 1728.4 0.3 ts = np.random.rand(size,3)\n", | |
" 5 20 28471.0 1423.5 0.3 _ = np.dot(ts, np.random.rand(3,3))\n", | |
" 6 20 440734.0 22036.7 4.2 _ = [i * i for i in range(100000)]\n", | |
" 7 20 10012452.0 500622.6 95.2 time.sleep(0.5) # a buffer time between two iter" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"%lprun -f thread_effect_on_numpy thread_effect_on_numpy(100000, 12)" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "gsoc", | |
"language": "python", | |
"name": "gsoc" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.8.3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As a sum up for the code performance after
numpy.dot
(Line 6)Another interesting observation is that non-numpy operation is already performing pretty bad with 6 threads.
The test was down with
version_1
version_2
version_3
Will check if it's version related.
EDIT: Update with other clean-installed version of numpy (OpenBlas, MKL).