Commit Graph

124 Commits

Author SHA1 Message Date
Patel, Jaydeepkumar 7b6e59cbea SWDEV-530803 - User current device id while cloning graph node. (#313)
[ROCm/clr commit: 32eb6a5d89]
2025-05-15 09:06:15 +05:30
Godavarthy Surya, Anusha e4a499f22e SWDEV-522841 - Graph nodes must be created/launched on device where they are captured/created (#108)
[ROCm/clr commit: 2538d7f02b]
2025-04-29 22:20:39 +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
Saleel Kudchadker c8f39ec2b0 SWDEV-502365 - Track last used command
- This change tries to save extra synchronization packets we may insert
  as we didnt track the completion signals for every command. We track
the current enqueued command until it exits the enqueue stage. We also
record the exit scope to know if we flushed the caches
- Handle correct release scopes and store completion signal as HW events
- Use a new finishCommand implementation to only wait for the command
  passed as the argument

Change-Id: Ie4350c5dd24f5d48dfa6ccbabd892f0544caadcc


[ROCm/clr commit: e03e4f3b5d]
2025-03-04 16:05:02 -05:00
Ioannis Assiouras eb825325d2 SWDEV-516994 - Fix race condition in the implementation of graph AutoFreeOnLaunch on Windows
Change-Id: I3c98d0d4bffe2a9e0aa5cfa24b6c8e9a8087da29


[ROCm/clr commit: a8f309049d]
2025-02-26 02:36:31 -05:00
Anusha GodavarthySurya 5535f15104 SWDEV-469422 - hipGraph move to classes from structs
Change-Id: I0f9c8ef1161c0c92ebe0cce6844b2feacfee83f5


[ROCm/clr commit: 32e5b00c30]
2025-02-05 00:33:41 -05:00
Anusha GodavarthySurya 837f7ca08c SWDEV-489084 - Avoid creating internal stream when graph has single branch
Change-Id: I9371d44481257069bb51c0217a57f97d803589c4


[ROCm/clr commit: b385992f94]
2025-01-31 00:16:57 -05:00
Ioannis Assiouras 8169855390 SWDEV-510319 - Fixed random segfaults in graph tests
This change fixes random segfaults in graph tests that
are seen after the change make internal callbacks non-blocking.
The callback thread that decreases the GraphExec ref count
may now run after the runtime shutdown. This can cause a segfault
because the hip::device that is accessed in GraphExec destructor
is already destroyed during runtime shutdown. This patch ensures
that the hip::device object  stays alive until after the
callback thread completes.

Change-Id: I75a6ac01f27a0b2250bbd10ed389ebfb322927af


[ROCm/clr commit: 21c223f8df]
2025-01-25 09:54:15 -05:00
Marko Arandjelovic cf8eeabfe2 SWDEV-489619 - Fix memcpy tests with capture stream enabled
- Added missing validation as graph node should not be created
 if parameters are invalid
 - Fix conversion of input params to graphNode params

Change-Id: I37ab04942b5fb2eb07386850cb7dbbf26f9ca967


[ROCm/clr commit: db8527f655]
2025-01-16 10:31:04 -05:00
Anusha GodavarthySurya 08c92f4793 SWDEV-480209 - Make internal callbacks non-blocking
Change-Id: Ic918d08f341abfd9a7c167d09f9c723cdc43157f


[ROCm/clr commit: 683a942364]
2025-01-10 02:16:11 -05:00
Anusha GodavarthySurya 4288640f69 SWDEV-469422 - Derive GraphExec from Graph and ChildGraphNode from GraphExec
Change-Id: I54d67a1665355579bc249d8ff4f9806e9ee14588


[ROCm/clr commit: 13e2e797c0]
2024-12-16 00:43:57 -05:00
Anusha GodavarthySurya acfcd1098f SWDEV-469422 - Refacor childgraph node
Remove static functions in graph

Change-Id: I4df94915f81f250acaea60398aea32ef0ed658e2


[ROCm/clr commit: 28cbf2bc4f]
2024-12-12 12:38:24 -05:00
Branislav Brzak 92b1136755 SWDEV-490860 - Do signal_is_required detection post graph schedule
Change-Id: Iaf1067a811aeac3d16c08de954036e219b545e07


[ROCm/clr commit: 89dfdc4dbe]
2024-12-09 03:57:44 -05:00
Anusha GodavarthySurya a3c4a5a19c SWDEV-469422 - Cleanup graph code remove parallellists and nodewaitlists
Change-Id: I00c7b2894333bd13d47b913d3fcdd6e1ffcb741f


[ROCm/clr commit: c47f9dda58]
2024-11-30 04:40:51 -05:00
Anusha GodavarthySurya ac927dd94e SWDEV-489084 - Update max streams for graph
Change-Id: I6d0992b2e80ebf3184911593a4f3574327b2e9c3


[ROCm/clr commit: fb7ad8361c]
2024-11-29 08:16:16 -05:00
Anusha GodavarthySurya c34f55babb SWDEV-489084 - Avoid using queue colliding with the graph launch stream
Change-Id: I3ecaf8836c8e0883441275139041c702aba0937e


[ROCm/clr commit: 06e6561eb5]
2024-11-29 08:15:58 -05:00
Jaydeep Patel 0bbf2d5244 SWDEV-498077 - Check topoOrder_ before accessing it.
Change-Id: I10e3c24ca8dc1009b8ac8ac27b3e9a6296f9a7ee


[ROCm/clr commit: d997f78be4]
2024-11-19 04:50:47 -05:00
Jaydeep Patel 89b9d22e6c SWDEV-496544 - Reset mem alloc node count for AutoFreeOnLaunch.
Change-Id: Ib32b04584548a46632606ecd85b58c6ce4a5894d


[ROCm/clr commit: 24c57cb984]
2024-11-11 11:03:32 +00:00
Rahul Manocha 5b40eefdac SWDEV-490864 - Optimize Alloc Node detection in graph
Change-Id: I6ac32f9abd0b44864071a0a9396463cb13f6941f


[ROCm/clr commit: 314d4a2c22]
2024-11-01 11:45:49 -04:00
Anusha GodavarthySurya 1a472b9703 SWDEV-480209 - Handle GraphExec object release
=> GraphExec instance is destroyed before async launch completes,
destroy after all pending graph launches
=> Remove GraphExec destroy during next sync point(hipStreamSync,
hipDeviceSync etc..)

Change-Id: I4df682aae5787fd6e5240a7be936ce50361345d0


[ROCm/clr commit: f9f995c6d0]
2024-10-22 12:30:46 -04:00
Jaydeep Patel b31bf885a3 SWDEV-482692, SWDEV-485802, SWDEV-485489 - Handle refcounts owned by graph for user objects.
Change-Id: Ic739ab1ec5d3dc3143e3ae70f9591922bc0e3d9f


[ROCm/clr commit: e74ac6f580]
2024-10-08 03:44:44 -04:00
kjayapra-amd f19260d568 SWDEV-480772 - Remove name variable from amd::Monitor class.
Change-Id: Ie2a4fa44f485786227230f8a892e090e718aa30e


[ROCm/clr commit: 12a39fbf22]
2024-09-19 11:55:01 -04:00
Rahul Manocha c4cab41cc2 SWDEV-479575 - Add marker to parent graph dependencies in childgraph node
1) Child Graph nodes need to have parent graph dependencies in waitlist.
2) Marker is placed on base stream with parent graph waitlist

