Skip to content
所有標籤

#performance

9 篇文章

Cloudflare Cache Rules:什麼該快取,什麼要保持動態

Cloudflare Cache Rules 是 zone 層的快取政策:用 request expression 決定哪些內容 eligible for cache、Edge TTL/Browser TTL 怎麼算、cache key 包哪些維度,以及遇到 stale、ETag、purge 時怎麼處理。它適合管理 CDN 快取規則;Worker Cache API 則適合程式化存取。

Cloudflare Images 怎麼用:圖片變體、格式轉換與交付管線

Cloudflare Images 有兩條路:把 R2/S3/origin 圖片拿來做 edge transformations,或直接把圖片存進 Images 再用 variant delivery。前者按 unique transformations 看成本,後者還要看 stored 和 delivered images。

Cloudflare Smart Shield 怎麼用:讓 Origin 少扛一點流量

Smart Shield 是 Cloudflare 的 origin protection bundle:用 Smart Tiered Cache、connection reuse、Argo Smart Routing、Regional Tiered Cache、Cache Reserve、Health Checks 和 Dedicated CDN Egress IPs,減少打到 origin 的 request 與 connection。

CS336 Lecture 5:GPU 快不是因為每個 thread 快,而是資料少搬幾次

第五講從 SM、warp 與記憶體階層解釋 GPU,再用低精度、fusion、recomputation、coalescing 與 tiling 統一常見優化;FlashAttention 正是這些原則在 attention 上的組合。

CS336 Lecture 6:寫 Triton kernel 前,先學會 benchmark 與 profile

第六講把 GPU 原理落到 kernel:benchmark 看不同尺寸如何縮放,profiler 看實際呼叫與時間,再以 Triton 實作 GeLU、softmax、reduction 與 tiled matmul;快的前提是先量對。

CS336 Lecture 2:先算 FLOPs 與記憶體,再談模型跑不跑得動

第二講把模型訓練還原成 tensor、FLOPs、bytes 與時間:用 einops 管維度,以 arithmetic intensity 和 roofline 判斷瓶頸,再用 gradient accumulation 與 activation checkpointing 交換運算和記憶體。

Stanford CS107 Lecture 25:Caching、Memory Hierarchy 與 Locality

CS107 第 25 講用精簡投影片建立 cache 的核心模型:記憶體存取成本不均,較小且較快的層級保存可能再次使用的資料,而 temporal 與 spatial locality 決定程式能否受益。

ai guide RAG 技法大全

RAG 成本優化:把每次查詢的花費壓到最低

RAG 系統的成本來自 LLM token、Embedding API、向量搜尋。每個環節都有可以壓成本的地方,但要確認優化沒有犧牲太多品質。

ai guide RAG 技法大全

Semantic Caching:語義相近的問題只跑一次 RAG

快取不只能比對完全一樣的查詢,語義相近的問題也能命中快取,省下整個 RAG pipeline 的執行。