[CUDA][Muse-Glimmer] Clarify KV capacity and memory requirements for 128K serving
メンテナーはふだん 1 日以内に返信
@Gasoonjia がすでに取り組んでいます。
2026年11月25日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 22/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
Start with the CudaExecutor capacity check in backends/cuda/batching/cuda_executor.cpp near line 507 and the sequence KV pool sizing in backends/cuda/runtime/cuda_kv_cache.cpp near line 1169, then read examples/models/muse-glimmer/export/export_solo.py for the --kv-layout and --max-cells flags. Done means a documented 128K CUDA configuration with a KV memory budget formula, plus a startup error that breaks down live, prefix and capture reservations; this needs a GPU run to validate.
索引モデルが issue の本文から書いたものです。
説明
Describe the problem
A Muse-Glimmer CUDA text-only solo export with --max-seq-len 131072 and --max-cells 131072 succeeds, but cannot start serving with a 131072-token context. The cell budget is shared across live sessions, retained prefixes and in-progress prefix captures, and one cell is reserved for padding.
With four live sessions, eight retained prefix slots and four capture slots, startup reports:
CudaExecutor: 16 sessions of 131072 tokens exceed the program's 131072 cells, one of which is reserved
batching worker failed: could not create batching Muse Glimmer executor: error 18
The runtime admission check is appropriate. The problem is that the export's maximum sequence length can be mistaken for its usable serving context, and the export/serving configuration does not make the required total KV capacity and memory budget clear. This was a configuration mistake in our export, not evidence that CUDA cannot support 128K.
Versions and model
- ExecuTorch revision:
799098d28233ec11cba62c57a3484d48185f741f - PyTorch
2.15.0+cu132, Python 3.12, CUDA toolkit 13.2 (nvcc V13.2.86), driver 610.43.02 - GPU: NVIDIA PG509-210, sm80, 80 GB
- Source: meta-models/Muse-Glimmer-30B-GGUF, revision
b44f1072cf75e918a1b82a3a17b45c4389b076e7 - File:
Muse-Glimmer-30B-KQuant-17GB-Q4_K_M.gguf - BF16 activations and KV; no DFlash or vision
Reproduction
python -m executorch.examples.models.muse_glimmer.export.export_solo \
--gguf "$GGUF" --backend cuda --activation-dtype bfloat16 \
--use-offgraph-kv-cache --kv-layout cell \
--max-seq-len 131072 --max-cells 131072 \
--max-step-tokens 512 --forward-sizes 1,4 \
--output-dir "$OUT"
The export completed successfully in approximately 30 minutes and produced model.pte plus aoti_cuda_blob.ptd.
Start the upstream batching worker with the model and its tokenizer:
muse_glimmer_batching_worker \
--backend=cuda --pte="$OUT/model.pte" \
--data_path="$OUT/aoti_cuda_blob.ptd" --tokenizer="$TOKENIZER" \
--max_sessions=4 --max_inflight_requests=4 --max_decode_sequences=4 \
--max_session_tokens=131072 --prefix_cache_entries=8 \
--prefix_capture_slots=4 --prefix_checkpoint_prompt_end=every
Startup fails with the admission error above. The same export serves successfully when --max_session_tokens=8191; the installed Muse-Glimmer package's standard live smoke test passed with that context. Model loading on this host required a newer libstdc++ runtime; this issue concerns the subsequent KV-capacity check.
Capacity and memory implications
For this cell-layout configuration:
reserved contexts = 4 live + 8 prefixes + 4 captures = 16
maximum context per reserved slot = floor((131072 - 1) / 16) = 8191
cells needed for 16 × 131072-token contexts = 16 × 131072 + 1 = 2097153
Even a single full 131072-token context needs at least 131073 cells with this padding convention.
Simply enlarging the shared pool is expensive. This model has 52 layers, two KV heads and head dimension 128. With BF16 K and V, the cell layout uses:
bytes per cell = 52 × 2 (K/V) × 2 KV heads × 128 × 2 bytes = 53248
2097153 cells × 53248 bytes ≈ 104 GiB of KV storage
That exceeds the 80 GiB GPU before weights and execution workspace.
The existing sequence layout looks promising because sliding-window layers use ring buffers. For 16 reserved sequences plus its padding column, 13 global layers at 131072 rows and 39 sliding layers at 2048 + 512 - 1 rows imply roughly 29.2 GiB of full-capacity BF16 KV storage. This is a source-derived estimate, not a measured full-context result. A --kv-layout sequence --max-kv-seqs 16 export is being evaluated; full 128K inference has not yet been validated.
Requested improvement
Please document a working 128K CUDA export/serving configuration that accounts for live sessions, retained prefixes, capture slots and padding. It would also help to:
- Report the supported per-session context for a cell export and the requested serving slot configuration.
- Show how to calculate the required cell/sequence budget and estimated KV memory before a long export.
- Make the startup error break down live/prefix/capture reservations and suggest a compatible context or export configuration.
- Clarify when sequence layout with sliding-window ring buffers is preferable to enlarging the shared cell pool.
Relevant revision-pinned source: export_solo.py, CudaExecutor capacity check, and sequence KV pool sizing.
- 主要言語
- Python
- スター
- 5.2k
- フォーク
- 1.3k
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 644
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytorch/executorch のほかの issue
-
to_edge_transform_and_lower ignores some ops_to_not_decompose requests: multi-output ops, and non-core ops without a decomposition対応中かも @Eureka-Zhang が 7 日前に担当しました。 オープンmodule: exir
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
pytorch/executorch#25620 ·
メンテナーはふだん 1 日以内に返信
-
Qualcomm AI Engine Direct - fp16a8w quantization crashes on layer_norm対応中かも @psiddh が 21 日前に担当しました。 オープンbug module: qnn partner: qualcomm
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
pytorch/executorch#24434 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement triaged
難易度 2/5 半日 初心者へのやさしさ 68/100
pytorch/executorch#21640 ·
メンテナーはふだん 1 日以内に返信
-
quantize_per_channel and dequantize_per_tensor.tensor abort the process on a float32 scale対応中かも @AxelNoun が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
pytorch/executorch#25873 ·
メンテナーはふだん 1 日以内に返信
-
XNNPACK INT4 linear returns incorrect per-channel outputs and fails groupwise FP16 on Apple M4 Max対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug module: quantization module: xnnpack
難易度 4/5 3〜5日 初心者へのやさしさ 43/100
pytorch/executorch#25854 ·
メンテナーはふだん 1 日以内に返信
pytorch/executorch の issue をすべて見る
似ている issue
-
Container fails to start when GitHub Releases is unavailable: uv run re-downloads the tvl wheelオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
trezor/trezor-user-env#421 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 91/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
tangentcode/tangentswarm#167 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信