Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
c58855a
Update README.md
yaoliu13 Jun 10, 2026
403aff2
ci: add gfx11 ROCm build + on-hardware test workflow
Jun 10, 2026
5607016
ci: pin ROCm to last known-good nightly 7.14.0a20260608
Jun 10, 2026
1b73b84
ci: route gfx1150 test to linux-strix-gpu-rocm-2 runner
Jun 10, 2026
e1a851c
ci: pull test model from pinned GitHub release, revert gfx1150 runner
Jun 11, 2026
3a94a73
ci: bundle libatomic + update test assertions to current llama.cpp ou…
Jun 11, 2026
16c4225
ci: make gfx test verify substantive generation, not just offload
Jun 11, 2026
c8c5775
ci(gfx11): make on-hardware test verify deterministic answer
Jun 11, 2026
b6a34e2
ci(gfx11): add nightly dated release, timeout test, skip gfx1150 test
Jun 11, 2026
643f224
ci(gfx11): add gfx110X (Hawk Point/Phoenix RDNA3) build + release target
Jun 11, 2026
5d37137
ci: add gfx1153 build + release target
Jun 12, 2026
b57d714
ci: retrigger CI
Jun 13, 2026
773dc6e
Merge pull request #23 from ROCm/jimwu.enable-hawk-point
jimw567 Jun 13, 2026
46d7a95
ci(gfx11): build one universal multi-arch ROCm package
Jun 16, 2026
e109b83
Add mmq device table for RDNA3.5
Jun 17, 2026
4483e1b
ci(gfx11): rename "universal" package to "multiarch"
Jun 17, 2026
171c7e0
ci(gfx11): use "multiarch" spelling in comments and scripts
Jun 17, 2026
b5e799d
Merge pull request #24 from ROCm/jimwu.multiarch-rocm
jimw567 Jun 17, 2026
a18e333
Merge branch 'gfx11' into annier.mmq-device-table
jimw567 Jun 17, 2026
cc66d2c
Merge pull request #25 from ROCm/annier.mmq-device-table
jimw567 Jun 19, 2026
cd81994
Merge remote-tracking branch 'upstream/master' into jimwu.sync-upstream
Jun 26, 2026
5d83b8b
Merge pull request #28 from ROCm/jimwu.sync-upstream
jimw567 Jun 26, 2026
13ee2f1
ci: add gfx11 ROCm build + on-hardware test workflow
Jun 10, 2026
cb547e3
ci: pin ROCm to last known-good nightly 7.14.0a20260608
Jun 10, 2026
c1709b0
ci: route gfx1150 test to linux-strix-gpu-rocm-2 runner
Jun 10, 2026
1b33419
ci: pull test model from pinned GitHub release, revert gfx1150 runner
Jun 11, 2026
445e589
ci: bundle libatomic + update test assertions to current llama.cpp ou…
Jun 11, 2026
6ba6660
ci: make gfx test verify substantive generation, not just offload
Jun 11, 2026
20562e1
ci(gfx11): make on-hardware test verify deterministic answer
Jun 11, 2026
d8c0a60
ci(gfx11): add nightly dated release, timeout test, skip gfx1150 test
Jun 11, 2026
9e37c63
ci(gfx11): add gfx110X (Hawk Point/Phoenix RDNA3) build + release target
Jun 11, 2026
aa90db9
ci: add gfx1153 build + release target
Jun 12, 2026
914a8e5
ci: retrigger CI
Jun 13, 2026
5afbaec
Add mmq device table for RDNA3.5
Jun 17, 2026
75f9c80
ci(gfx11): build one universal multi-arch ROCm package
Jun 16, 2026
91a2c4c
ci(gfx11): rename "universal" package to "multiarch"
Jun 17, 2026
5692e0b
ci(gfx11): use "multiarch" spelling in comments and scripts
Jun 17, 2026
b11df79
ci(gfx11): run editorconfig + model-naming linters on ubuntu-24.04
Jun 27, 2026
eb2440b
ci(gfx11): trigger editorconfig + model-naming linters on gfx11 branch
Jun 27, 2026
78372b6
ci(gfx11): run flake8 lint on ubuntu-24.04, trigger on gfx11
Jun 27, 2026
4b5ac96
Merge pull request #30 from ROCm/jimwu.gfx11-sync
Annieren Jun 29, 2026
1525b34
ggml-cuda: add per-op GPU roofline profiling for the HIP backend
roberteg16 Jul 2, 2026
f366597
Merge pull request #33 from ROCm/rogarcia.roofline
mgehre-amd Jul 7, 2026
ef64086
jimwu.unpin-rocm-nightly: 1 file changed, 8 insertions(+), 8 deletio…
Jul 8, 2026
b180bbf
ggml-cuda: tune D=256 tile flash-attn config for RDNA3.5
roberteg16 Jul 6, 2026
db0af64
ggml-cuda: size MMQ tile to MoE tokens-per-expert
roberteg16 Jul 5, 2026
b9a5d2a
mtmd-cli: reset roofline profiler after warmup prefill
roberteg16 Jul 8, 2026
482ed81
Merge pull request #42 from ROCm/rogarcia.llamacpp-roofline-for-vlm
roberteg16 Jul 9, 2026
8608bf1
Merge pull request #38 from ROCm/jimwu.unpin-rocm-nightly
jimw567 Jul 9, 2026
7dea0c3
Merge remote-tracking branch 'upstream/master' into jimwu.gfx11-sync-…
Jul 9, 2026
d2312fc
ci(gfx11): skip empty verbose stop chunk in test-gfx answer parse
Jul 10, 2026
e583071
ci(hip): allowlist renamed Q2_K mmq + rwkv_wkv_f32 VGPR spills
Jul 10, 2026
b71a752
Merge pull request #43 from ROCm/jimwu.gfx11-sync-upstream
jimw567 Jul 10, 2026
38a8ff8
Merge pull request #41 from ROCm/rogarcia.fattn-tile-d256
mgehre-amd Jul 10, 2026
bc3c17a
ci(gfx11): cache HIP builds with ggml-org/ccache-action
roberteg16 Jul 13, 2026
ac67772
ci(gfx11): rename ccache step to "Setup ccache"
roberteg16 Jul 13, 2026
fee8f99
Merge pull request #39 from ROCm/rogarcia.mmq-moe-tile-size
roberteg16 Jul 13, 2026
c06793f
jimwu.gfx11-ci-setup-node: 1 file changed, 5 insertions(+)
Jul 13, 2026
2406da6
Merge pull request #47 from ROCm/jimwu.gfx11-ci-setup-node
jimw567 Jul 13, 2026
8bec806
ci(gfx11): widen ccache eviction to 7d
roberteg16 Jul 13, 2026
96aa697
ci(gfx11): bundle librocprofiler-sdk for roofline; add roofline input
roberteg16 Jul 13, 2026
e9236fd
ci(gfx11): drop stale gather_required_libs.py reference
roberteg16 Jul 13, 2026
dbf933f
Merge pull request #44 from ROCm/rogarcia.roofline-bundle-libs
roberteg16 Jul 13, 2026
8ff69ec
Merge pull request #45 from ROCm/rogarcia.gfx11-ccache
mgehre-amd Jul 14, 2026
bc34c21
roofline: emit raw per-tensor facts for fused ops
roberteg16 Jul 13, 2026
628822e
roofline: emit per-tensor storage ids on non-fused rows too
roberteg16 Jul 13, 2026
302448a
roofline: clarify storage-id / tensor-id comments
roberteg16 Jul 14, 2026
43efae8
roofline: rename cryptic id fields (sid -> storage_id / tensor_id)
roberteg16 Jul 14, 2026
e768c1a
CUDA: route single-column f32 mul_mat through mmvf via transpose-free…
roberteg16 Jul 14, 2026
e7dfa11
roofline: explain why both tensor id and storage id are needed
roberteg16 Jul 14, 2026
c097f29
ci(hip): drop web UI provisioning from hip-quality-check
roberteg16 Jul 14, 2026
a4498c2
Merge pull request #49 from ROCm/rogarcia.cuda-mmvf-single-col-swap
mgehre-amd Jul 15, 2026
77939b0
Merge pull request #51 from ROCm/rogarcia.fix-ci-llamacpp
mgehre-amd Jul 15, 2026
ffe2ad4
Merge pull request #48 from ROCm/rogarcia.roofline-fused-raw-facts
mgehre-amd Jul 15, 2026
5b06a86
roofline: capture per-launch MoE active-expert count
roberteg16 Jul 14, 2026
442b17e
Merge pull request #50 from ROCm/rogarcia.roofline-moe-experts-used
roberteg16 Jul 15, 2026
b966e22
ggml-cuda: honor the current stream in multi-stream concurrency
roberteg16 Jul 5, 2026
fd0b5b4
ggml-cuda: fix multi-stream concurrency by isolating branch scratch
roberteg16 Jul 5, 2026
7fc317f
ggml-cuda: overlap the MoE shared expert on a separate stream
roberteg16 Jul 5, 2026
367c4d0
Merge pull request #36 from ROCm/rogarcia.cuda-multistream-shexp
roberteg16 Jul 15, 2026
e5977af
delta-net: force contiguous conv-state concat input
roberteg16 Jul 15, 2026
20191d0
ssm_conv: add channels-major input mode; drop delta-net transpose
roberteg16 Jul 15, 2026
f6ea7bc
Merge pull request #52 from ROCm/rogarcia.qwen3.6-moe-optimization
roberteg16 Jul 16, 2026
f0a0aef
roofline: emit per-expert routing histogram (tokens_per_expert) for M…
roberteg16 Jul 16, 2026
0941c4c
Merge pull request #53 from ROCm/rogarcia.roofline-moe-tokens-per-expert
mgehre-amd Jul 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
578 changes: 578 additions & 0 deletions .github/workflows/build-gfx11-rocm.yml

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ on:
push:
branches:
- master
- gfx11 # ROCm fork-local, DO NOT UPSTREAM
pull_request:
branches:
- master
- gfx11 # ROCm fork-local, DO NOT UPSTREAM

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
model-naming:
runs-on: [self-hosted, fast]
# ROCm fork-local: upstream uses [self-hosted, fast] runners that don't
# exist in this fork. DO NOT UPSTREAM this runner change.
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Check model naming conventions
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/editorconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@ on:
push:
branches:
- master
- gfx11 # ROCm fork-local, DO NOT UPSTREAM
pull_request:
branches:
- master
- gfx11 # ROCm fork-local, DO NOT UPSTREAM

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
editorconfig:
runs-on: [self-hosted, fast]
# ROCm fork-local: upstream uses [self-hosted, fast] runners that don't
# exist in this fork. DO NOT UPSTREAM this runner change.
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- uses: editorconfig-checker/action-editorconfig-checker@840e866d93b8e032123c23bac69dece044d4d84c # v2.2.0
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/hip-quality-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ jobs:
-DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
-DGPU_TARGETS=gfx942 \
-DGGML_HIP=ON \
-DLLAMA_BUILD_UI=OFF \
-DLLAMA_USE_PREBUILT_UI=OFF \
-DGGML_HIP_EXPORT_METRICS=Off \
-DCMAKE_HIP_FLAGS="-Werror -Wno-tautological-compare" \
-DCMAKE_BUILD_TYPE=Release
Expand All @@ -78,6 +80,8 @@ jobs:
-DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \
-DGPU_TARGETS=gfx908 \
-DGGML_HIP=ON \
-DLLAMA_BUILD_UI=OFF \
-DLLAMA_USE_PREBUILT_UI=OFF \
-DGGML_HIP_EXPORT_METRICS=On \
-DCMAKE_HIP_FLAGS="" \
-DCMAKE_BUILD_TYPE=Release
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- gfx11 # ROCm fork-local, DO NOT UPSTREAM
paths: [
'.github/workflows/python-lint.yml',
'**/*.py'
Expand All @@ -21,7 +22,9 @@ concurrency:

jobs:
flake8-lint:
runs-on: [self-hosted, fast]
# ROCm fork-local: upstream uses [self-hosted, fast] runners that don't
# exist in this fork. DO NOT UPSTREAM this runner change.
runs-on: ubuntu-24.04
name: Lint
steps:
- name: Check out source repository
Expand Down
608 changes: 4 additions & 604 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ggml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ option(GGML_HIP_NO_VMM "ggml: do not try to use HIP VMM"
option(GGML_HIP_ROCWMMA_FATTN "ggml: enable rocWMMA for FlashAttention" OFF)
option(GGML_HIP_MMQ_MFMA "ggml: enable MFMA MMA for CDNA in MMQ" ON)
option(GGML_HIP_EXPORT_METRICS "ggml: enable kernel perf metrics output" OFF)
option(GGML_HIP_ROOFLINE "ggml: enable per-op roofline profiling" OFF)
option(GGML_MUSA_GRAPHS "ggml: use MUSA graph, experimental, unstable" OFF)
option(GGML_MUSA_MUDNN_COPY "ggml: enable muDNN for accelerated copy" OFF)
option(GGML_VULKAN "ggml: use Vulkan" OFF)
Expand Down
16 changes: 16 additions & 0 deletions ggml/include/ggml.h
Original file line number Diff line number Diff line change
Expand Up @@ -2438,11 +2438,27 @@ extern "C" {
struct ggml_tensor * d,
bool masked);

// memory layout of the ssm_conv input (sx), stored in op_params[0]
enum ggml_ssm_conv_layout {
GGML_SSM_CONV_LAYOUT_TIME_MAJOR = 0, // sx = [d_conv-1+n_t, d_inner, n_s] (time contiguous)
GGML_SSM_CONV_LAYOUT_CHANNELS_MAJOR = 1, // sx = [d_inner, d_conv-1+n_t, n_s] (channels contiguous)
};

GGML_API struct ggml_tensor * ggml_ssm_conv(
struct ggml_context * ctx,
struct ggml_tensor * sx,
struct ggml_tensor * c);

// same as ggml_ssm_conv but sx is channels-major: [d_inner, d_conv-1+n_t, n_s]
// (channels contiguous). output layout is unchanged: [d_inner, n_t, n_s].
GGML_API struct ggml_tensor * ggml_ssm_conv_channels_major(
struct ggml_context * ctx,
struct ggml_tensor * sx,
struct ggml_tensor * c);

// input (sx) memory layout of an SSM_CONV op (see enum ggml_ssm_conv_layout)
GGML_API enum ggml_ssm_conv_layout ggml_ssm_conv_get_layout(const struct ggml_tensor * op);

GGML_API struct ggml_tensor * ggml_ssm_scan(
struct ggml_context * ctx,
struct ggml_tensor * s,
Expand Down
9 changes: 9 additions & 0 deletions ggml/src/ggml-backend-meta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,15 @@ static struct ggml_backend_meta_split_state ggml_backend_meta_get_split_state(
};

auto handle_ssm_conv = [&](const std::vector<ggml_backend_meta_split_state> & src_ss) -> ggml_backend_meta_split_state {
if (ggml_ssm_conv_get_layout(tensor) == GGML_SSM_CONV_LAYOUT_CHANNELS_MAJOR) {
// channels-major: d_inner is sx (src0) axis 0 and c (src1) axis 1, so a d_inner
// split lands on different source axes; the output [d_inner, n_t, n_s] splits on axis 0.
if (src_ss[0].axis == GGML_BACKEND_SPLIT_AXIS_0 && src_ss[1].axis == GGML_BACKEND_SPLIT_AXIS_1) {
return {GGML_BACKEND_SPLIT_AXIS_0, {0}, {1}, 1};
}
return handle_generic(src_ss, /*scalar_only =*/ false);
}
// time-major: d_inner is axis 1 of both sx and c
if (src_ss[0].axis == src_ss[1].axis) {
if (src_ss[0].axis == GGML_BACKEND_SPLIT_AXIS_0) {
return {GGML_BACKEND_SPLIT_AXIS_1, {0}, {1}, 1};
Expand Down
7 changes: 6 additions & 1 deletion ggml/src/ggml-cann/ggml-cann.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2684,7 +2684,12 @@ static bool ggml_backend_cann_supports_op(ggml_backend_dev_t dev, const ggml_ten
return true;
}
case GGML_OP_SSM_CONV:
return true;
// ggml_cann_ssm_conv() requires F32 src/dst and the time-major layout
// (the channels-major layout is only implemented on CPU/CUDA)
return op->type == GGML_TYPE_F32 &&
op->src[0]->type == GGML_TYPE_F32 &&
op->src[1]->type == GGML_TYPE_F32 &&
ggml_ssm_conv_get_layout(op) == GGML_SSM_CONV_LAYOUT_TIME_MAJOR;
case GGML_OP_CUMSUM:
return op->src[0]->type == GGML_TYPE_F32;
case GGML_OP_TRI:
Expand Down
32 changes: 21 additions & 11 deletions ggml/src/ggml-cpu/ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9498,17 +9498,29 @@ static void ggml_compute_forward_ssm_conv_f32(
const int ith = params->ith;
const int nth = params->nth;

const int nc = src1->ne[0]; // d_conv
const int ncs = src0->ne[0]; // d_conv - 1 + n_t
const int nr = src0->ne[1]; // d_inner
const int n_t = dst->ne[1]; // tokens per sequence
const int n_s = dst->ne[2]; // number of sequences in the batch
// time-major : src0 = [d_conv-1+n_t, d_inner, n_s] (time contiguous)
// channels-major : src0 = [d_inner, d_conv-1+n_t, n_s] (channels contiguous)
// output is [d_inner, n_t, n_s] (channels contiguous) in both cases
const bool channels_major = ggml_ssm_conv_get_layout(dst) == GGML_SSM_CONV_LAYOUT_CHANNELS_MAJOR;

const int nc = src1->ne[0]; // d_conv
const int ncs = channels_major ? src0->ne[1] : src0->ne[0]; // d_conv - 1 + n_t
const int nr = channels_major ? src0->ne[0] : src0->ne[1]; // d_inner
const int n_t = dst->ne[1]; // tokens per sequence
const int n_s = dst->ne[2]; // number of sequences in the batch

GGML_ASSERT( dst->ne[0] == nr);
GGML_ASSERT(src0->nb[0] == sizeof(float));
GGML_ASSERT(src0->nb[0] == sizeof(float)); // input is contiguous (either layout)
GGML_ASSERT(src1->nb[0] == sizeof(float));
GGML_ASSERT(src0->nb[1] == src0->ne[0]*sizeof(float));

// byte strides of the input to move one channel / one time step, per layout
const size_t chan_nb = channels_major ? src0->nb[0] : src0->nb[1];
const size_t time_nb = channels_major ? src0->nb[1] : src0->nb[0];
const int chan_stride = chan_nb / sizeof(float);
const int time_stride = time_nb / sizeof(float);
GGML_UNUSED(ncs);

// rows per thread
const int dr = (nr + nth - 1)/nth;

Expand All @@ -9519,13 +9531,11 @@ static void ggml_compute_forward_ssm_conv_f32(

for (int i3 = 0; i3 < n_s; ++i3) {
for (int i2 = 0; i2 < n_t; ++i2) {
// {d_conv - 1 + n_t, d_inner, n_seqs}
// sliding window
const float * s = (const float *) ((const char *) src0->data + ir0*(src0->nb[1]) + i2*(src0->nb[0]) + i3*(src0->nb[2])); // {d_conv, d_inner, n_s}
// sliding window over the time axis (starting at token i2)
const float * s = (const float *) ((const char *) src0->data + ir0*chan_nb + i2*time_nb + i3*(src0->nb[2]));
const float * c = (const float *) ((const char *) src1->data + ir0*(src1->nb[1])); // {d_conv, d_inner}
float * x = (float *) ((char *) dst->data + ir0*(dst->nb[0]) + i2*(dst->nb[1]) + i3*(dst->nb[2])); // {d_inner, n_t, n_s}

// TODO: transpose the output for smaller strides for big batches?
// d_inner
for (int i1 = 0; i1 < ir; ++i1) {
// rowwise dot product
Expand All @@ -9534,7 +9544,7 @@ static void ggml_compute_forward_ssm_conv_f32(

// d_conv
for (int i0 = 0; i0 < nc; ++i0) {
sumf += s[i0 + i1*ncs] * c[i0 + i1*nc];
sumf += s[i0*time_stride + i1*chan_stride] * c[i0 + i1*nc];
}
x[i1] = sumf;
}
Expand Down
18 changes: 13 additions & 5 deletions ggml/src/ggml-cuda/common.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,9 @@ struct ggml_backend_cuda_context {
cudaEvent_t copy_event = nullptr;

cudaStream_t streams[GGML_CUDA_MAX_DEVICES][GGML_CUDA_MAX_STREAMS] = { { nullptr } };
cublasHandle_t cublas_handles[GGML_CUDA_MAX_DEVICES] = {nullptr};
// one cuBLAS handle per (device, stream): the handle carries a workspace that must not be shared
// by concurrent streams, otherwise overlapped GEMMs corrupt each other's results
cublasHandle_t cublas_handles[GGML_CUDA_MAX_DEVICES][GGML_CUDA_MAX_STREAMS] = { { nullptr } };

int curr_stream_no = 0;

Expand Down Expand Up @@ -1457,6 +1459,11 @@ struct ggml_backend_cuda_context {

ggml_cuda_stream_context concurrent_stream_context;

// dedicated buffer for the branches of overlapped concurrent regions (attention QKV, MoE shared
// expert), reused across layers so their scratch never aliases tensors read across the region
ggml_backend_buffer_t concurrent_scratch = nullptr;
size_t concurrent_scratch_size = 0;

~ggml_backend_cuda_context();

cudaStream_t stream(int device, int stream) {
Expand All @@ -1472,12 +1479,13 @@ struct ggml_backend_cuda_context {
ggml_cuda_stream_context & stream_context() { return concurrent_stream_context; }

cublasHandle_t cublas_handle(int device) {
if (cublas_handles[device] == nullptr) {
cublasHandle_t & handle = cublas_handles[device][curr_stream_no];
if (handle == nullptr) {
ggml_cuda_set_device(device);
CUBLAS_CHECK(cublasCreate(&cublas_handles[device]));
CUBLAS_CHECK(cublasSetMathMode(cublas_handles[device], CUBLAS_TF32_TENSOR_OP_MATH));
CUBLAS_CHECK(cublasCreate(&handle));
CUBLAS_CHECK(cublasSetMathMode(handle, CUBLAS_TF32_TENSOR_OP_MATH));
}
return cublas_handles[device];
return handle;
}

cublasHandle_t cublas_handle() {
Expand Down
17 changes: 15 additions & 2 deletions ggml/src/ggml-cuda/fattn-tile.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,19 @@ static constexpr __host__ __device__ uint32_t ggml_cuda_fattn_tile_get_config_am
return 0;
}

static constexpr __host__ __device__ uint32_t ggml_cuda_fattn_tile_get_config_amd_rdna3_5(const int DKQ, const int DV, const int ncols) {
// With rocWMMA FlashAttention off, D=256 prefill runs on the tile kernel; on RDNA3.5 a smaller
// K tile with higher occupancy is faster than the shared RDNA values. Other cases fall back.
GGML_CUDA_FATTN_TILE_CONFIG_CASE(256, 256, 32, 256, 4, 64, 64)

return ggml_cuda_fattn_tile_get_config_amd_rdna(DKQ, DV, ncols);
}

static __host__ uint32_t ggml_cuda_fattn_tile_get_config(const int DKQ, const int DV, const int ncols, const int cc) {
if (GGML_CUDA_CC_IS_AMD(cc)) {
if (GGML_CUDA_CC_IS_RDNA3_5(cc)) {
return ggml_cuda_fattn_tile_get_config_amd_rdna3_5(DKQ, DV, ncols);
}
if (GGML_CUDA_CC_IS_RDNA(cc)) {
return ggml_cuda_fattn_tile_get_config_amd_rdna(DKQ, DV, ncols);
}
Expand All @@ -328,11 +339,13 @@ static __host__ uint32_t ggml_cuda_fattn_tile_get_config(const int DKQ, const in

static constexpr __device__ uint32_t ggml_cuda_fattn_tile_get_config(const int DKQ, const int DV, const int ncols) {
#ifdef GGML_USE_HIP
#ifdef RDNA
#ifdef RDNA3_5
return ggml_cuda_fattn_tile_get_config_amd_rdna3_5(DKQ, DV, ncols);
#elif defined(RDNA)
return ggml_cuda_fattn_tile_get_config_amd_rdna(DKQ, DV, ncols);
#else
return ggml_cuda_fattn_tile_get_config_amd(DKQ, DV, ncols);
#endif // RDNA
#endif // RDNA3_5
#else
#ifdef FAST_FP16_AVAILABLE
return ggml_cuda_fattn_tile_get_config_nvidia_fp16(DKQ, DV, ncols);
Expand Down
Loading
Loading