Writing code that you need not look back at - Fast and "good" python at scale
R S Nikhil Krishna (~rsnk) |
Python - Turing Complete and easy at the same time.
Given its simplicity, one may be tempted to use it to solve a problem of any magnitude. But as the codebase scales, so does the difficulty in managing it. And as the applicability scales up, so does the difficulty in maintaining performance.
In this workshop, we will walk through how these problems crop up in the first place, and how to tackle them. This workshop will NOT cover scalability from the perspective of distributing data loading and computation across multiple compute units (horizontal scalability). We will focus more on how to write code from the very start that is both efficient in performance and makes a larger codebase manageable.
The topics we will go through are:
1.Performance - How should one write "fast" code
- Finding the bottleneck - Profiling
- Compiling Python to C - JIT vs AOT / Cython vs Numba vs Pythran vs PyPy - How they differ and choosing which one is for you
- Concurrency - To parallelize or not to parallelize, to sync or not to sync
- Choosing the right data structures
- Hacks and bits that can get us the extra performance
2.Design Principles - How should one write "good" code, because we have all written code that we have difficulty in understanding ourselves in no time
- Logging - Keeping track of what happened when and where
- Type Checking - The why and the how
- Unit Tests and beyond
- Cython, numba, and pythran installed. All of them are available on pip/conda
- Working knowledge of Python
Content will be uploaded soon.
The content of an earlier workshop by the authors covering some of the topics of this workshop in detail can be viewed here
In the The Computer Vision and Intelligence Group at IIT Madras, both authors have taken sessions to initiate hundreds of college students to Python, Computer Vision and AI, openly accessible at their github repo
R S Nikhil Krishna
Nikhil is a final year student at IIT Madras. He currently leads the Computer Vision and AI team at Detect Technologies and has headed the CVI group at CFI, IIT Madras in the past. In the past, He has worked on semi-autonomous tumour detection for automated brain surgery at the Division of Remote Handling and Robotics, BARC and on importance sampling for accelerated gradient optimization methods applied to Deep Learning at EPFL, Switzerland. His love for python started about 4 years back, with a multitude of computer vision projects like QR code recognition, facial expression identification, etc.
Lokesh Kumar T
Lokesh is a 3rd-year student at IIT Madras. He currently co-heads the CVI group, CFI. He uses Python for Computer Vision, Deep Learning, and Language Analysis. In DeTect technologies, he has worked on automating the chimney and stack inspections using Computer Vision and on on-Board vision-based processing for drones. His interest in python began during his stay at IIT Madras, from institute courses to CVI projects like face recognition, hand gesture control of bots, etc