• Stars
    star
    100
  • Rank 331,363 (Top 7 %)
  • Language
    Python
  • Created almost 13 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for High Performance Computing tutorial for EuroPython 2011
Source code for High Performance Computing tutorial at EuroPython 2011
[email protected] 

Description:
The 4 hour tutorial will cover various ways of speeding up the provided Mandelbrot code with a variety of Python packages that let us go from bytecode to C, run on many CPUs and many machines and also use a GPU. The presentation for the tutorial should give the necessary background.

All the files are in subdirectories and are independent of each other, the general pattern is:
python mandelbrot.py 1000 1000
where "mandelbrot.py" might be named e.g. "pure_python.py" or "cython_numpy_loop.py", the first 1000 is the pixel width and height, the second 1000 is the number of iterations. 1000x1000px plots with 1000 iterations are pretty. Use the arguments "100 30" for a super quick test to validate that things are working (it makes a 100x100px image using only 30 iterations).

The tutorial starts by using cProfile, RunSnakeRun and line_profiler to find the bottleneck, we then improve the code and add libraries to keep making things faster.

Overview of the versions:
pure_python: Python implementations for python and pypy
cython_pure_python: a converstion of the python code using cython
numpy_loop: a conversion of the python code using numpy vectors (but run without vector calls)
cython_numpy_loop: as numpy_loop but compiled with cython
numpy_vector: using vector calls on numpy vectors
numpy_vector_numexpr: adding numexpr on the numpy vectors
shedskin: minor conversion to get good speed using shedskin
multiprocessing: using built-in multiprocessing module to run on all cores using pure python implementation
parallelpython_pure_python: using parallelpython module to run across machines and cpus
parallelpython_cython_pure_puthon: showing compiled cython version of pure_python running over machines 
pycuda: gpuarray, elementwisekernel and sourcemodule examples of numpy-like and C code on CUDA GPUs via python

Note that the pure_python examples run fine using PyPy or Python 2.7.1.

Blog write-up (TO FOLLOW)

Versions of packages used to create this tutorial:
Cython 0.14.1
numexpr 1.4.2
numpy 1.5.1
pyCUDA HEAD from git as of 14th June 2011 (with CUDA 4.0 drivers)
PyPy 1.5
Python 2.7.1
ParallelPython 1.6.1
ShedSkin 0.7.1

More Repositories

1

data_science_delivered

Observations from Ian on successfully delivering data science products
Jupyter Notebook
539
star
2

ipython_memory_usage

IPython tool to report memory usage deltas for every command you type
Jupyter Notebook
358
star
3

dtype_diet

Tries to shrink your Pandas column dtypes with no data loss so you have more spare RAM
Python
77
star
4

featherweight_web_api

Featherweight web API provider for serving R&D methods as web functions
Python
66
star
5

ark-tweet-nlp-python

Simple Python wrapper around runTagger.sh of ark-tweet-nlp
Python
63
star
6

twitter-social-graph-networkx

Download, summarise and visualise the followers in a small twitter social network
Python
59
star
7

HighPerformancePython_PyCon2012

Python
58
star
8

social_media_brand_disambiguator

Brand disambiguator for tweets to differentiate e.g. Orange vs orange (brand vs foodstuff), using NLTK and scikit-learn
Python
57
star
9

beyond_correlation

Exploratory code to see if we can learn about feature relationships in a DataFrame using machine learning
Python
54
star
10

notes_to_self

Python
40
star
11

twitter_networkx_concept_map

Take streaming tweets, extract hashtags & usernames, create graph, export graphml for Gephi visualisation
Python
33
star
12

string_distance_metrics

A set of Python string distance metrics for string distance comparisons
Python
27
star
13

learning_text_transformer_demo

Demo code for learning_text_transformer
Python
25
star
14

pyconuk_using_sklearn_classification

PyConUK 2016 talk - Using Machine Learning to solve a classification problem with scikit-learn - a practical walkthrough
Jupyter Notebook
18
star
15

pycon2013_applied_parallel_computing

Applied Parallel Computing tutorial material for PyCon 2013 (Minesh Amin, Ian Ozsvald)
C
17
star
16

learning_text_transformer

Search 'from' and 'to' strings to learn a text cleaning mapping
Python
17
star
17

python_template_with_config

Python coding template including ENV environment variable configuration
Python
15
star
18

euroscipy2014_highperformancepython

Python
13
star
19

ParallelPython_EuroSciPy2012