Change-Id: Iec65a0171ea387be05b0733abcc708fb630e4be4


[ROCm/clr commit: 4d1ded9eaf]
2024-09-18 15:12:50 -04:00
Rahul Manocha b25fd0dc81 SWDEV-479575 - Graph clone root size check
Change-Id: I34dd43ea36ce1e2623198e6ce1179318b9f7e277


[ROCm/clr commit: dbf00966b9]
2024-09-04 11:54:15 -04:00
Ioannis Assiouras b5acdd6fdc SWDEV-470612 - Added fixes in optimized multistream path for graph execution
This change adds fixes in optimized multistream path for childGraph uses cases.

1) For childgraph nodes, rely on runNodes() only to process
   the childgraph and skip calls to createCommand and enqueueCommands.
   This ensures that the start/end markers are enqueued correctly
   with respect to the childGraph commands.
   In addition, the runNodes() for the childgraph should be called after
   the dependency walkthrough to make sure that the subgraph is executed once.

2) Nodes with no outgoing edges should be marked
   as a leafs regardless of which stream they are assigned to.
   This is to ensure that marker dependencies from nodes
   that run on non-zero stream to subgraph leafs that run on zero stream
   are still set up correctly.

Change-Id: I4a5f4f3b0e0d01e515cdcb045b46c2798f291255


[ROCm/clr commit: 464b99373b]
2024-08-21 10:11:24 -04:00
Jaydeep Patel c1f83df84c SWDEV-474937 - Fix race condition between main and work thread on windows.
Change-Id: I4d6b9de41d0e5a39094eb3babe47dffde72e0587


[ROCm/clr commit: 912de7ab44]
2024-08-07 14:29:14 -04:00
Jaydeep Patel 12eea11370 SWDEV-457316 - Release graph exec before stream gets deleted.
Releasing graph exec after wait completes and before delete hip::stream obj
during stream destroy.

Change-Id: I1d68aa8d844f7d3af330c6d09c44af07f8553551


[ROCm/clr commit: 8e80429b87]
2024-08-06 00:39:37 -04:00
Jaydeep Patel 2aafd5a30c SWDEV-457316 - Multiple graph exec can be for given stream.
Change-Id: I0f1b184eb63e0432119d62f094637d375a3d4e55


