-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
Implemented Numba JIT compilation for planck_function() and performan… #2527
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
*beep* *bop* Hi, human. I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently. Please add your name and email to In case you need to map an existing alias, follow this example. |
@andrewfullard @atharva-2001 Kindly review my PR. It is the first Objective of the idea Parallelization and GPU in the list of GSOC ideas here |
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.
Looks like a good start! As a note, it's much better to use njit than the jit decoratpr, or you can do jit(nopython=True), which is functionally equivalent. Using just the jit decorator means that the code will fall back on python if it can't figure out how to compile.
Also, it'd be good to separate the timings from the plots. For this first objective, we're mainly interested in seeing the code timings.
Finally, if you could be a bit more systematic about execution timing, by running each of the bin sizes some number of times and finding the mean and standard deviation of the execution times, that would be really interesting.
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.
Thank you for your feedback! I've made the following adjustments:
- I replaced the jit decorator with njit for Numba compilation, ensuring better performance.
- I separated the timing measurements from the plots, focusing solely on code timings as requested.
- I adopted a more systematic approach to timing by running each bin size multiple times and calculating the mean and standard deviation of the execution times.
Here are the results of the execution times:
Mean and standard deviation of execution times for the original function:
Bin size: 100, Mean time: 0.0006856918334960938, Standard deviation: 0.0003326150415747104
Bin size: 200, Mean time: 0.0007090330123901367, Standard deviation: 0.00037616331345380154
Bin size: 500, Mean time: 0.0006082057952880859, Standard deviation: 0.00011986670416905664
Mean and standard deviation of execution times for the njit-compiled function:
Bin size: 100, Mean time: 6.556510925292969e-05, Standard deviation: 2.453465036165e-05
Bin size: 200, Mean time: 6.003379821777344e-05, Standard deviation: 9.53423944032505e-06
Bin size: 500, Mean time: 6.287097930908203e-05, Standard deviation: 1.4083274673289586e-05
…ce comparison
📝 Description
Type: :| 📝
documentation
This pull request introduces enhancements to the TARDIS project's Jupyter Notebook responsible for creating the initialization page of the documentation. Specifically, the following modifications have been implemented:
Numba JIT Compilation for planck_function(): The planck_function() function, located in code cell 6 of the notebook, has been optimized by implementing Numba JIT compilation.
Performance Benchmarking: A comparison of the execution time between the original planck_function() and the JIT-compiled version has been conducted. This comparison is performed for different numbers of frequency bins (100, 200, and 500), as specified in code cell 7. The goal is to assess the performance improvement achieved through Numba JIT compilation under varying computational workloads.
📌 Resources
Link to the Jupyter Notebook: This is the Jupyter Notebook where the changes were made. here
🚦 Testing
How did you test these changes?
☑️ Checklist
build_docs
label