Commit Graph

36 Commits

Author SHA1 Message Date
Danylo Lytovchenko 2ff2316227 Adjust clang format to the new versions, revert broken macro layout (#714) 2025-08-22 17:23:22 +02:00
Danylo Lytovchenko f7338717ae SWDEV-470698 - fix formatting, add format check workflow (#657) 2025-08-20 19:58:06 +05:30
Godavarthy Surya, Anusha ff69bcc903 SWDEV-469422 - Avoid using of hipStream_t in internal methods (#69)
Change-Id: Ifd5362f371c846a88241927383cb95cf046548ef

[ROCm/clr commit: fb92683d86]
2025-04-28 15:09:11 +05:30
Andryeyev, German 4c9cc6ba30 SWDEV-497841 - Add VmHeapArray support (#76)
Add VmHeapArray class to reduce the pressure on VA reservation, since
multiple memory pools can be active at the same time.

[ROCm/clr commit: e974f7fde1]
2025-04-03 21:04:18 +05:30
Godavarthy Surya, Anusha 35a15ca3b2 Revert "SWDEV-492049 - Remove the handle of Phy Mem from Memobj" (#72)
This reverts commit dabe311bd8.

[ROCm/clr commit: 2259a8c01c]
2025-03-19 21:16:51 +05:30
German Andryeyev f9d9b2c441 SWDEV-497841 - Add virtual memory heap
Add initial implementation of virtual memory heap with
dynamic virtual memory mapping support for memory pools.
DEBUG_HIP_MEM_POOL_VMHEAP controls the new method.

Change-Id: I8dc5be2e0f34ab472f1800f43bb6243639a5e500


[ROCm/clr commit: 296dce5570]
2025-02-20 10:55:49 -05:00
Ioannis Assiouras a349b23474 SWDEV-514686 - Fixed hipEventSynchronize/hipStreamWaitEvent for IPC events
Resolved an issue where hipEventSynchronize and hipStreamWaitEvent APIs
did not function correctly for events created with the hipEventInterprocess flag.
The bug caused the event to be incorrectly marked as "recorded,"
leading to these APIs failing to wait for the event as expected.

Change-Id: Ic9fdfaab2393beb93d6e0b83661545e902a63499


[ROCm/clr commit: 1cdfbfd270]
2025-02-11 18:43:06 -05:00
Ioannis Assiouras 161d590405 SWDEV-503760 - Only consider allocations that are less than X% larger in a mempool request
Change-Id: I94acbca606fd4c575e2e1a9e34959ce650571867


[ROCm/clr commit: 44b6b6813d]
2025-01-13 16:57:26 -05:00
Saleel Kudchadker 6a416008aa SWDEV-508004 - Improve hipEventRecord
- Resolve stream once for event record. We should avoid calling
  getStream again in addMarker

Change-Id: I78448c4f151ae10a5c8e8c248b2f4078b84191cb


[ROCm/clr commit: a22c45d635]
2025-01-09 16:47:46 -05:00
Shane Xiao dabe311bd8 SWDEV-492049 - Remove the handle of Phy Mem from Memobj
The hipGraph will use VMM by default when allocating memory.
However, the handle of Phy mem has been added to Memobj by default.
Since the Memobj will track the whole address range from handle to
handle + size, this needs the system to reserve the whole address
range. If the system range have not reserved by the system, then it
will have the potential issue that clr finds the Memobj incorrectly.

This patch removes the handle from the Memobj to fix this potential
issue.

Change-Id: I2da38e6b2d11d0d48e1afe66c46899500c290624


[ROCm/clr commit: 231b2410a0]
2024-12-04 19:39:52 -05:00
Branislav Brzak 491d3828dd SWDEV-482130 - Fix release of virtual mem obj
Change-Id: I893a8353aa1a25d00e36c8e601caf31cc0fc1f22


[ROCm/clr commit: 43fcac1739]
2024-10-08 01:37:39 -04:00
Satyanvesh Dittakavi b758610a55 SWDEV-478708 - Remove forced wait of 10us in hipEventQuery
Change-Id: I868aae14311c3cdfc09aa03252ac324c4b79b864


[ROCm/clr commit: ade1954015]
2024-10-01 06:27:42 -04:00
German Andryeyev b1c0f73229 SWDEV-353281 - Corret VA unmap
Make sure graph mempool unmaps VA on release

Change-Id: Id3f1bd8d0115b533ae60aa5ba3676b8bf7e5b961


[ROCm/clr commit: 5c1804aa14]
2024-04-26 09:37:01 -04:00
German Andryeyev 00fb29aab6 SWDEV-353281 - Reuse timestamp on memory reuse
Mempool may reuse memory without a wait. Hence, the timestamp has
to be preserved and can't be destroyed.

Change-Id: I6f095f44afa69887a4b7aeb3b329804aedd96f3e


[ROCm/clr commit: ffb516db3e]
2024-04-19 18:00:29 -04:00
German Andryeyev e46ab0bff5 SWDEV-353281 - Change pool type for graphs
Under ROCr physical allocations don't have initial VA and require extra
flag in ROCclr. Add an option to have a mempool of physical allocations.

Change-Id: I4d062fe0dd8113d4eaf6e8b51749ed56d8701d1e


[ROCm/clr commit: f296159f62]
2024-03-25 10:21:05 -04:00
Jaydeep Patel 844765d7e0 SWDEV-447525 - maxSize param for Mem pool props.
Change-Id: Ib743611a66921aeaa449b6622b933cc8b9190d87


[ROCm/clr commit: b72d8da1bd]
2024-03-13 00:58:48 -04:00
kjayapra-amd 8947420e41 SWDEV-423835 - Fixing kernel launch issues on Virtual Memory Management path.
Change-Id: I9f5e8a3d83af3809b2c50b21a10697e26113dd23


[ROCm/clr commit: f5ca620baa]
2024-03-12 17:22:07 -04:00
German Andryeyev c9bace9b71 SWDEV-311271 - Fix Windows mempool management
Windows path still uses multi threading implementation. Hence, in graphs
all nodes are executed in a queue thread and that requires to manage
mempool in the queue thread. However, the spec allows to destory memory,
allocated in a graph, outside of the graph's execution. That may cause
mempool management to go out of sync.

Change-Id: I0ffb2244b3cb720455ed44d1b3e2487fa8959a77


[ROCm/clr commit: 4f6b0da028]
2024-02-13 17:16:06 -05:00
Ioannis Assiouras fb39e68de7 SWDEV-445221 - Fix the memory reported for hipMemPoolAttrReservedMemHigh
Change-Id: I894a836643612c73feb322f29a9236ada4d8cbda


[ROCm/clr commit: 5e6ad190ff]
2024-02-08 23:40:51 +00:00
German Andryeyev 7e7e4b93ee SWDEV-311271 - Add extra logic to reduce memory usage
Add logic to prevent significant grow of reserved memory in mempool.

Change-Id: If034433c26e904e3037200a593ef338896d7f16d


[ROCm/clr commit: cd59d971f0]
2024-02-05 05:08:11 +00:00
German Andryeyev b8e7a858a5 SWDEV-311271 - Switch to sorted map for pool allocations
Sorted map can work much faster for many allocations and a low reuse frequency

Change-Id: I6dba29ebc8bfacdf34307149b6a2b194890b2932


[ROCm/clr commit: a1fffac595]
2024-01-03 17:36:05 -05:00
German Andryeyev 3a4261966c SWDEV-311271 - Release freed memory from MemPools
Runtime has to release extra memory, held by the pools,
in synchronization points for event, stream or device.

Change-Id: Id533a5e1d137812aa72bdfe101b4b333c6a43d66


[ROCm/clr commit: 3fa4e31180]
2023-12-19 13:47:04 -05:00
Saleel Kudchadker f969d89aa4 SWDEV-301667 - Logging refactor
- Remove newline from logging as log function internally inserts a new
line

Change-Id: I25eb2242a1f1e87cf811bcc373d1d485b2e027a8


[ROCm/clr commit: 058b2702db]
2023-12-07 12:12:57 -05:00
Ioannis Assiouras 1868de1f7d SWDEV-436236 - Fixed integer division to float result in Heap::FindMemory
Change-Id: Ic72cfdbe1f62fabd3e25d33bfa540d82a02480d0


[ROCm/clr commit: 2ede1c9adb]
2023-12-06 12:41:00 -05:00
Ioannis Assiouras 4593cb2ef8 SWDEV-433069 - Fixed hip mempool impl SetAttribute switch-case
Change-Id: I0b1b8414db09051125dae4ea98f70827f10c4b98


[ROCm/clr commit: 3e6b4a528d]
2023-11-17 17:51:39 -05:00
Ioannis Assiouras 9d1a39bba2 SWDEV-430116 - Fix segfault in Heap::EraseAllocaton
Change-Id: I8c49af081079307118562485cb0d5b3e8a9d906a


[ROCm/clr commit: bc2a4f8450]
2023-11-07 09:49:35 -05:00
German af5944dc71 SWDEV-311270 - Add IPC support for memory pools
Initial implementation for hipMemPoolExportToShareableHandle,
hipMemPoolImportFromShareableHandle,
hipMemPoolExportPointer and hipMemPoolImportPointer

Change-Id: I0ebdc48e9163b394ded560adca6c38bbc5aee7d1


[ROCm/clr commit: 1a0c3e4dc4]
2023-06-15 11:36:52 -04:00
German 8d97827417 SWDEV-353281 - VM support in mempool for graphs
The change enables VM support in graphs on Windows. That allows
to avoid caching of all allocations at the cost of map/unmap
overhead during memory create/destroy.

Change-Id: I792be00fba099e5e5d3cd44a963e1dfd6976a86d


[ROCm/clr commit: 04b696abee]
2023-05-05 15:31:26 -04:00
Jaydeep Patel c6da0aa014 SWDEV-377804 - Initial commit to support hipGraphInstantiateFlagAutoFreeOnLaunch
Change-Id: I7a35becb6c98a6ff70264e141317d98be7457a37


[ROCm/clr commit: f9e27bcdd4]
2023-02-01 11:51:39 -05:00
German Andryeyev 9c811dc241 SWDEV-353281 - Initial support of memalloc in graph
Add memory allocation support in graph. Current implementation uses
cache from mempool  to hold the allocations which belong to the graph.
Also the resource tracking is disabled at this moment because mempool
operates with hip::Stream objects, but graph has execution with
amd::HostQueue objects.

Change-Id: I54fe3250126d24f5a26ada975f37d429bb4ef17b


[ROCm/clr commit: eef47ca24a]
2023-01-13 13:06:59 -05:00
pghafari b0bc6d6c7e SWDEV-356549 - del Null strm in destroyAllStreams
Change-Id: Ie04172ee39e6333247d07791dffda753a8b9ef41


[ROCm/clr commit: a643c199de]
2022-12-29 15:45:54 -05:00
Sarbojit Sarkar 4af3dec930 SWDEV-344210 - Fixed page fault when mempool accessed from remote device
Change-Id: I759296a3177560719759f7dd8766e07664285689


[ROCm/clr commit: db35b25d3f]
2022-08-11 00:02:29 -04:00
Sourabh Betigeri 325aca33ad SWDEV-342067 - Fixes a minor coding error to loop through all the entries in the map
Change-Id: I837cb4868de2acd3e71ca9a745a62ed0bb2d1400


[ROCm/clr commit: 5ad38a32bf]
2022-06-20 19:20:38 -04:00
German Andryeyev a7d73a753d SWDEV-311271 - Enable MGPU support for memory pool
Change-Id: I36850de282d62139b5cfe342df97bb1204cb7869


[ROCm/clr commit: 8b132beb92]
2022-05-11 11:04:24 -04:00
German Andryeyev 3de1a9e36c SWDEV-311271 - Make sure memory pool can accept default stream
Add lock protection for access to the pool list.
Remove destroyed stream from the list of the safe streams

Change-Id: I1863b89bd3f5e188c161227cc790c3adaf72cc58


[ROCm/clr commit: 5957ff9f7b]
2022-04-18 10:34:21 -04:00
German Andryeyev e7d2493402 SWDEV-311271 - Initial mempool implementation
HIP_MEM_POOL_SUPPORT controls memory pool support in runtime.
Currently it's disabled by default. The initial change doesn't
include: IPC, MGPU, virtual memory alloc, suballoc, defragmentation,
internal dependencies.

Change-Id: Ibed8528ebec698b045ebb247e49c0ecd6e587ed7


[ROCm/clr commit: 539d264eb0]
2022-03-31 09:21:37 -04:00