-
Notifications
You must be signed in to change notification settings - Fork 24
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
Performance Enhancements #151
base: development
Are you sure you want to change the base?
Conversation
…tion and lower overhead
Early testing with VizTracer seems to confirm that mrg32k3a random number generation is taking up a significant portion of processor time. It might be worth looking into further optimization such as JIT compilation or straight up reimplementing it in C/C++/Rust and creating Python bindings for that with PyO3. EDIT: I made quite a few optimizations to the mrg32k3a and opened a PR. Testing shows a 30-40% speed increase which is probably the best we can get without implementing some JIT/reimplementation techniques. At What point do we hit diminishing returns on that? |
…erelease version, updated functions to improve typing consistency
…nding differences)
…dling post_reps and post_norms
…module and helper file
…e name, cleaned up dev_tools
…ion, improved clarity
Current Performance Comparison vs Development% Change in Runtime vs Development (Avg. -27.35%)
Testing Notes
Notes on FIXEDSAN regressionAs can be seen in the commit for the FIXEDSAN-1 refactor, the code was changed from a mess of calculations to a much simpler series of function calls and helper functions. This adds overhead, but in return allows much greater clarity into the code. This greater clarity even allowed for a bug that was present since the code's inception to be easily spotted (see #153). If we ignore this regression, the average difference in speed is -32.21% |
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.
Pull Request Overview
This PR introduces performance enhancements across core experiment functionality, testing scripts, demo files, and developer utilities. Key changes include improved return typing for objectives and constraints, refined multiprocessing pool usage to reduce overhead, and extensive refactoring of testing and demo code using pathlib for cleaner imports and path handling.
Reviewed Changes
Copilot reviewed 208 out of 208 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
pyproject.toml | Reformatted dependency and linting configuration for consistency. |
docs/source/conf.py | Minor formatting adjustment to support Sphinx documentation build. |
dev_tools/run_experiment.py | Added a new CLI experiment runner with improved compatibility checks. |
dev_tools/profiling/create_profiles.py | Removed legacy profiling script, likely replaced by run_experiment.py. |
dev_tools/generate_experiment_results.py | Refactored test generation using pathlib and streamlined file handling. |
demo/* | Updated import paths and object instantiation for clarity and robustness. |
Comments suppressed due to low confidence (1)
demo/demo_problem.py:100
- [nitpick] Consider adding an informative message to this assert statement (e.g., 'stoch_constraints should not be None') to clarify the failure condition.
assert mysolution.stoch_constraints is not None
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.
Pull Request Overview
This pull request introduces performance enhancements, refactors several modules for clarity and efficiency, and updates various demo and testing scripts. Key changes include:
- Updates to dependency and linting configurations in pyproject.toml.
- Reworking of experimental and testing scripts (run_experiment, generate_experiment_results) to improve runtime performance and maintainability.
- Migration of demo files from os.path to pathlib for improved readability and consistency.
Reviewed Changes
Copilot reviewed 208 out of 208 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
pyproject.toml | Reformatted dependencies and updated linting configuration. |
docs/source/conf.py | Minor formatting adjustment for Sphinx configuration. |
dev_tools/testing/init.py | Removed docstring; init file now empty. |
dev_tools/run_experiment.py | New script to run experiments with multiprocessing improvements. |
dev_tools/profiling/create_profiles.py | Removed outdated profiling code. |
dev_tools/generate_experiment_results.py | Refactored test generation using pathlib and simplified compatibility checks. |
demo/* (multiple demo files) | Updated import paths using pathlib; small code adjustments and minor fixes. |
all the refactoring is done and the I've implemented fixes for the two issues I discovered during the rewrites, so I think we're good to review and merge |
SimOpt Core
factor_settings_filename
not being an optional argument for aDataFarmingExperiment
map_async
toimap_unordered
to reduce busy waiting and overall memory usageProblems/Models/Solvers
replicate()
function and every Solver'ssolve()
function to reduce unnecessary calculations, optimize the remaining calculations, and improve the general clarity of the code (see comment below for performance changes)mean_price
Value #154Testing
Dev Utils
create_profiles.py
intorun_experiment.py
to allow for easier runtime analysis with tools like VizTracerDemo Files
Project Settings
known-first-party
list to ensure import consistency regardless of mrg32k3a import method