Skip to content

Commit 2fbcbc5

Browse files
authoredOct 1, 2021
Merge pull request #2 from khushi-411/numpy_benchmarking
N-Body Problem: Added datasets, README for usage and for theory.
2 parents 520c4a6 + 2fff318 commit 2fbcbc5

10 files changed

+2414
-0
lines changed
 

‎nbody_problem/README.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# NumPy Benchmarks
2+
3+
Benchmarking NumPy in realistic situations.
4+
5+
## Usage
6+
7+
To run the benchmarks, you need to install the following libraries:
8+
```
9+
sudo pacman -S python-numpy
10+
sudo pacman -S python-pythran
11+
pip install transonic
12+
sudo pacman -S python-llvmlite
13+
sudo pacman -S python-setuptools
14+
conda install numba
15+
sudo pacman -S cmake
16+
sudo pacman -S gcc
17+
```
18+
19+
To Run the Files
20+
21+
1. Clone the Repository.
22+
```
23+
git clone https://github.com/numpy/numpyorg-benchmarks
24+
```
25+
26+
2. To execute NumPy and Python Code.
27+
```
28+
taskset -c 6,7,14,15 python python/filename.py data/dataset_filename.txt
29+
```
30+
*Note:* To obtain the accurate results the benchmarking is performed on the 4 isolated CPU cores (6, 7, 14, 15).
31+
32+
3. To execute Algorithms using Compiled Methods.
33+
```
34+
transonic -b BACKEND python/filename.py
35+
TRANSONIC_BACKEND="BACKEND" taskset -c 6,7,15,16 python python/filename.py data/dataset_filename.txt
36+
```
37+
38+
Here, `-b` flag used to set the BACKEND (presently, there are 3 backends in Transonic; `cython`, `numba` and `python`. The default backend is `pythran`. Currently, we used `numba` and `pythran` for our implementation.
39+
40+
## Writing Benchmarks
41+
42+
Obtaining stable and reliable benchmark results requires to tune the system and to analyze the results manually.
43+
44+
Some things to consider:
45+
- The first goal is to avoid the outliers caused by noisy applications.
46+
- To set the system state for benchmarking use the [pyperf system tune command](https://pyperf.readthedocs.io/en/latest/cli.html#system-cmd).
47+
- To reduce the system jitter refer [tune the system for benchmarks](https://pyperf.readthedocs.io/en/latest/system.html#system) page.

‎nbody_problem/data/input128.txt

+129
Large diffs are not rendered by default.

‎nbody_problem/data/input16.txt

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-1 0.0625 0.214835865608654947 -0.120469325327368135 -0.2661811268232539 0.757849421156586822 0.157644506165220161 -0.0715602005208729741
2+
-1 0.0625 -0.129919123158631022 0.116379094303405983 0.133080554128754053 0.486052966602537106 0.395427627261877745 -0.734692224692122475
3+
-1 0.0625 -0.410208378045080091 0.109354870524110206 -0.324396822089431269 -0.383791028776759968 0.0496602615700619254 0.378808792416775286
4+
-1 0.0625 0.255086977437966045 -0.123206701489244466 -0.370490384977665566 -0.450466427040683792 -0.281691172697528636 -0.185462114144705426
5+
-1 0.0625 -0.354752159898959474 -0.31060829606615864 0.314540789088777084 0.275159898604911246 -0.548791386040452633 -0.209797996849041768
6+
-1 0.0625 0.16502984445788807 -0.21452299393747018 1.32555928694859393 0.140593096267161405 0.23623605142486559 0.273061388949567607
7+
-1 0.0625 0.429578710749940917 0.486818153487116934 0.181073664985952287 -0.0539885959200906915 -0.176655306840287851 -0.69464977663931049
8+
-1 0.0625 -0.615104941591427701 0.297292071802583491 -0.407208633089183814 0.144247206691717561 0.880157154616842852 0.372927641740506965
9+
-1 0.0625 0.526844391659375466 -0.225238863848920445 -0.0858175235997876429 -0.170693379896528441 0.525004419487255625 -0.165895533066861667
10+
-1 0.0625 -0.784247975459690938 2.88024285713089023 0.422769785428553202 -0.397599351887202745 -0.193469722164481828 0.129716098638342187
11+
-1 0.0625 0.557328942603933286 -0.669584458021703521 -1.18669004231490538 -0.193956120455493958 0.318551106618286173 -0.0385091511689474308
12+
-1 0.0625 0.663045405926924847 -1.45465317533174687 1.08382405457320763 -0.256111120227146827 -0.202605323424895567 0.288501494317296991
13+
-1 0.0625 -0.227323512866007577 0.348104100173003139 -0.147906561326105135 0.718552359009200226 -0.0282296194471982724 0.900931748619264838
14+
-1 0.0625 -0.0756982740351159478 0.150819419760155976 -0.408069797108747689 -0.0568988462176753251 -0.970986937859766863 -0.0214726046192551326
15+
-1 0.0625 0.466554170775371646 -0.914680937590023668 0.279919799571218153 -0.499730803777436394 -0.201272413171611736 0.313715970489572504
16+
-1 0.0625 -0.681049944165142307 -0.356045815568630075 -0.544007043395975831 -0.0592192741330963002 0.0410207545018133196 -0.535623533470209079
17+

‎nbody_problem/data/input1k.txt

+1,025
Large diffs are not rendered by default.

‎nbody_problem/data/input256.txt

+257
Large diffs are not rendered by default.

‎nbody_problem/data/input32.txt

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-1 0.03125 0.505008139667655453 0.238902348623402982 0.235927190671666842 0.23881172293564043 -0.118773278054457559 0.485495056314744211
2+
-1 0.03125 -0.413418508400270002 -0.562346328415919028 0.934004133712412532 -0.152658529367818957 0.266753987772667511 -0.0951337078878834591
3+
-1 0.03125 0.296748114324388579 -0.640266513214516442 -0.292931848199341871 0.0610707206009441644 -0.66484619154044089 -0.166986680128857506
4+
-1 0.03125 0.608424621885469752 0.19609976013140995 0.0302395704536416038 -0.561066830393597837 -0.393071413095528011 0.883015963358481093
5+
-1 0.03125 1.41380950244082504 1.07490208585455549 0.0164477179455536499 0.0437663702241735675 0.672855804878932373 -0.113868788670268367
6+
-1 0.03125 -0.00755884951666290373 -0.52587511130215725 -1.79811932973187161 0.244831567332841976 0.0722629450712420907 -0.535639075426833422
7+
-1 0.03125 1.99280153993068621 0.011948416853461612 -1.85354778414014154 -0.0941642878506343955 0.332443577459897832 0.191828521177856759
8+
-1 0.03125 -0.343781697778386408 0.384204048247417718 -0.629159518967945863 -0.457505341755374106 -0.12785317223782422 0.293800678326671894
9+
-1 0.03125 0.383143039745710068 -0.462793795751259007 0.119637058873614255 -0.121997003353874395 -0.0599222529662646469 0.0969743837230837014
10+
-1 0.03125 0.222464799597125062 0.436019607208570636 0.0886550624340333576 -0.207447472369293839 0.266479043658238102 0.699770385264208317
11+
-1 0.03125 -2.16021559128593887 0.833524497330526914 0.65657908471371218 0.325132201846549784 -0.186130719964866687 0.034803237230839397
12+
-1 0.03125 -5.29303631221651916 -3.15588952308546533 2.37644924859496021 -0.212235616560106588 0.0612813903846925884 0.0107739997144785746
13+
-1 0.03125 0.253111662005460369 0.124544665353061357 0.0082708039276655626 0.499934199404774571 0.572601457930222102 -0.801546963719486638
14+
-1 0.03125 0.105798115815366925 -0.55064020864160379 0.348992390995265689 -0.589601185752036572 -0.30791805020704377 -0.212720633220328303
15+
-1 0.03125 0.410262067315897427 0.247409007516869395 0.15110818987986141 0.355890948598594603 0.306272893808667457 -0.224266418718175042
16+
-1 0.03125 0.709829392540952897 0.387308853552166932 -0.311478443065520694 0.0796130364673040825 -0.0706789566461659691 -0.583581432366157338
17+
-1 0.03125 -0.0177638311307054403 0.354592143488024314 0.294793434312778546 -0.189656934430230434 0.651581069769597399 0.160325673567786264
18+
-1 0.03125 0.136541760668508788 0.153011139571352844 0.316333411346496229 0.00339458887404311613 0.190910001270790219 -0.158735354642049659
19+
-1 0.03125 -1.03610546856013497 -0.500115597215110563 -0.857309611312975339 0.0773892135661982117 -0.240445158522435698 0.0441270792950485408
20+
-1 0.03125 0.269832975661778773 0.476094850275027848 -0.878356857032524196 0.0784837000537541157 0.353266852499449557 -0.589435263164910461
21+
-1 0.03125 -0.0170383216411592042 -0.471787113586415563 1.09821845528100748 0.234235157491718832 -0.170991210930234616 0.853832338475830066
22+
-1 0.03125 0.386427626916802824 -0.250863887457041246 0.212241339119045136 0.0925223623103073045 0.568620284741263471 0.604422041833760026
23+
-1 0.03125 -0.229486726163486227 0.297302011494995744 0.0280370110155652025 -0.675446634913474453 -0.8294101461045984 -0.187508298666015788
24+
-1 0.03125 0.038652761579720675 -0.654488160197245539 -0.33966444888778613 -0.176630088550703446 -0.598992450373063479 0.384564220498956111
25+
-1 0.03125 0.772154403115460686 0.241691533030623629 0.698739251281120799 0.500929676031192206 0.250665460359119519 0.436922175122734568
26+
-1 0.03125 -0.345039389183073697 -0.379708017500234807 -0.140121159269868123 -0.350291995352644825 -0.1844772239431125 -0.677109283938597928
27+
-1 0.03125 -0.0263432303708105858 0.466993623960657578 0.296630034384249397 0.618577223675000898 -0.421243530942705002 -0.264331377930172917
28+
-1 0.03125 0.463571166041138738 -0.295807602263941094 -0.128164132315838619 0.00724856431600236217 -0.528640419412155005 -0.490942355603399161
29+
-1 0.03125 0.38733428911379475 0.70460272037286964 0.018246033976567419 0.281332717122414144 0.893708071963703055 0.043803978626541111
30+
-1 0.03125 -0.0187468140610206543 -0.111793476614774567 -0.479929133409604969 0.480375240933547609 0.00212783596851373689 0.859609314852192719
31+
-1 0.03125 0.408513545141746537 1.52156987545611977 -0.00687142852794229205 0.101027036935606135 -0.402596190851031988 -0.388998543003643671
32+
-1 0.03125 0.14410521679967736 0.411654146924569864 -0.213895728057856088 -0.535864328070818519 -0.155840311745068683 -0.593264870296433711
33+

0 commit comments

Comments
 (0)
Please sign in to comment.