Repository navigation
[MiniMax-M3.1] FP4 index cache and NVFP4 sparse KV cache #2744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
4703d1d
00f9515
dc569d7
55eddeb
fe19c72
bfa508b
58764da
aa4a812
357e1c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,13 +79,17 @@ def kv_layout_selectors() -> dict[str, Any]: | |
| it spawns read the same environment. A switch a model does not use costs a | ||
| miss across servers that differ in it, never another layout's KV. | ||
| """ | ||
| return { | ||
| selectors = { | ||
| "mla_page_size": int(envs.ATOM_MLA_PAGE_SIZE), | ||
| "triton_mla": bool(envs.ATOM_USE_TRITON_MLA), | ||
| "triton_mla_shuffle_kv": bool(envs.ATOM_USE_TRITON_MLA_SHUFFLE_KV), | ||
| "unified_attn": bool(envs.ATOM_USE_UNIFIED_ATTN), | ||
| "force_attn_triton": bool(envs.ATOM_FORCE_ATTN_TRITON), | ||
| } | ||
| # MiniMax-M3's NVFP4 sparse K/V; present only when set, so other keys keep. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this selector: |
||
| if envs.ATOM_M3_SPARSE_KV_NVFP4: | ||
| selectors["m3_sparse_kv_nvfp4"] = True | ||
| return selectors | ||
|
|
||
|
|
||
| def kv_storage_formats(config: Any) -> dict[str, str]: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boundary:
m3_reuses_index_topkis just a forwarding wrapper with a local import, and M3-specific rules (m3_fp4_cache_unsupported_reason,m3_nvfp4_stage_unsupported_reason) live in the sharedconfig.py; indexer CP's fp4 refusal is a special case outside the pureindexer_cp_unsupported_reason.index_schedule.pyis already a pure config module — move these three there, drop the wrapper, and put the CP refusal inside the reason function. Alsosparse_attn_nvfp4.checksays "needs 16 heads" though config already enforces the head count (the runtime failure would be alignment/addressing), and docs are stale:mha_kv_pool'skv_views/scale_viewsdocstrings still say SHUFFLE/fp32,attention_mha.py:1372still says "binder has no M3-specific code", andkv_poolsis still annotatedtuple[int, int].