Starting code & solutions for EuroSciPy Paralllel Python 2 hour tutorial
Python
11
star
20

Python6hrsTutorial

6 hour Python tutorial slides (open sourced for anyone to re-use)
Python
9
star
21

callgraph_james_powell

Code from James for a callgraph monitor
Python
9
star
22

mot_pandas2_polars_dask

Investigation for PyDataLondon 2023 and ODSC 2023 conference comparing Pandas 2, Polars and Dask
HTML
8
star
23

Mandelbrot_pyCUDA_Cython_Numpy

Compare execution speeds of Mandelbrot using pyCUDA, Cython, Numpy (with Didrik Pinte @ Enthought)
7
star
24

plaquereader

Automatic English Heritage plaque transcriber for the OpenPlaques project
Python
5
star
25

london_oyster_pdf_to_dataframe_parser

Convert London Oytser rail+tube+bus PDF journey histories into a Pandas DataFrame as an HDF5 file
Python
4
star
26

talkpay_tweet_visualisataion

Viz of #talkpay pay tweets during May 2015
Python
4
star
27

research_module_layout_template

Python module structure for Jupyter Notebooks for R&D (e.g. Machine Learning) and collaboration
Jupyter Notebook
4
star
28

PyDataBudapest202004

"Making Pandas Fly" talk on data science at PyDataBudapest
Jupyter Notebook
4
star
29

oyster-scraper

Scrape the London Oyster website for Tube travel data with Python (forked from markk)
Python
3
star
30

kaggle_titanic_ipythonnotebook_boilerplate

Boilerplate example using IPython Notebook to solve simplest (sex-field only) Titanic challenge for Kaggle (this will get you started wtih the Kaggle competition)
3
star
31

ocr_aicookbook

Optical Character Recognition server behind bottle.py interface
3
star
32

pylondinium2019

Jupyter Notebook
3
star
33

SocialMicroprinter

CBM 231 drivers for Aruino+WiShield to turn a receipt printer into a remote social microprinter
Python
3
star
34

dataframe_visualiser

Make simple high-level visualisations of a Pandas dataframe to help when starting new data projects
Python
3
star
35

uplift_experiment

Jupyter Notebook
2
star
36

churn_a_b_tests_statistical_power

Jupyter Notebook
2
star
37

explore_cpu_cache_effect

Understanding my CPU's L3 cache using numpy vectorized operations
Python
2
star
38

dtype_pandas_numpy_speed_test

Speed test on Pandas or NumPy
Python
2
star
39

morris_counter

Probabilistic Morris Counter (counts 2^n using e.g. just a byte)
Python
2
star
40

LanyrdViewerUsingProtoVis

Visualise the social graph behind Lanyrd events with an interactive JS graph
2
star
41

Dell_E6420_Touchpad_AutoDisabler

Touchpad disabled automatically when typing
Python
2
star
42

libccv_bbfdetect_pywrapper

Python wrapper around command line call to libccv's bbfdetect face detector
Python
2
star
43

example_conversion_of_excel_to_pandas

Convert an XLS file via Pandas, replicate some logic, add string handling logic, output an XLSX
Jupyter Notebook
1
star
44

mongocsvimporter

Typed (annotated) CSV importer for Mongo (based on mongoimporter)
Python
1
star
45

libccv_face_detect_directory

Simple for loop on directory of images to count nbr of faces found using libccv's bbfdetect
Python
1
star
46

kaggle_optiver_volatility

Jupyter Notebook
1
star
47

pydata2020global

Conference talk material
Jupyter Notebook
1
star
48

dataframes_alike

Python
1
star
49

matplotlib_heightmap_2d_3d

Plot a heightmap (Z on X/Y axis) in 3D and 2D in matplotlib
Python
1
star
50

pyconuk2018_diagramatic_diagnosis_of_data

HTML
1
star
51

europython2018_keynote_notebook_demo

How heavy is puppy-Ada? A short demo of live data collection and analysis in a Jupyter Notebook
Jupyter Notebook
1
star
52

quantified_cat_flap

RaspberryPi code to read reed switches on a catflap
Python
1
star
53

networkx_example

Example of plotting with networkx and some interaction (mainly to help myself)
Python
1
star
54

python_exception_examples

Simple examples of python 2 (and 3) exceptions so I can stop reading the docs all the time
1
star
55

matplotlib_templates

Templates for things that I like
Jupyter Notebook
1
star