Skip to content

ucm layerwise support MiniMax-m3 - #1090

Open
snoopyri wants to merge 1 commit into
ModelEngine-Group:developfrom
snoopyri:feat/minimax-m3-model-adaptation
Open

ucm layerwise support MiniMax-m3#1090
snoopyri wants to merge 1 commit into
ModelEngine-Group:developfrom
snoopyri:feat/minimax-m3-model-adaptation

Conversation

@snoopyri

@snoopyri snoopyri commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Purpose

Add layerwise KV-cache support for MiniMax-M3 on Ascend, whose dense and sparse layers use heterogeneous K/V cache layouts. Ensure transfer paths can safely handle padding entries introduced by the unified layout.

Modifications

Modifications

  • Detect MiniMax-M3 sparse-attention models and select a dedicated AscendMiniMaxM3Layout when running on Ascend with layerwise transfer enabled.

  • Add AscendMiniMaxM3Layout to normalize per-layer KV cache layouts into three logical components:

    • Dense layers: [K, V, null]
    • Sparse layers: [K first half, K second half, V]
  • Validate KV tensor types, shapes, and strides before constructing the layout.

  • Preserve per-component base addresses, buffer sizes, copy sizes, and physical block strides for correct layerwise addressing.

  • Update generic stream and Ascend SDMA-direct transfer paths to skip null/zero-sized device buffers.

  • Zero-fill host-side padding regions during device-to-host transfers, ensuring deterministic serialized cache blocks for dense-layer padding.

Test

@snoopyri
snoopyri force-pushed the feat/minimax-m3-model-adaptation branch 4 times, most recently from 883a1db to 680d33e Compare July 20, 2026 00:56
@snoopyri
snoopyri force-pushed the feat/minimax-m3-model-adaptation branch 6 times, most recently from 69e1230 to 3c96fbe Compare July 24, 2026 07:15
@snoopyri
snoopyri force-pushed the feat/minimax-m3-model-adaptation branch from 3c96fbe to de18b42 Compare July 25, 2026 01:03
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.

1 participant