Add BLAS thread control and update docstring#36
Merged
Conversation
Collaborator
Author
|
I add an autotune_blas_threads mechanism in lead_property.py, to choosing the best thread automatically. How do you like it? @Lonya0 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request adds an autotuning mechanism for BLAS threads in the self-energy calculation pipeline, improving parallel performance and resource utilization. It introduces a new function to select the optimal number of BLAS threads per worker by benchmarking the real code path, updates the worker and parallel execution logic to use this value, and enhances the configuration options for users. Additionally, the code is refactored for clarity and maintainability.
Performance and Parallelism Improvements:
_autotune_blas_threads, which benchmarks the self-energy computation at several BLAS thread counts and selects the fastest, ensuring efficient use of CPU resources without oversubscription. This is run in the parent process before launching parallel workers.compute_all_self_energyto accept ablas_threadsparameter and to use the autotuned value per worker, ensuring each process is optimally configured for BLAS threading. [1] [2] [3]_self_energy_worker_blas1with_self_energy_worker_blas, which sets the BLAS thread count per worker according to the autotuned or user-specified value.API and Configuration Enhancements:
compute_all_self_energyto support new parameters:ek_batch_size(renamed frombatch_sizefor clarity) andblas_threads(for user override or autotune of BLAS threads per worker).Refactoring and Maintenance:
timeto support benchmarking in autotuning.These changes collectively make parallel self-energy calculations more robust, efficient, and configurable.