-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimization TEP #27
Open
harpolea
wants to merge
3
commits into
tardis-sn:master
Choose a base branch
from
harpolea:optimization_temp
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Optimization TEP #27
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
=============================== | ||
TEPXXX: Optimization with numba | ||
=============================== | ||
|
||
Status | ||
====== | ||
|
||
**Discussion** | ||
|
||
Responsible | ||
=========== | ||
|
||
@harpolea @lukeshingles | ||
|
||
Branches and Pull requests | ||
========================== | ||
|
||
`numba_montecarlo<https://github.com/tardis-sn/tardis/tree/numba_montecarlo>`_ | ||
|
||
#929 | ||
|
||
Description | ||
=========== | ||
|
||
In order to optimize the execution of several computationally intensive parts of TARDIS, we currently use Cython. This converts these parts of the code to C and compiles them ahead of time, significantly improving their performance. However, while fast, Cython involves a lot of extra boilerplate code, making the code overall harder to follow and more difficult to maintain. We would, therefore, like to convert this Cython code to Numba, a just-in-time Python compiler that involves significantly less additional code to Cython but can achieve similar performance. | ||
|
||
We would also like to explore further ways to optimize the code through e.g. restructuring. | ||
|
||
Implementation | ||
============== | ||
|
||
1. Review the existing PR which converts the Monte Carlo routines to numba. If necessary, make modifications so that PR is ready to merge. | ||
|
||
2. Profile the code to identify bottlenecks. Attention should be paid to how the code is profiled (e.g. be careful profiling JIT compiled numba code) and how performance varies between different types of problems (e.g. do some types of problems spend much longer on specific tasks than others?). | ||
|
||
3. Explore ways to eliminate bottlenecks. This could be through: | ||
- converting certain routines to numba, | ||
- refactoring certain parts of the code to e.g. eliminate repeated operations and costly data accesses, | ||
- and large scale restructuring. | ||
A number of different approaches should be explored and reviewed in order to find the optimal solution. | ||
For numba routines, the performance tips described in the `numba documentation<http://numba.pydata.org/numba-doc/latest/user/performance-tips.html>`_ should be explored. | ||
For larger scale restructuring, this should be done in conjunction with the specific restructuring project. | ||
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we adding GPU to this - or is this a separate TEP