引導式測驗 · 中等 等級

KV 快取優化測驗

檢查 KV 快取成長、分頁分配、分組查詢共享、前綴重用條件、量化以及上下文和並發性的記憶體擴充。

相關引導路徑Kv快取優化
問題 1 的 8

KV 快取儲存什麼以及為什麼?

預覽每個問題8 問題

當您參加測驗時,就會出現答案和解釋。

  1. KV 快取儲存什麼以及為什麼?
    • 先前計算的注意鍵和值,因此不會在每個步驟中重新計算它們
    • 用於再訓練的模型訓練數據
    • 用於身份驗證的使用者密碼
    • 僅最終文字輸出
  2. 為什麼KV快取會成為記憶體問題?
    • 它會永久損壞 GPU
    • 它隨著序列長度、批量大小和層數而增長,有時超過模型權重
    • 它僅適用於少於 10 個單字的文本
    • 它複製作業系統
  3. PagedAttention 借用了什麼作業系統概念?
    • 磁碟碎片整理實用程式
    • 防病毒掃描
    • 具有固定大小區塊的虛擬記憶體分頁
    • 螢幕解析度縮放
  4. Grouped-Query 和 Multi-Query Attention 如何減少 KV 快取大小?
    • 透過刪除注意力機制
    • 透過將快取儲存為圖像
    • 透過更少的資料進行訓練
    • 透過讓許多查詢頭共享更少的鍵/值頭
  5. KV 快取中前綴共享的好處是什麼?
    • 具有相同啟動提示的請求可以重複使用相同的快取區塊
    • 它對模型進行加密
    • 它同樣減慢了每個請求的速度
    • 它消除了關注的需要
  6. Compared with storing the same KV entries in 16-bit, what does 8-bit storage do to raw cache-value bytes?
    • It doubles the raw bytes
    • It roughly halves the raw bytes, before metadata and other runtime memory
    • It removes the key and value tensors entirely
    • It guarantees twice the inference speed
  7. With full-context attention, no prefix sharing, and a fixed model and cache dtype, what happens if sequence length and batch size both double?
    • It stays constant because model weights are fixed
    • It roughly doubles
    • Raw KV storage grows to roughly four times its previous size
    • It becomes one quarter as large
  8. What must generally match for two requests to reuse the same cached prefix blocks?
    • Only the user account name
    • The requests must have different model weights
    • The prompts must have the same character count but different tokens
    • Their tokenized prefix and relevant model/cache configuration must be compatible