Skip to content

refactor(kernels): the Marlin face serves both consumers from one module - #1020

Merged
FeathBow merged 1 commit into
pegainfer-project:mainfrom
FeathBow:refactor/kernels-marlin-face
Aug 31, 2026
Merged

refactor(kernels): the Marlin face serves both consumers from one module#1020
FeathBow merged 1 commit into
pegainfer-project:mainfrom
FeathBow:refactor/kernels-marlin-face

Conversation

@FeathBow

Copy link
Copy Markdown
Collaborator

Description

Closes #1019

The gemma4 and Kimi Marlin wrappers each carried the same buffer-to-pointer plumbing for the grouped GEMM and the align launch. A shared ops/marlin_face.rs now owns that face, generic over the scale type (u8 for the NVFP4 face, Half for WNA16 — an alias of the same width, so the shared pointers feed both FFIs unchanged); the launch functions consume their buffer structs by destructuring and hand each consumer a pointer set for its own FFI call. The FFI entry points, argument arithmetic and stream selection stay with their consumers, and no exported symbol changes name or signature.

Test Env

Single GPU (sm_89, 48 GiB, x86_64), the kimi-k2 leg compiles with an sm_90 target override, which the moe chain's DeepEP shim requires.

Verification

  • cargo fmt --all -- --check and git diff --check pass.
  • The gemma4 consumer: cargo clippy --release --features gemma4 -p pegainfer-kernels --all-targets -- -D warnings passes at the exact head.
  • The Kimi consumer: PEGAINFER_CUDA_SM=90 cargo check --release --features kimi-k2 -p pegainfer-kernels passes at the exact head, 0 errors.
  • Zero symbol renames by construction: the diff touches no pub fn signature, no extern declaration and no entry-point string; consumers outside the two wrapper files compile without edits.

@FeathBow
FeathBow merged commit 6dca8a2 into pegainfer-project:main Aug 31, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kernels: the Marlin face is duplicated across its two consumers

1 participant