Repository navigation
Rocm performance improvement - #1293
Open
lightvector wants to merge 1 commit into
Open
lightvector wants to merge 1 commit into
lightvector wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
This PR does a bunch of performance optimizations for rocm.
#1269 added the dot2 attention kernels and enabled them by default only on RDNA2. But they're also better in a lot of other cases too.
Notable Changes
rocmUseDot2Attention = auto).attention on RDNA (gfx10/11/12) and gfx94x.
when the installed CK is incompatible with the vendored kernels, as on stock ROCm 7.0.
rocmUseGraphs = falsedisables graphs.splits depending on launch size.
Performance
(
benchmarknn, FP16, 19x19, one server thread), relative to master with #1269merged, for batch sizes 1 / 8 / 32 / 64:
tf3-b11c768
tf3-b10c512
* Machine has old Xeon E5 v2 host and is launch-bound at small batch sizes. Most of its
batch-1 gain is from HIP graphs (2.1-2.8x at batch 1, 1.2-2.1x at batch 4). On hosts with fast
CPUs, graphs were neutral.
** Without a compatible CK, master runs MI300X attention on the plain kernel. With a compatible CK
(TheRock 7.13), dot2 was still 1.12-1.44x faster end to end than CK's fused attention, at batch sizes
1 to 256.
Other notes:
2.6x at batch 1.
wave64) were measured separately:
Tested with
testgpuerrorandtestbackendreference** on all the gpus above on multiple models on multiple configurations.