Skip to content
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

Optimize GEK.jl #474

Closed
wants to merge 1 commit into from
Closed

Optimize GEK.jl #474

wants to merge 1 commit into from

Conversation

Spinachboul
Copy link
Contributor

@Spinachboul Spinachboul commented Feb 25, 2024

  • Changes made in the model *
  1. Matrix Operations Optimization:

    • Utilized LinearAlgebra functions for matrix inversion to improve efficiency.
  2. Loop Optimization:

    • Utilized @inbounds and @simd macros for loop bounds-check elimination and vectorization, respectively, to enhance performance.
  3. Calculations are reused:

    • Moved common calculations outside loops to avoid redundancy and improve efficiency.
  4. Redundant Checks:

    • Moved the check for sample repetition outside the constructor function to eliminate redundant checks and improve readability.
  5. Consolidation of Functions:

    • Removed duplicate _calc_gek_coeffs function and consolidated its logic into a single function to enhance maintainability.
  6. Optimized Constructor:

    • Streamlined the constructor function to improve readability and efficiency.
  7. Added Dimension Checking:

    • Added a _check_dimension function to ensure the input dimension matches the surrogate dimension, improving robustness.

Testing yet to be performed after after appropriate review by the maintainers

@ChrisRackauckas and @sathvikbhagavan

@ChrisRackauckas
Copy link
Member

I'm not sure I see what in these changes would actually improve performance? Can you show a benchmark and a flamegraph?

@Spinachboul
Copy link
Contributor Author

Sure! I'll do that soon

@Spinachboul Spinachboul marked this pull request as draft February 28, 2024 04:31
@Spinachboul
Copy link
Contributor Author

@ChrisRackauckas and @sathvikbhagavan
I have drafted this PR since while benchmarking, I could only find some differences/improvements in terms of time and space
I have attached a pdf describing the differences between my code and the original code.
The sphere benchmarking will be done soon, withing a couple of days!!
Differences table.pdf

@Spinachboul Spinachboul marked this pull request as ready for review April 19, 2024 12:22
@Spinachboul Spinachboul marked this pull request as draft April 19, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants