Commit Graph

63 Commits

Author SHA1 Message Date
Saleel Kudchadker 6c304e4027 SWDEV-276120 - Remove support for barrier sync
ROC_BARRIER_SYNC will not work with direct dispatch.
Remove and cleanup.

Change-Id: I81368b2e65039477bd0343bb92708dab48867db6


[ROCm/clr commit: aa38af8c96]
2021-04-07 17:08:39 -04:00
German Andryeyev 77c260410a SWDEV-279288 - Move the batch condition
The check has to be performed inside the signal loop, because
active signals need to be processed to avoid a stale timestamp
class.

Change-Id: I26af8287aae18eb19c096d9358cd0b86cfd1c561


[ROCm/clr commit: 2d41031aec]
2021-04-06 10:22:31 -04:00
German Andryeyev 472a43432d SWDEV-279288 - Avoid profiling info for the sync barrier
- With direct disaptch profiling state is enabled to trigger the
callback on HSA signal. However ROCr has very low peformance on
the first call to get the profiling info. That impacts some tiny
performance tests.

Change-Id: Idacd1b10a473fcfb5feef3074b7191d35743f769


[ROCm/clr commit: a71f7f931e]
2021-04-05 12:54:23 -04:00
Alex Xie 859d0bd497 SWDEV-276304 - [Navi][OpenCL][Linux]AMF Converter generate corrupted Frames
The copy image workaround could be recursively used by ROCclr blit kernel.
Avoid such situation by using stack variable.

Change-Id: Iadaa8cad9216220194760dd461a9533bb236aea0


[ROCm/clr commit: 2bd1836049]
2021-03-30 12:07:00 -04:00
Saleel Kudchadker f2a7ea3927 SWDEV-271010 - Increase active wait time
Increase wait time for active wait to 50us

Change-Id: I8f269ab25ecc6775e655b9eb36fafc5f41a59c95


[ROCm/clr commit: d034c48405]
2021-03-11 13:16:59 -08:00
German Andryeyev 3a4d69def2 SWDEV-272496 - Detect callbacks and force AQL barrier
HIP tests require HIP callbacks to be processed in another thread.
This change will use a thread from HSA signal callbacks to make
sure a HIP callback was done asynchronously.
Also process the callback before changing the status of command

Change-Id: Icef85d0e0f808663882cf6881ff1be3e5eca29ac


[ROCm/clr commit: 7f32d0b425]
2021-03-05 11:33:51 -05:00
German Andryeyev f6cc68deac SWDEV-272496 - Fix multiple timing issues
- Don't notify if the batch is empty, because that means
the current command was processed already.
- Disable pinning optimization to avoid a race condition on stall.
- TS marker submition requires extra AQL barrier
to track the status.

Change-Id: I17eff4ad12ac66cfe1bb44048bebb1891805279d


[ROCm/clr commit: 24299e25bd]
2021-03-01 12:46:57 -05:00
German Andryeyev 33c1e3d14d SWDEV-272496 - Wait on CPU before switching to GPU wait
GPU waits have noticeable overheads on compute with extra
AQL barrier packet and on SDMA with power saving features. This
change introduces a wait on CPU for 30 us in case the app has tiny
operations.

Change-Id: I761ba3af595f3f48544980058a9077dda15aa5f9


[ROCm/clr commit: ac387f9b03]
2021-02-17 15:19:17 -05:00
Vladislav Sytchenko 086bdf83b4 SWDEV-232428 - Push hostcall implementation to the device layer
This change unifies the hostcall implementation for all the backends,
by pushing the common logic to the device layer. This is done by
replacing the use of hsa_signal_t with device::Signal (a light wrapper
around it).

Change-Id: I7b6fca7930b5a0b199da5d85e2e048354cc04e7b


[ROCm/clr commit: 671778bdd3]
2021-02-16 17:19:57 -05:00
Ravi C Akkenapally 6629930067 SWDEV-179105 - Stream Operations: Add support for Wait and Write
Change-Id: Ibffa1d6d573826b64763da280074a77271d66808


[ROCm/clr commit: 0a5f9a3b10]
2021-02-15 17:02:38 -08:00
kjayapra-amd 4583cbafee SWDEV-270013 - Allocate kernel_arguments from kern_arg & finegrain pool instead of coarse grain.
Change-Id: Id4c6977934fdd6ef2311f6e75593801f1e51983c


[ROCm/clr commit: 2df099df9e]
2021-02-15 18:20:08 -05:00
Payam 72b49f0800 SWDEV-257937 - Updated fix for ROC_BARRIER_SYNC=0
Change-Id: I7e28e541b654db57fb0890d7dbb7519cfb2d93db


[ROCm/clr commit: a2e0b0495c]
2021-02-11 14:01:45 -05:00
German Andryeyev e60c7aa890 SWDEV-269654 - Fix HIP stream busy query
- Avoid GPU wait on the marker submission and update the command
batch after HSA signal callback upon HSA barrier completion.

Change-Id: I5c1c97212aefc2ae4b99aa9e2a81627ee9a38c1c


[ROCm/clr commit: 6966d8098e]
2021-02-09 12:57:12 -05:00
Alex Xie c490930624 SWDEV-268914 - Linux, AMF, tests fail to scale images down
In pitch workaround, we need to copy the image to copy buffer
when application wants to read image to buffer. After this
patch, we unconditionally copy the image data to the copy buffer.

Change-Id: I71b0d19459542dfbb3ca51a2c8a3a81367fa2fb5


[ROCm/clr commit: 5330679473]
2021-02-01 15:22:15 -05:00
Joseph Greathouse 62fee66ff2 SWDEV-270773 - Fix workgroup calculation logic for GWS initialization
The existing workgroup calculation logic for GWS initialization is
incorrect. It tries to add together workgroups across dimensions,
leading to major under-count in 2D and 3D kernels. An (x,y,z) kernel
uses x * y * z blocks, not x + y + z.

In addition, the previous logic was incorrect for the case of launching
a single-threaded kernel. It calculated 0 workgroups, leading to
initializing GWS to -1.

Change-Id: I1bb20a0d5b6e0cc10ac55901c28d8f93aac61c09


[ROCm/clr commit: 54d1d69c0a]
2021-01-31 01:16:48 -06:00
Saleel Kudchadker 7a08212ce1 SWDEV-257787 - Add log for tracking copy signals
Change-Id: I713e8463916a85a634a1ec2309bbd46a11c461a8


[ROCm/clr commit: 629a2d8ef3]
2021-01-28 13:25:49 -05:00
German Andryeyev f96e973378 SWDEV-257787 - Add engine tracking per signal
- The logic will trace compute, sdma read/write operations and
apply signals when necessary
- ROC_CPU_WAIT_FOR_SIGNAL, ROC_SYSTEM_SCOPE_SIGNAL
and ROC_SKIP_COPY_SYNC were added to control the tracking

Change-Id: I9e8e6174c63bf7784f7ab00964e2918c8667d364


[ROCm/clr commit: dbc7abaecf]
2021-01-25 12:34:45 -05:00
German Andryeyev 1d26696235 SWDEV-257787 - Reset active signal if ROCR call failed
- ROCR fails the call for some reason, then the signal will
become invalid and can hang on a wait. The logic will reset the
active signal in such cases

Change-Id: Ia131420200f1bbd7c9a162b8f1b06db8cecf41c6


[ROCm/clr commit: ce2e5eba6b]
2021-01-21 17:29:34 -05:00
German Andryeyev 1086195745 SWDEV-268381 - Enable wait on CPU before SDMA transfer
- There is a performance regression with a HW wait for HSA signal
on ROCr async operation. For now move the logic back to CPU wait.

- Fix profiling issue with multiple HSA signal per single timestamp
object. Some copies require multiple ROCR calls and if profiling is
required, then the execution time is derived from all used signals.

Change-Id: Id003e4abb8c2de378eedc152a7e389500fc6f4ce


[ROCm/clr commit: 5a8946190a]
2021-01-19 18:24:21 -05:00
Saleel Kudchadker fff9c7f413 Cleanup redundant Barrier packet fill function
Change-Id: I31f3250f00a362c2fdd35aca31df177fed7ddb98


[ROCm/clr commit: ce56d04dee]
2021-01-14 12:38:00 -05:00
Jason Tang 4098e012ed Remove incorrect assert
Change-Id: I7697c688c5c50a38d9d339971d4a03e9b57fcae4


[ROCm/clr commit: 020da898b2]
2021-01-11 20:59:36 -05:00
German Andryeyev 30cf81fc93 Add HSA signal global tracking logic.
Implement the global class for signals tracking per device queue.
Switch to the new tracking mechanism.

Change-Id: I3c4dda04b34e6d18d6a95510d84102909633b415


[ROCm/clr commit: 8698aeef0d]
2021-01-08 12:57:33 -05:00
Sarbojit Sarkar 6552e3c9b2 SWDEV-264116: Optimize signal pool size
Change-Id: I4b9cef04d18fbbe453db924bcd88837c0e5924de


[ROCm/clr commit: 7648b2a61b]
2021-01-06 02:14:23 -05:00
Payam 53d3c09599 SWDEV-257937 - ROC_BARRIER_SYNC fix for missing SDMA flush
Change-Id: I93e8902bfcb16bac8ea594e16ea397b1ceafbd79


