Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

GGUF dequant transient: numpy-fallback (IQ) types over-reserve device memory ~4x

クローズ
#9,718 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@wunianze666-netizen がすでに取り組んでいます。

2026年10月15日 から。

  • #9862 @wunianze666-netizen による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
numpy, python, pytorch

調査の方向性

Start in the function that computes peak_ggml_linear_dequant_transient_bytes and its _DEQUANT_INTERMEDIATE_BYTES_PER_ELEMENT table, then read GGMLTensor.get_dequantized_tensor to confirm the host fallback through gguf.quants.dequantize. Change the default for types that are neither torch-compatible nor in DEQUANTIZE_FUNCTIONS to 0 intermediates, and check the IQ4_XS and IQ4_NL estimates against the measured ratios in the issue. Done when those types report no device intermediates and the existing estimate tests still pass.

索引モデルが issue の本文から書いたものです。

説明

Follow-up from #9709 (review at 59c851290a).

peak_ggml_linear_dequant_transient_bytes gives every quantization type missing from _DEQUANT_INTERMEDIATE_BYTES_PER_ELEMENT the worst-case 8 B/element of device intermediates. Those types (the IQ family) are exactly the ones without a GPU kernel: GGMLTensor.get_dequantized_tensor decodes them through gguf.quants.dequantize on the host and then calls .to(device, dtype=compute_dtype), which casts on the CPU before the copy. On the device, the only allocation is the result.

Measured on a W7900 (torch 2.13 + ROCm 7.2), 3072×12288 weight, bf16 compute dtype:

Type Device intermediates Estimate / (peak + packed)
IQ4_XS 0.00 B/el 4.16
IQ4_NL 0.00 B/el 4.12

The nodes that add the term to an activation estimate (FLUX.2, Krea-2, Z-Image, Ideogram 4) therefore over-reserve by 8 B per element of the largest layer. By the FLUX.2 dev numbers in #9709, that is roughly 2.5 GiB, which is the kind of over-reservation #9709 replaced the flat bound to avoid.

Suggested fix: use 0 intermediates for any type that is neither torch-compatible nor in DEQUANTIZE_FUNCTIONS, since every such type takes the host fallback. The fallback's real cost is host RAM (the float32 numpy decode), which nothing reserves. That could be tracked separately.

主要言語
TypeScript
スター
28.8k
フォーク
3.1k
平均マージ
3日 2時間
マージ済み PR(30日)
150

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

invoke-ai/InvokeAI のほかの issue

invoke-ai/InvokeAI の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。