Roofline Model
রুফলাইন মডেল
একটা log-log প্লট যা বলে দেয় একটা kernel compute-bound না memory-bound — arithmetic intensity (FLOPs/byte) আর hardware-এর peak GFLOPS/bandwidth থেকে।
also: arithmetic intensity, ridge point, operational intensity
দুইটা hard ceiling — peak compute (অনুভূমিক) আর AI × peak bandwidth (কোণাকার, log-log-এ slope 1):
যেখানে ধরনের সীমারেখা মেলে সেটাই ridge point:
উদাহরণ: Peak 400 GFLOPS, peak BW 50 GB/s → AI_{ridge} = 8।
| Kernel | AI (FLOPs/byte) | Region | Ceiling |
|---|---|---|---|
SAXPY (y=ax+y) | 0.083 | memory-bound | 4.2 GFLOPS |
| Naive matmul | 0.75 | memory-bound | 37.5 GFLOPS |
| Tiled matmul | 30 | compute-bound | 400 GFLOPS |
গুরুত্বপূর্ণ: AI algorithm-এর ধ্রুব বৈশিষ্ট্য না —
implementation-এর data-reuse pattern-এর বৈশিষ্ট্য। Naive আর tiled
matmul-এর FLOP সংখ্যা হুবহু সমান, শুধু loop order বদলে AI 0.75
থেকে 30-এ লাফ দেয়, কারণ tiling loaded data cache-এ থাকা অবস্থায়
পুনর্ব্যবহার করে — নতুন DRAM trip লাগে না।
Memory-bound region-এ SIMD/threading কোনো লাভ দেয় না (bottleneck ALU না, memory bus) — সেখানে দরকার cache blocking। Compute-bound region-এ উল্টোটা সত্য। ভুল দিকে optimize করা এই মডেলের সবচেয়ে সাধারণ অপচয়।