[ROCm/clr commit: f134b90199]
2020-12-15 00:54:33 -05:00
Saleel Kudchadker 1410f002f3 Use barrier packets for event profiling
Use barrier packets for every profile marker that gets submitted
and use the completion signal to get GPU ts. This gives most accurate
dispatch time. Club cache flushes with profile marker if there is a
pending dispatch that needs cache flush. This optimization saves on
extra barrier and helps wall time

Change-Id: Ib62d6d7aabf4743827b561be6c9c5afa813203da


[ROCm/clr commit: 59c6cb0268]
2020-12-03 13:45:14 -05:00
German Andryeyev 7df8e0bcb3 Correct reported info in ROC profiler
OCL can't distinguish different copy types, but ROC profiler
expects SDMA transfer visibility. Add extra code to detect
a transfer with the host memory and substitute OCL command

Change-Id: I5290acd0e10bc082e00c1d4ae1474a075de7f165


[ROCm/clr commit: bd340d8cbf]
2020-10-23 18:29:48 -04:00
German Andryeyev ff4819a791 Reduce the number of allocated signals
Enable this optimization when the barrier is disabled, since
reuse requires a signal wait.
Use the size of pending AQL signals as the size of signal pool.

Change-Id: I2754a0f8b67e19d2601c58945e10fdf0e8be1624


[ROCm/clr commit: a5661192b6]
2020-10-15 16:39:33 -04:00
German Andryeyev 2c21a44b40 Add option to skip AQL barrier
The change reuses HSA signals for dispatches as a wait signal.
Skipping the barrier requires to  disable L2 cache for sysmem
allocations and extra tracking for HDP access with the large bar.
ROC_BARRIER_SYNC=0 activates the new logic. Barrier sync is
still used by default.
ROC_ACTIVE_WAIT=1 enables unconditional active wait in ROCr.
The change also consolidated ROCr wait logic under single function.

Change-Id: I6bd1be30aa88258da1b1f9de319ef5a45852afd8


[ROCm/clr commit: d9397590de]
2020-10-06 08:37:12 -04:00
German Andryeyev 7959329169 Revert "Reduce the default size of the signal pool"
This reverts commit 6e0c211730.

Reason for revert: a regression

Change-Id: I78180ba011f45af9a4cce110b14f379aa10f7d3a


[ROCm/clr commit: af8426b0e4]
2020-10-01 09:56:05 -04:00
Aryan Salmanpour b01d49542c Fix a crash when printf used in a kernel launched on a stream with custom CU mask
SWDEV-249719 - root cause: queues with custom CU mask are not inserted
into queuePool_ (i.e., queue of reusable HSA queues) of ROC device class
causing a crash when creating hostcall buffers for printf

Change-Id: Ieee7005d9a5a30b3113394ce23ee65927126d0d6


[ROCm/clr commit: 2e199bd492]
2020-09-25 09:25:19 -04:00
German Andryeyev 6e0c211730 Reduce the default size of the signal pool
Implement dynamic signal pool grow per allocated queue

Change-Id: Ie8b17937d72c29cc49e59639c4b2023ea984b14c


[ROCm/clr commit: e68d671a51]
2020-09-09 09:53:52 -04:00
Alex Xie f8dd901fc2 SWDEV-250136 - [LNX][Navi21][OCL over ROCr] OpenCL-GL sharing failed
Change-Id: Id61f649f035964d14f6399dbea03137c11f8eaea


[ROCm/clr commit: 2c2665665d]
2020-09-06 10:40:56 -04:00
Jason Tang da0a525982 SWDEV-239502 - fix interop regression
When header==0, the legitimate packet->header is wiped out, so also add an assert.

Change-Id: I6b3037d4618719262b0d7c1792bd54f768a63660


[ROCm/clr commit: 19d1497fa2]
2020-08-25 18:11:18 -04:00
Aryan Salmanpour 771a8abb90 SWDEV-248499 Fix a crash when printf is used with cooperative kernels
root cause - cooperative queue is not inserted into queuePool_ (HSA queues) of ROC device calss causing a crash when creating hostcall buffers for printf

Change-Id: I3f9aceb4e5fe6a7c7a2a549a4bb0a3511fe02799


[ROCm/clr commit: d2b9d267b2]
2020-08-25 16:51:34 -04:00
German Andryeyev a5ca15a599 Enable prefetch async functionality
Fix a typo with the name define, when compilation wasn't enabled.
Force CPU prefetch if system was forced in runtime

Change-Id: Id4b578f9fa44a45426fdb5d8ecb1da803aa42313


[ROCm/clr commit: 6e69258b69]
2020-08-13 11:09:10 -04:00
Jason Tang 3315ef8a45 SWDEV-247463 - Fix regression: ocltst segfaults
Change-Id: Iadb55ba45d6c8ade0757fd970ac4c6cde1805de3


