[{roc,hip}fft] Revisions to accounting of system memory usage and its limit-enforcing logic#5590
Draft
[{roc,hip}fft] Revisions to accounting of system memory usage and its limit-enforcing logic#5590
Conversation
2a1f352 to
0ee0292
Compare
… limit-enforcing logic
0ee0292 to
0016bdb
Compare
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.
Motivation
In presence of integrated devices, "host" and "device" allocations actually share the same physical memory, yet only the former are actually monitored and accounted for. This makes the own accounting of system memory usage by
rocfft-testand/orhipfft-testunreliable on platforms with integrated devices. Additionally, the arbitrarily-defined chunk of the system's total memory that is "dedicated for device allocations" is misleading becauseThis possibly results in larger-than-acceptable amounts of system memory made available for "host" allocations at some point in the application's lifetime, with possible exhaustion of system memory used in test runs.
Technical Details
The singleton
host_memorystructure is renamedsystem_memoryandconst-ness of the system's total memory throughout an application's lifetime;used_bytesmember intending to monitor the overall usage of system memory, either by "host" allocations or by "device" allocations on integrated devices;get_usable_bytes()member function is revised to guarantee that the returned value is consistent with the limits to be enforced at any point (i.e., accounting for the memory already being used at the time of the query) and the observed free memory.The template classes
gpubuf_tandhostbuf_tare modified to leverage the above changes. The accounting that has been specific to (specializations of) thehostbuf_tclass is replaced by the singletonsystem_memorystructure's accounting.Test Plan
Current tests suffice, test results on platforms with integrated devices being of particular relevance.
Test Result
Tests pass.
Submission Checklist