Skip to content

feat(rocke): grouped Conv2d forward in implicit-GEMM - #10064

Merged
bartekxk merged 9 commits into
developfrom
users/aledudek/rocke-grouped-conv
Aug 15, 2026
Merged

bartekxk merged 9 commits into
developfrom
users/aledudek/rocke-grouped-conv

Conversation

@aledudek

@aledudek aledudek commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Add cardinality-grouped (groups>1) forward convolution coverage to the implicit-GEMM conv, including small per-group channel counts.

Technical Details

  • grid-per-group scheme (group on blockIdx.z); groups==1 stays byte-identical
  • make_a_descriptor: grouped channel decode (unmerge k->y,x,c_in_group over cpg, then embed((group,c_in_group)->c))
  • make_b_descriptor: channel extent C->cpg
  • build body + epilogues: thread group index into A (group coord) and fold into B/D as k_out = g*kpg + n
  • implicit_gemm_conv_grid() -> (gn, gm, groups); group-consistency in validate()
  • dispatch: drop the groups==1 gate (validate C/K % G), add bf16, grid z=groups, relax no-pad divisibility to M-only for grouped (N/K are tail-safe)

Test Plan

test_grouped_conv_numeric.py, dispatch_tests/conv/test_conv.py

Passed. groups==1 byte-identity gate GREEN.

Submission Checklist

JIRA ID: AICK-1752
Changes are behind the feature flag HIPKERNELPROVIDER_ENABLE_ROCKE which is defaulted to OFF.

@therock-pr-bot

therock-pr-bot Bot commented Jul 28, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ⚠️ Warning Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/helper_rocke.instances.common.conv_implicit_gemm.h, dnn-providers/hip-kernel-provider/rocke/platform/cpp/include/rocke/instance_conv_implicit_gemm_internal.h, dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/common/conv_implicit_gemm.cpp, dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/common/conv_implicit_gemm_conv_build_glue.cpp, dnn-providers/hip-kernel-provider/rocke/platform/cpp/instances/common/conv_implicit_gemm_conv_epilogue.cpp (+7 more); no test file found
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds grouped (groups>1) forward Conv2d support to the implicit-GEMM convolution path in Rocke, extending descriptor construction, kernel indexing, epilogues, and dispatcher behavior so grouped and cardinality-grouped shapes are supported while preserving groups==1 byte identity.

Changes:

  • Extend implicit-GEMM conv descriptors and kernel body/epilogues to handle per-group channel decoding and blockIdx.z as the group index.
  • Update conv dispatcher validation/selection to accept grouped conv (C/K divisible by G), bf16, and to use a shared (gn, gm, groups) launch grid; add gfx1250 WMMA candidate and tests.
  • Add GPU numeric correctness and dispatch+launch tests for grouped conv, including small per-group channel “hero” cases and bf16.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
dnn-providers/hip-kernel-provider/rocke/platform/tests/instances/test_grouped_conv_numeric.py New on-GPU numeric correctness + dispatch/launch tests covering grouped forward conv.
dnn-providers/hip-kernel-provider/rocke/platform/tests/dispatch/dispatch_tests/conv/test_conv.py Dispatcher unit tests updated for bf16, grouped conv selection, and gfx1250 WMMA behavior.
dnn-providers/hip-kernel-provider/rocke/platform/python/rocke/instances/common/conv_implicit_gemm.py Core grouped-conv enablement: grid shape, A/B descriptor changes, group-aware indexing and epilogues, WMMA allow-list update.
dnn-providers/hip-kernel-provider/rocke/platform/python/rocke/dispatch/families/conv.py Dispatcher now builds dtype spec, validates grouped constraints, relaxes divisibility gates for grouped, and adds gfx1250 WMMA candidate + grouped grid.

@aledudek
aledudek force-pushed the users/aledudek/rocke-grouped-conv branch from 9e9c044 to dfa8cb1 Compare July 28, 2026 18:31
@therock-pr-bot

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@aledudek
aledudek force-pushed the users/aledudek/rocke-grouped-conv branch from dfa8cb1 to 98354af Compare July 28, 2026 19:25
aledudek added 3 commits July 29, 2026 11:42
Add cardinality-grouped (groups>1) forward convolution coverage to the
implicit-GEMM conv, including small per-group channel counts.

- grid-per-group scheme (group on blockIdx.z); groups==1 stays byte-identical
- make_a_descriptor: grouped channel decode (unmerge k->y,x,c_in_group over cpg,
  then embed((group,c_in_group)->c))
- make_b_descriptor: channel extent C->cpg
- build body + epilogues: thread group index into A (group coord) and fold into
  B/D as k_out = g*kpg + n
- implicit_gemm_conv_grid() -> (gn, gm, groups); group-consistency in validate()
- dispatch: drop the groups==1 gate (validate C/K % G), add bf16, grid z=groups,
  relax no-pad divisibility to M-only for grouped (N/K are tail-safe)

test_grouped_conv_numeric.py, dispatch_tests/conv/test_conv.py

Passed. groups==1 byte-identity gate GREEN.

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.

JIRA ID: AICK-1752
@aledudek
aledudek force-pushed the users/aledudek/rocke-grouped-conv branch from 98354af to 4d4210e Compare July 29, 2026 11:43
@aledudek
aledudek marked this pull request as ready for review July 29, 2026 12:04
@aledudek
aledudek requested review from a team as code owners July 29, 2026 12:04
@github-actions github-actions Bot added the rocke: platform Touches rocKE platform label Aug 10, 2026
@bartekxk
bartekxk enabled auto-merge (squash) August 11, 2026 10:39
@bartekxk
bartekxk merged commit 3d75839 into develop Aug 15, 2026
36 checks passed
@bartekxk
bartekxk deleted the users/aledudek/rocke-grouped-conv branch August 15, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants