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

Improve performance of the non-parametric liquefaction models #9375

Merged
merged 6 commits into from
Jan 24, 2024

Conversation

raoanirudh
Copy link
Member

@raoanirudh raoanirudh commented Jan 23, 2024

Two updates to help with the performance of ML liquefaction models:

  1. Read the .onnx ML model file only once per calculation. Previously it was being read each time the results were computed - resulting in 3,000 file reads for a scenario calculation involving 1,000 realizations × 3 GMMs, or hundreds of thousands of file reads for event based calculations.
  2. Generate a single ONNX Runtime Inference Session, and make it possible to pass the session as an argument to the liquefaction compute method.

Resolves #9351. Order of magnitude improvement in the runtime for job_todorovic.ini in scenario.zip.

Two updates help with the performance of ML models:
1. Read the .onnx ML model file only once per calculation. Previously it was being read each time the results were computed - resulting in 3,000 file reads for a scenario calculation involving 1,000 realizations × 3 GMMs, or hundreds of thousands of file reads for event based calculations.
2. Generate a single ONNX Runtime Inference Session, and make it possible to pass the session as an argument to the liquefaction compute method.
@raoanirudh raoanirudh marked this pull request as draft January 23, 2024 13:46
@raoanirudh raoanirudh marked this pull request as ready for review January 23, 2024 18:30
@micheles micheles added this to the Engine 3.19.0 milestone Jan 24, 2024
@micheles
Copy link
Contributor

Looks very good to me, you are using the .prepare method as it was meant to be. Please remembet to update the changelog!

@raoanirudh raoanirudh merged commit af08e99 into master Jan 24, 2024
6 checks passed
@micheles micheles deleted the liquefaction-performance branch January 24, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parallelization in liquefaction analysis
2 participants