[ROCm/clr commit: d954eb64db]
2024-08-06 00:31:04 -04:00
German Andryeyev 35c7a87014 SWDEV-470612 - Add the optimized multistream path
- Added the optimized multi stream path in graph execution. It uses a fixed number of async streams in the execution
- Optimize the launch latency, where commands
creation and execution is done at the same time
- Optimize the scheduling to use less barriers and waiting signals if
the same queue  can be detected
- The new path is controlled by  DEBUG_HIP_FORCE_GRAPH_QUEUES
environment variable, where 0 will use the original path and any other
value will force the number of asynchronous queues for execution
- DEBUG_HIP_FORCE_ASYNC_QUEUE can force single queue async
execution in graphs(applicable for Navi families only)

Change-Id: I7eb40bc15c45f508d6911868a6f6d4c3598d380e


[ROCm/clr commit: 9db52f9a46]
2024-08-02 14:19:44 -04:00
Anusha GodavarthySurya 31927fefd6 SWDEV-468424 - Add support to capture multiple AQL Packets
=> Added support to capture multiple AQL Packets.
=> Added Interface to callback to hip runtime from rocclr to allocate
kernel args from the graph kernel arg pool.
=> Enabled Support to capture memset node.

Change-Id: I7e1c2ba06927459e024653058af142bd82192c43


[ROCm/clr commit: bd3a35bde1]
2024-08-01 23:55:51 -04:00
Ioannis Assiouras 19d16561a4 SWDEV-472309 - Ensure static maps are destroyed after __hipUnregisterFatBinary
hipDeviceSynchronize called from __hipUnregisterFatBinary
accesses static maps and monitors. This change ensures these ojects
are not destroyed before __hipUnregisterFatBinary  is called.
Additionally it disables the teardown process for static build.

Change-Id: I46b58641d60efcf6637a8e99cdd786ffe9e2c77d


[ROCm/clr commit: 9b33db9b24]
2024-07-30 10:26:59 -04:00
Saleel Kudchadker abfe135e4f SWDEV-475341 - Fix stream resolution for graphs launches
This issue was happening because of incorrect usage of getStream call,
if we get the null stream first and then typecast it, and call on
getStream again, we lose the advantage of simply passing "nullptr" to
indicate NULL stream. Thus we enter the waitActiveStream call and add
barriers to sync across streams.

Change-Id: I94dc4e3ec927295b9e1ab6dee4b37d7d3e00b0cc


[ROCm/clr commit: cda4b7db1c]
2024-07-25 19:38:23 -04:00
Anusha GodavarthySurya 7985a72073 SWDEV-468424 - hipgraph capture memset node
Capture AQL packets during GraphInstantiation and enqueue AQL packets during graph launch.

Added support to capture single graph memset node.
Capture support for memset node is currently disabled.
Memset capture will be enabled when capture for multiple packets are supported..

Change-Id: I14dfbc41731025cc3a548a730558915def3fa384


[ROCm/clr commit: 346da4bb40]
2024-07-19 23:52:50 -04:00
Anusha GodavarthySurya b6d82323e9 SWDEV-468424 - Refactor kernel arg
For refactoring of childGraph to have its own graphExec,
kernelArgs needs to be separated from the graphExec object.
All the childNodes part of graph should share same kernelArg pool.
Otherwise we endup creating multiple device kernel arg memory chucks
for single graphExec.

Change-Id: I4029a46ebc1fa112d87df64ab1fecbf288fabe5e


[ROCm/clr commit: 35079e834e]
2024-07-16 08:38:44 -04:00
Ioannis Assiouras 376da06e2f SWDEV-469825 - Modified the kernel argument readback to use a pointer to volatile
This change modifies the readback mechanism to use a pointer to volatile
instead of a volatile pointer. This ensures that the compiler does not
optimize away the read operation.

Change-Id: I79ff925d615aa8cc4f950e8ff4b7e608fcb179a4


[ROCm/clr commit: ea50d2c0c2]
2024-07-09 17:28:47 -04:00
Saleel Kudchadker 17a46aa40b SWDEV-465602 - Refactor kernel arg pool allocation for graphs
- Allocate additional argument space to accomodate for kernel node
param updates

Change-Id: I2d4ea8bddd716f1191f3cbea807920d0248f8c4e


[ROCm/clr commit: 17313ec99d]
2024-06-25 18:28:03 -04:00
Anusha GodavarthySurya 291f079669 SWDEV-467102 - Hidden heap init for graph capture
If the graph has kernels that does device side allocation,  during packet capture, heap is
allocated because heap pointer has to be added to the AQL packet, and initialized during
graph launch.

Handle race with wait when 2 kernels with device heap are enqueued on multiple streams.

