Skip to content

feat(ck-tile): add tile engine dispatcher bridges for 5 block_scale_g… - #10018

Closed
ThruptiRajLakshmanaGowda wants to merge 2 commits into
developfrom
users/tlakshma/ck/te_bridge_blockscale
Closed

ThruptiRajLakshmanaGowda wants to merge 2 commits into
developfrom
users/tlakshma/ck/te_bridge_blockscale

Conversation

@ThruptiRajLakshmanaGowda

@ThruptiRajLakshmanaGowda ThruptiRajLakshmanaGowda commented Jul 27, 2026 •

Copy link
Copy Markdown
Contributor

Add registry-bypass, single-kernel-per-.so TE→Dispatcher bridges for all five block_scale_gemm operators, following the pattern established by the merged grouped_gemm_bquant bridge (PR #9166) and mxgemm bridge (PR #9329).

Each operator gets four files:

  • codegen/unified_gemm_{op}_codegen.py — per-kernel .hpp generator
  • bindings/ctypes/gemm_{op}_ctypes_lib.cpp — C ABI calling SelectedKernel::launch(QuantGemmHostArgs)
  • python/gemm_{op}_utils.py — KernelConfig / DispatcherLib / GpuRunner / build helpers
  • tests/test_gemm_{op}_utils.py — 164 CPU-only unit tests total, all passing

Operators and QuantType mappings:
gemm_bquant → QuantType::BQuantGrouped (gemm_bquant_* naming, block_scale_gemm)
gemm_aquant → QuantType::AQuantGrouped (AQ=[M,QK_A], BQ=nullptr)
gemm_abquant → QuantType::ABQuantGrouped (AQ row-major, BQ col-major [QK_B,QN_B])
gemm_rowcolquant → QuantType::RowColQuant (AQ=[M,1], BQ=[1,N], no preshuffle)
gemm_tensorquant → QuantType::TensorQuant (AQ and BQ single scalars)

Key implementation notes:

  • All ctypes libs exclude dispatcher/include to avoid QuantGemmHostArgs conflicts
  • rowcolquant TileGemmQuantTraits needs extra UsePersistentKernel+16 args
  • tensorquant uses BaseWeightPreshufflePipelineAGmemBGmemCRegV2 (not BaseGemmPipelineAgBgCrCompV3)
  • gemm_bquant uses "default" epilogue (DefaultGemm2DEpilogue), distinct from grouped_gemm_bquant

Also adds:

  • codegen_common.py: make_gemm_bquant/aquant/abquant/rowcolquant/tensorquant_kernel_name helpers
  • CMakeLists.txt: 5 new double-guarded CMake targets (dispatcher_gemm_{op}_lib)

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

…emm operators

Add registry-bypass, single-kernel-per-.so TE→Dispatcher bridges for all five
block_scale_gemm operators, following the pattern established by the merged
grouped_gemm_bquant bridge (PR #9166) and mxgemm bridge (PR #9329).

Each operator gets four files:
- codegen/unified_gemm_{op}_codegen.py   — per-kernel .hpp generator
- bindings/ctypes/gemm_{op}_ctypes_lib.cpp — C ABI calling SelectedKernel::launch(QuantGemmHostArgs)
- python/gemm_{op}_utils.py              — KernelConfig / DispatcherLib / GpuRunner / build helpers
- tests/test_gemm_{op}_utils.py          — 164 CPU-only unit tests total, all passing

Operators and QuantType mappings:
  gemm_bquant      → QuantType::BQuantGrouped  (gemm_bquant_* naming, block_scale_gemm)
  gemm_aquant      → QuantType::AQuantGrouped  (AQ=[M,QK_A], BQ=nullptr)
  gemm_abquant     → QuantType::ABQuantGrouped (AQ row-major, BQ col-major [QK_B,QN_B])
  gemm_rowcolquant → QuantType::RowColQuant    (AQ=[M,1], BQ=[1,N], no preshuffle)
  gemm_tensorquant → QuantType::TensorQuant    (AQ and BQ single scalars)

Key implementation notes:
- All ctypes libs exclude dispatcher/include to avoid QuantGemmHostArgs conflicts
- rowcolquant TileGemmQuantTraits needs extra UsePersistentKernel+16 args
- tensorquant uses BaseWeightPreshufflePipelineAGmemBGmemCRegV2 (not BaseGemmPipelineAgBgCrCompV3)
- gemm_bquant uses "default" epilogue (DefaultGemm2DEpilogue), distinct from grouped_gemm_bquant

Also adds:
- codegen_common.py: make_gemm_bquant/aquant/abquant/rowcolquant/tensorquant_kernel_name helpers
- CMakeLists.txt: 5 new double-guarded CMake targets (dispatcher_gemm_{op}_lib)

Co-Authored-By: Claude <noreply@anthropic.com>
@therock-pr-bot

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

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
🌿 Branch Name ✅ Pass —
📝 PR Title/Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 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.

@therock-pr-bot

Copy link
Copy Markdown

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

@ThruptiRajLakshmanaGowda

Copy link
Copy Markdown
Contributor Author

Changes are ported to PR : #10439

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.

1 participant