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

[inferno-ml] Save evaluation info #121

Merged
merged 7 commits into from
May 22, 2024
Merged

[inferno-ml] Save evaluation info #121

merged 7 commits into from
May 22, 2024

Conversation

ngua
Copy link
Contributor

@ngua ngua commented May 22, 2024

Adds support for getting total elapsed time, CPU time, and memory allocations every time an inference param is run in inferno-ml-server

Originally I thought we could use EKG for this, but then we would need to keep inferno-ml-server on to get the evaluation info. Given our constraints elsewhere, we should avoid this. So I've continued my quest to Use Postgres For Everything™ and stored it in the DB

-- unlikely but should be accounted for at any rate
setAllocationCounter maxBound
start <- getCurrentTime
bytes0 <- getAllocationCounter
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative to this would be to get one of the memory-related fields from GHC.Stats.RTSStats and compare it. But I noticed this was very unreliable unless a GC was triggered before and after -- sometimes the difference between beginning/ending max memory in use was negative. Of course we could trigger a GC before and after eval, but that can cause performance to degrade. So I think getting allocated bytes is sufficient

Copy link
Contributor

@mirko-plowtech mirko-plowtech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ngua ngua merged commit 98f8344 into main May 22, 2024
1 check passed
@ngua ngua deleted the rory-imls-eval-info branch May 22, 2024 10:37
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