Change-Id: I45933b77fcaf7bc8fdf1bc906462e32b5d8d3688


[ROCm/clr commit: 57156c524d]
2024-06-17 02:07:25 -04:00
Ioannis Assiouras dfe46a3093 SWDEV-467069 - Added safety check in activity prof for accumulate command
Adding a safety check prevents an invalid memory access
if timestamps and kernelNames vectors are of different size.

The patch also moves the addKernelNames for the accumulate command
into dispatchAqlPacket function.

Change-Id: Iea0927e1253800403a1ae3f3d72de1e7d96476c3


[ROCm/clr commit: d44f44a5b1]
2024-06-12 21:53:03 +01:00
Ioannis Assiouras af089a2171 SWDEV-463865 - namespace changes to prevent symbol conflicts in static builds
Change-Id: I09ceb5962b7aa19156909f47167c87d6887c9cd1


[ROCm/clr commit: 3edf1501cc]
2024-06-12 16:22:27 -04:00
Anusha GodavarthySurya 44ef705022 SWDEV-461072 - Add reference to function parameter
Change-Id: I9ad5dafc6d697d12fbd1675f19f88f83ad2d7b9c


[ROCm/clr commit: 3a5cbb91b9]
2024-06-12 01:20:28 -04:00
Ioannis Assiouras efba3545ca SWDEV-466601 - Fix invalid mem acccess in kernarg readback path
Change-Id: I4654ae592adc8cf9c687136d45eb1b28d99c7ae1


[ROCm/clr commit: 055e05a12a]
2024-06-10 15:13:05 +01:00
Anusha GodavarthySurya 3b85ba70df SWDEV-461072 - Extend AQL Optimization for child graph nodes
Change-Id: I6baf906add7240b29ea653020a9a0b56206ee2a7


[ROCm/clr commit: 243dad92c9]
2024-05-28 06:31:10 +00:00
Saleel Kudchadker 2969f2476b SWDEV-301667 - Better log
- Print kernelname for graph launches, its hard to correlate packets
otherwise
- Print correlation_id if any

Change-Id: Ib8db7a00e4e7c98f570e71029e61d86f5dccc2ed


[ROCm/clr commit: 72d23a02c5]
2024-05-28 06:31:10 +00:00
Saleel Kudchadker efc2de44f0 SWDEV-451594 - Fix HDP reg readback
Change-Id: I478a968330f85c3b60ff39fb40bf3cd91acd610e


[ROCm/clr commit: 1ba74c3ce3]
2024-05-28 06:31:10 +00:00
Saleel Kudchadker 0b3e421451 SWDEV-301667 - Refactor graph code
- Remove Last graph node optimization and instead submit a barrier NOP
packet always. This simplifies the code.

Change-Id: Ied443173ba47a08b6df148ac7e3ead712acda11c


[ROCm/clr commit: badf2b0880]
2024-05-28 06:28:17 +00:00
Anusha GodavarthySurya 085703c225 SWDEV-460770 - Handle Graph Exec release
Handle GraphExec instance is destroyed before async launch completes
GraphExec instance is destroyed after async launch completes
GraphExec instance is destroyed without a launch

Change-Id: I45a7c82295fea916c7559bd8f796df710513aea1


[ROCm/clr commit: bf4d10ff61]
2024-05-28 06:28:17 +00:00
Ioannis Assiouras a21913a0bd SWDEV-451594 - Change device kernel args to use HDP flush by default
The Readback and Avoid HDP Flush memory ordering workaround is
used as a fallback solution only when HDP flush register is invalid

Change-Id: Ic284eba1f95ed22b0270d3abeb904fb902015b1a


[ROCm/clr commit: 6cb7b6ec6b]
2024-05-02 19:35:13 +00:00
Ioannis Assiouras 2f430138c5 SWDEV-451594 - Implement Readback and Avoid HDP Flush workaround for device kernel args
Change-Id: I6d41a089a17f55306e7ff402588a1e831b20a7a7


[ROCm/clr commit: bf74ef4025]
2024-04-19 09:29:20 -04:00
Ioannis Assiouras b46d3c0f8d SWDEV-451166 - Disable kernel args for non-XGMI if HDP flush register is invalid
Change-Id: I227e046e2b9cb25476a50240f5d070adbd558f21


[ROCm/clr commit: 96f5c44851]
2024-03-15 05:27:52 -04:00
Anusha GodavarthySurya f1e5162757 SWDEV-447545 - Fix Enable/Disable node with hipGraph
Node can be enabled/disabled only for kernel, memcpy and memset nodes.
If the node is disabled it becomes empty node.
To maintain ordering just enqueue marker with respective node dependencies.

Change-Id: I710f3e88ab4e76c81f6f86a40a7dc61fd4c7e440


[ROCm/clr commit: e0e63eb04d]
2024-02-28 17:34:03 -05:00