[ROCm/clr commit: 152a2dfb5a]
2020-08-09 11:28:09 -04:00
German Andryeyev 4a2b2e77f6 Sync the current queue for P2P staging
P2P staging uses device queues for transfer, hence the current
queue must be in sync

Change-Id: I8372a60590eed9dde62cb4c67ef4df5df82a8e8d


[ROCm/clr commit: 0dc47d55d2]
2020-08-07 14:36:50 -04:00
Saleel Kudchadker 820a456980 Add Queue profling param and toggle for HIP
Use signal timestamps if NDRange command takes forceProfile flag.

Change-Id: Ib7f187d781fd78a7346818afb3344a9378f4c104


[ROCm/clr commit: ec73340348]
2020-08-06 03:09:53 -04:00
Jason Tang e1b0edf35c SWDEV-246687 - Do not use std::vector reference as class member cuMask_
The current implementation creates default reference in the stack and assigns it to class member cuMasks_, so whenever the content of the stack changes, cuMask_ would change.

Change-Id: Iefab63c335d504b83c4ae90bd34ae76c6afb8f3c


[ROCm/clr commit: 8ef5da00c7]
2020-08-05 16:57:36 -04:00
German Andryeyev e34eaf17b9 Process cache coherency before mem dependency tracker
Optimizaiton to remove extra syncs uncovered a bug with the cache
coherency layer, there runtime could lose the track of mem address
if coherency layer performed a sync.

Change-Id: I25647cfa4a4be9cdbd8577ff076a740bbdac79c8


[ROCm/clr commit: 91a25df04f]
2020-08-04 16:33:18 -04:00
Tao Sang 44eb207f8d Apply constexpr on global constant varaibles
When HIP_ENABLE_DEFERRED_LOADING=0, many global variables will be
referenced but they are not initialized in that early time. The patch
will use constexpr to initialze global constant varables in compile
time.

Change-Id: I9d538b7abc6a0ce700ec3332b97fc144db5fc1ef


[ROCm/clr commit: fdef6f722f]
2020-07-22 22:14:13 -04:00
Jatin Chaudhary 7dae2632b9 Adding AnyOrder Flag
Change-Id: I6baaef42b98adfbc8cf2605e175ec007e008045f


[ROCm/clr commit: 48690f29e9]
2020-07-22 00:25:04 -04:00
Matt Arsenault 3cae0b7649 Fix -Wmissing-braces
Change-Id: I2394b6923c789f36e72242f4b196844cc0ee90ba


[ROCm/clr commit: 5577eabcea]
2020-07-15 16:51:03 -04:00
Jatin Chaudhary 260a83c546 Replacing deprecated HSA API calls with newer ones
Change-Id: Iebe2c00e717ab0e47c61611752b717966c719994


[ROCm/clr commit: cd1e364911]
2020-07-08 00:32:24 -04:00
Aryan Salmanpour 8d083a3c61 Always print error message with the returned error code before abort
Change-Id: I8479abc586937a50c90b2785c4ce7364e6e9732b


[ROCm/clr commit: 4a901f3dd3]
2020-07-07 16:28:30 -04:00
Dittakavi Satyanvesh b7801b2035 SWDEV-240566 adds error message before abort
Change-Id: I4dbd089daa5e6fde5e8722dc2395225dd822561c


[ROCm/clr commit: 7a3b8c6dd2]
2020-06-22 10:12:49 -04:00
German Andryeyev 0a6056ac82 Initial HMM support
- Expose ROCclr interfaces for HIP usage
- ROCr interfaces aren't available in staging, thus control the
build with AMD_HMM_SUPPORT define

Change-Id: Iadc2bcc230e78d3b0dc22b235189c8cc80843446


[ROCm/clr commit: c5afd5d412]
2020-06-12 09:06:07 -04:00
Saleel Kudchadker fca301772c Add logging support for AQL packet
Use AMD_LOG_LEVEL=4 and AMD_LOG_MASK=8 to print AQL log
explicitly
Change-Id: I4209d91b460e64be44261d3ab773580067e47c29


[ROCm/clr commit: 2b771d2f5f]
2020-06-10 14:04:47 -07:00
German Andryeyev 566684b6f4 Add the sync of the current queue
Make sure runtime waits for the current queue before
synching with device queue

Change-Id: I753b6fc0bb15a3a3d4bf03fef1152842550850c0


[ROCm/clr commit: 86e0f337fc]
2020-06-05 11:57:59 -04:00
Aryan Salmanpour 55c58ebfaa Add support for setting queue priority for ROCm backend
Change-Id: I67ed5a6868af79538f7f4522d8d11c043cdf3c1e


[ROCm/clr commit: b5552aa97f]
2020-06-04 20:16:32 -04:00