Majid Al-RaimiReference sheetالورقة المرجعية

COE 592Lecture 01المحاضرة 01Referenceالمرجع

Reference sheetالورقة المرجعية

Why efficient deep learning compressed onto one page: the definitions, formulas and numbers to have in your head before a quiz or exam.محاضرة «لماذا التعلم العميق الكفء» مضغوطة في صفحة واحدة: التعريفات والمعادلات والأرقام التي يجب أن تكون حاضرة في ذهنك قبل الاختبار القصير أو الامتحان.

The course question and the three pillarsسؤال المقرر والركائز الثلاث

Keep accuracy as high as possible under the budget the target device imposes. Progress comes from algorithm, hardware and data improving together; efficiency work reshapes the first two. Part 01: Accuracy at a cost

حافظ على الدقة في أعلى مستوى ممكن ضمن الميزانية التي يفرضها الجهاز المستهدف. التقدم يأتي من تحسن الخوارزمية والعتاد والبيانات معا، وعمل الكفاءة يعيد تشكيل الأولين منها. الجزء 01: الدقة بثمن

max⁡θ, A Acc(θ,A)s.t.MACs≤C,  Memory≤M,  Latency≤T,  Energy≤E\max_{\theta,\ \mathcal{A}}\ \text{Acc}(\theta, \mathcal{A}) \quad \text{s.t.}\quad \text{MACs} \le C,\ \ \text{Memory} \le M,\ \ \text{Latency} \le T,\ \ \text{Energy} \le E
Efficient deep learning as a budgeted optimizationالتعلم العميق الكفء بوصفه تحسينًا ذا ميزانية
PillarالركيزةAlexNet 2012AlexNet 2012Efficiency leverرافعة الكفاءة
AlgorithmالخوارزميةDeep CNN, ReLU, dropout, SGDشبكة CNN عميقة، وReLU، وdropout، وSGDPruning, quantization, distillation, NASالتقليم (pruning)، والتكميم (quantization)، والتقطير (distillation)، وNAS
HardwareالعتادTwo GTX 580 GPUs, 3 GB each, about six daysوحدتا GTX 580، لكل منهما 3 GB، ونحو ستة أيامAccelerators: cloud GPU, phone NPU, Jetson, microcontrollerالمسرّعات: GPU سحابية، وNPU في الهاتف، وJetson، ومتحكم دقيق
DataالبياناتImageNet, about 1.2 million images, 1000 classesImageNet، نحو 1.2 مليون صورة، و1000 فئةData that stays on the device and drives local learningبيانات تبقى على الجهاز وتقود التعلم المحلي
Three pillars, what each gave AlexNet in 2012, and the efficiency leverالركائز الثلاث، وما قدمته كل منها لـ AlexNet في 2012، ورافعة الكفاءة
  • Privacy: raw data stays where it was collected.الخصوصية: تبقى البيانات الخام حيث جُمعت.
  • Cost: fewer GPU hours, smaller cloud bills, less carbon (OFA: one specialized net per target emits the CO2 of five cars).التكلفة: ساعات GPU أقل، وفواتير سحابية أصغر، وكربون أقل (في OFA: تدريب شبكة متخصصة لكل جهاز مستهدف يطلق من CO2 ما تطلقه خمس سيارات).
  • Connectivity: the model works where the network does not.الاتصال: يعمل النموذج حيث لا تعمل الشبكة.
  • Energy: milliwatt devices need models sized for milliwatts.الطاقة: الأجهزة التي تعمل بالملّي واط تحتاج نماذج على مقاس الملّي واط.

ImageNet metrics and the winnersمقاييس ImageNet والفائزون

errtop-5=1N∑i=1Nmin⁡j∈{1,…,5}1[cij≠Ci]\text{err}_{\text{top-5}} = \frac{1}{N}\sum_{i=1}^{N} \min_{j \in \{1,\dots,5\}} \mathbb{1}\big[c_{ij} \ne C_i\big]
Image i is wrong only if none of its five labels equals the true labelالصورة i خاطئة فقط إذا لم تساوِ أيٌّ من تسمياتها الخمس التسميةَ الصحيحة
PropertyالخاصيةTop-5 errorخطأ top-5Top-1 accuracyدقة top-1
Counts as correct whenتُحسب الإجابة صحيحة عندماAny of five returned labels matchesتطابق أيٌّ من التسميات الخمس المُعادة التسمية الصحيحةThe single top label matchesتطابق التسمية الأولى وحدها التسمية الصحيحة
StrictnessالصرامةLenient, always the better scoreمتساهل، ودرجته دائما هي الأفضلStrict, always the worse scoreصارم، ودرجته دائما هي الأسوأ
Used on slideمستخدم في الشريحة4الشريحة 45, 6الشريحتان 5 و6
Typical pairingالاقتران المعتادabout 5% errorخطأ نحو 5%75 to 80% accuracyدقة من 75 إلى 80%
Top-5 error versus top-1 accuracyخطأ top-5 مقابل دقة top-1
YearالسنةWinnerالفائزTop-5 error (%)خطأ top-5 (%)
2010NEC28.2
2011XRCE25.8
2012SuperVision (AlexNet), first deep CNN winnerSuperVision (AlexNet)، أول شبكة CNN عميقة تفوز16.4
2013Clarifai11.7
2014GoogLeNet, 22 layersGoogLeNet، 22 طبقة6.7
2015ResNet, 152 layers, first below humanResNet، 152 طبقة، وأول من نزل تحت مستوى الإنسان3.57
2016Trimps-Soushen2.99
2017SENet2.25
HumanالإنسانOne trained annotatorمُعلِّم بيانات واحد مدرَّب5.1
ILSVRC winning entries, top-5 error on the test setالمشاركات الفائزة في ILSVRC، وخطأ top-5 على مجموعة الاختبار

MACs, parameters and diminishing returnsMACs والمعاملات وتناقص العائد

A MAC is one multiply plus one accumulate, counted per input, independent of hardware. Parameters count storage. One MAC is two FLOPs when a source counts them separately; the ResNet paper labels multiply-adds as FLOPs, so its 3.8 x 10^9 equals Sze's 3.9 GMACs. Part 01: Accuracy at a cost

عملية MAC هي ضرب واحد مع جمع تراكمي واحد، تُعد لكل مدخل، وهي مستقلة عن العتاد. أما المعاملات فتقيس التخزين. تساوي MAC الواحدة عمليتي FLOPs عندما يعدّهما المصدر منفصلتين، لكن ورقة ResNet تسمي عمليات الضرب والجمع FLOPs، لذلك فإن رقمها 3.8 x 10^9 يساوي 3.9 GMACs عند Sze. الجزء 01: الدقة بثمن

MACsconv=Hout⋅Wout⋅Cout⋅Cin⋅kh⋅kw\text{MACs}_{\text{conv}} = H_{\text{out}} \cdot W_{\text{out}} \cdot C_{\text{out}} \cdot C_{\text{in}} \cdot k_h \cdot k_w
3 x 3, 64 in, 64 out, 56 x 56 map: 56 x 56 x 64 x 64 x 9 = 115.6 M MACsنواة 3 x 3، و64 قناة دخل و64 قناة خرج، وخريطة 56 x 56: 56 x 56 x 64 x 64 x 9 = 115.6 M MACs
ModelالنموذجMACs (B)MACs (مليار)Top-1 (%)Top-1 (%)Parametersالمعاملات
MobileNetV10.5770.64.2 M
ResNet-503.976.025.5 M
InceptionV35.778.8about 24 Mنحو 24 M
ResNet-1017.676.444.5 M
Xception8.479.0about 23 Mنحو 23 M
Once-for-All (searched)Once-for-All (ناتج البحث)0.59580.0about 7 Mنحو 7 M
Slide 5 and 6 anchors (x is MACs, y is top-1, bubble area is parameters, goal is the upper left)مراسي الشريحتين 5 و6 (المحور x هو MACs، والمحور y هو top-1، ومساحة الفقاعة هي عدد المعاملات، والهدف هو الزاوية العلوية اليسرى)

Points of top-1 per extra billion MACsنقاط top-1 لكل مليار MACs إضافي

MobileNetV1 to ResNet-50من MobileNetV1 إلى ResNet-50
(76.0 - 70.6) / (3.9 - 0.57) = 1.6 points per billion(76.0 - 70.6) / (3.9 - 0.57) = 1.6 نقطة لكل مليار
ResNet-50 to Xceptionمن ResNet-50 إلى Xception
(79.0 - 76.0) / (8.4 - 3.9) = 0.67 points per billion(79.0 - 76.0) / (8.4 - 3.9) = 0.67 نقطة لكل مليار
ResNet-50 to ResNet-101من ResNet-50 إلى ResNet-101
(76.4 - 76.0) / (7.6 - 3.9) = 0.11 points per billion(76.4 - 76.0) / (7.6 - 3.9) = 0.11 نقطة لكل مليار

Efficient models and the Pareto frontierالنماذج الكفؤة وحد باريتو (Pareto frontier)

Reduction ratio is reference MACs divided by new MACs in one unit. Once-for-All: 80.0% at 595 M MACs, inside the 600 M mobile setting. Part 01: Accuracy at a cost

نسبة التخفيض هي MACs النموذج المرجعي مقسومة على MACs النموذج الجديد بوحدة واحدة. Once-for-All: دقة 80.0% عند 595 M من MACs، أي ضمن إعداد الهاتف المحدد بـ600 M. الجزء 01: الدقة بثمن

ReferenceالمرجعMACsMACsTop-1 (%)Top-1 (%)Reductionالتخفيض
Xception8400 M79.08400 / 595 = 14.1x
ResNet-503900 M76.03900 / 595 = 6.6x
MobileNetV1569 M70.60.96x, 9.4 points less accurate0.96x، ودقة أقل بـ9.4 نقطة
Once-for-All against handcrafted referencesOnce-for-All مقابل المراجع المصممة يدويا
A≻B  ⟺  AccA≥AccB ∧ MACsA≤MACsB, with at least one strictA \succ B \iff \text{Acc}_A \ge \text{Acc}_B \ \wedge\ \text{MACs}_A \le \text{MACs}_B,\ \text{with at least one strict}
Dominance; the frontier is the set of undominated models, and NAS moves it to the upper leftالهيمنة؛ الحد هو مجموعة النماذج غير المهيمَن عليها، وNAS تزيحه نحو الأعلى واليسار

TinyML and on-device learningTinyML والتعلم على الجهاز

MCUNet runs mask and person detection on an OpenMV Cam (Cortex-M7). Reference MCU STM32F746: 320 kB SRAM, 1 MB flash, no OS, no DRAM. TinyNAS searches under the memory limits; TinyEngine runs without interpreter overhead. Part 01: Accuracy at a cost

يشغّل MCUNet كشف الكمامات وكشف الأشخاص على كاميرا OpenMV Cam (Cortex-M7). المتحكم الدقيق المرجعي STM32F746: ذاكرة SRAM قدرها 320 kB، وذاكرة flash قدرها 1 MB، بلا نظام تشغيل وبلا DRAM. يبحث TinyNAS عن معمارية ضمن حدود الذاكرة، ويشغّل TinyEngine النموذج دون عبء مفسّر (interpreter). الجزء 01: الدقة بثمن

TierالمستوىMemoryالذاكرةStorageالتخزينGap from the tier aboveالفجوة عن المستوى الأعلى
Cloud AI (V100)ذكاء السحابة (V100)16 GBTB to PBمن TB إلى PBreferenceالمرجع
Mobile AI (iPhone 11)ذكاء الهاتف (iPhone 11)4 GBmore than 64 GBأكثر من 64 GB4x memory, 1000x storage4x في الذاكرة، و1000x في التخزين
Tiny AI (STM32F746)الذكاء الصغير جدا (STM32F746)320 kB1 MB3100x memory, 64000x storage3100x في الذاكرة، و64000x في التخزين
MCUNet Table 1الجدول 1 في MCUNet

Why nothing off the shelf fitsلماذا لا يتسع أي نموذج جاهز

ResNet-50 FP32 weightsأوزان ResNet-50 بدقة FP32
25.5 M x 4 B = 102 MB, 102x over 1 MB flash25.5 M x 4 B = 102 MB، أي 102x فوق ذاكرة flash البالغة 1 MB
ResNet-50 INT8 weightsأوزان ResNet-50 بدقة INT8
25.5 MB, still 25x over25.5 MB، وما زالت فوق الحد بـ25x
MobileNetV2 peak activationذروة التنشيطات في MobileNetV2
6.8 MB FP32 (22x), 1.7 MB INT8 (5.3x) over 320 kB SRAM6.8 MB بدقة FP32 (22x)، و1.7 MB بدقة INT8 (5.3x)، فوق ذاكرة SRAM البالغة 320 kB
MCUNet resultنتيجة MCUNet
3.5x less SRAM, 5.7x less flash; 70.7% top-1 on STM32H743ذاكرة SRAM أقل بـ3.5x، وذاكرة flash أقل بـ5.7x، ودقة top-1 قدرها 70.7% على STM32H743
ResourceالموردInferenceالاستدلالTrainingالتدريب
Compute per exampleالحوسبة لكل مثالOne forward passتمريرة أمامية واحدةforward + backward, about 3xتمريرة أمامية + عكسية، نحو 3x
ActivationsالتنشيطاتFreed layer by layerتُحرَّر طبقة بعد طبقةAll kept until the backward pass returnsتُحفظ كلها حتى تعود التمريرة العكسية
Extra stateالحالة الإضافيةWeights onlyالأوزان فقطWeights, gradients, optimizer momentsالأوزان، والتدرجات، وعزوم المُحسِّن (optimizer)
Memory scalingتوسع الذاكرةLargest single layerأكبر طبقة منفردةGrows with depth and batch sizeتنمو مع العمق وحجم الدفعة (batch size)
Inference versus trainingالاستدلال مقابل التدريب

Naive training state on a microcontrollerحالة التدريب الساذج على متحكم دقيق

MobileNetV1 weights, FP32أوزان MobileNetV1 بدقة FP32
4.2 M x 4 B = 16.8 MB
Gradients and momentumالتدرجات والزخم (momentum)
2 more copies = 33.6 MBنسختان إضافيتان = 33.6 MB
Total before activationsالمجموع قبل التنشيطات
50.4 MB, about 157x over 320 kB SRAM50.4 MB، أي نحو 157x فوق ذاكرة SRAM البالغة 320 kB
Lin et al. 2022
training under 256 kBالتدريب ضمن أقل من 256 kB

SAM and EfficientViT-SAMSAM وEfficientViT-SAM

SAM is an image encoder (ViT-H, runs once per image, dominates cost), a prompt encoder and a lightweight mask decoder (together about 50 ms on a browser CPU). EfficientViT-SAM replaces only the encoder. Zero-shot means COCO was never in training; prompts are ViTDet boxes. Part 02: Generative and large models

يتكون SAM من مُرمِّز صور (ViT-H، يعمل مرة واحدة لكل صورة، ويستحوذ على معظم التكلفة)، ومُرمِّز أوامر (prompt encoder)، ومفكك أقنعة خفيف (mask decoder)، ويستغرق الأخيران معا نحو 50 ms على معالج CPU داخل المتصفح. يستبدل EfficientViT-SAM المُرمِّز فقط. ويعني zero-shot هنا أن COCO لم تُستخدم في التدريب قط، والأوامر هي صناديق ViTDet. الجزء 02: النماذج التوليدية والكبيرة

ModelالنموذجEncoder paramsمعاملات المُرمِّزEncoder MACsMACs المُرمِّزimg/simg/smAPmAPSpeedupالتسريع
SAM-ViT-H641.1 M2973 G1146.51x
EfficientViT-SAM-XL1203.3 M322 G18247.816.5x
EfficientViT-SAM-L261.3 M69 G53846.648.9x
EfficientSAM25.3 M247 G18344.416.6x
MobileSAM9.8 M39 G27838.725.3x
Zero-shot COCO, A100 TensorRT FP16 (EfficientViT-SAM Table 1, selected rows)COCO دون تدريب مسبق (zero-shot)، على A100 مع TensorRT بدقة FP16 (الجدول 1 في EfficientViT-SAM، صفوف مختارة)

Generative compute: tokens times stepsحوسبة النماذج التوليدية: الرموز مضروبة في الخطوات

MACs per pass≈Nparams Ntokens+c Ntokens2 d\text{MACs per pass} \approx N_{\text{params}}\,N_{\text{tokens}} + c\,N_{\text{tokens}}^{2}\,d
A linear term in tokens plus a quadratic attention term; multiply by the denoising step countحد خطي في عدد الرموز مضافًا إليه حد تربيعي للانتباه؛ ثم اضرب في عدد خطوات إزالة الضجيج
ModelالنموذجParametersالمعاملاتWorkloadعبء العملMACsMACs
ViT-H0.6 B518 x 518 image, about 1,370 tokensصورة 518 x 518، نحو 1,370 رمزا1.02 T
Llama 3 8B8 B1024 context + 512 output, about 1,500 tokensسياق 1024 + مخرجات 512، نحو 1,500 رمز11.2 T
FLUX.1 (one step)FLUX.1 (خطوة واحدة)12 B1K x 1K latent, about 4,000 tokensفضاء كامن (latent) بحجم 1K x 1K، نحو 4,000 رمز37.2 T
CogVideoX (one step)CogVideoX (خطوة واحدة)5.6 B49 frames, 13 latent frames, about 17,500 tokens49 إطارا، و13 إطارا كامنا، نحو 17,500 رمز332 T
Slide 12, MACs for one forward passالشريحة 12، عدد MACs لتمريرة أمامية واحدة

Stable Diffusion training run, 2022جولة تدريب Stable Diffusion، عام 2022

GPUsوحدات GPU
256 x A100
GPU-hoursساعات GPU
about 150,000نحو 150,000
Wall clockالزمن الفعلي المنقضي
150,000 / 256 = 586 h, about 24 days150,000 / 256 = 586 h، أي نحو 24 يوما
Costالتكلفة
about $600,000, so $4 per GPU-hourنحو $600,000، أي $4 لكل ساعة GPU
MosaicML 2023 rerunإعادة MosaicML للتدريب في 2023
21,000 A100-hours, under $50,00021,000 ساعة A100، بتكلفة أقل من $50,000
Sideطول الضلعPixelsالبكسلاتMACs per stepMACs لكل خطوةMACs ratioنسبة MACs
10241xabout 30 Tنحو 30 T1x
20484xabout 200 Tنحو 200 T6.7x
30729xabout 720 Tنحو 720 T24x
409616xabout 1,950 Tنحو 1,950 T65x
FLUX.1 per-step MACs against image side (super-quadratic: 16x pixels gives 65x MACs, close to 4^3)MACs لكل خطوة في FLUX.1 مقابل طول ضلع الصورة (نمو أسرع من التربيعي: 16x في البكسلات تعطي 65x في MACs، قريبا من 4^3)

DistriFusionDistriFusion

Each GPU denoises one patch but attends to its neighbours' activations from the previous step (displaced patch parallelism); the first step is synchronous, later communication is asynchronous and hidden. Part 02: Generative and large models

كل GPU تزيل الضجيج عن رقعة (patch) واحدة، لكنها تنتبه إلى تنشيطات الرقع المجاورة من الخطوة السابقة (displaced patch parallelism). الخطوة الأولى متزامنة، وبعدها يصبح الاتصال غير متزامن ومخفيا خلف الحساب. الجزء 02: النماذج التوليدية والكبيرة

SetupالإعدادMACs per deviceMACs لكل جهازWork per deviceالعمل لكل جهازLatencyزمن الاستجابةSpeedupالتسريعQualityالجودة
Original, 1 GPUالأصلي، وحدة GPU واحدة907 T1x12.3 s1xreferenceالمرجع
Naive patches, 4 GPUsرقع ساذجة (naive patches)، 4 وحدات GPU190 T4.8x lessأقل بـ4.8x3.14 s3.9xduplicated subjectsتكرار العناصر الرئيسية في الصورة
DistriFusion, 4 GPUsDistriFusion، 4 وحدات GPU227 T4.0x lessأقل بـ4.0x4.16 s3.0xno artifactsدون تشوهات
DistriFusion, 8 GPUsDistriFusion، 8 وحدات GPU113 T8.0x lessأقل بـ8.0x2.74 s4.5xno artifactsدون تشوهات
SDXL at 1280 x 1920, 50 Euler steps, A100sSDXL بدقة 1280 x 1920، و50 خطوة Euler، على وحدات A100
parallel efficiency=speedupdevices=3.04=75%\text{parallel efficiency} = \frac{\text{speedup}}{\text{devices}} = \frac{3.0}{4} = 75\%
Naive patches reach 98% by skipping 147 T of cross-patch attention (190 x 4 = 760 T versus 907 T); DistriFusion keeps 227 x 4 = 908 Tالرقع الساذجة تبلغ 98% بتخطي 147 T من الانتباه بين الرقع (190 x 4 = 760 T مقابل 907 T)؛ أما DistriFusion فتحتفظ بـ 227 x 4 = 908 T

Fast-LiDARNet and the frame budgetFast-LiDARNet وميزانية الإطار

tframe=1000 msfpst_{\text{frame}} = \frac{1000\ \text{ms}}{\text{fps}}
30 fps is 33.3 ms per frame30 fps تعني 33.3 ms لكل إطار
ConfigurationالإعدادRateالمعدلFrame timeزمن الإطارLeverالرافعةAgainst 33.3 msمقابل 33.3 ms
MinkowskiNet5 fps200 msnoneلا شيء167 ms overفوق الميزانية بـ167 ms
Optimised sparse kernelsنوى حسابية متفرقة محسَّنة (sparse kernels)18 fps55.6 mssystem, 3.6xالنظام، 3.6x22 ms overفوق الميزانية بـ22 ms
Fast-LiDARNet47 fps21.3 msalgorithm, 2.6x more (9.4x total)الخوارزمية، 2.6x إضافية (9.4x إجمالا)12 ms to spareيتبقى 12 ms احتياطا
Three configurations on slide 14 (GTX 1080Ti; the in-car Jetson AGX Xavier runs 11 fps)ثلاثة إعدادات في الشريحة 14 (على GTX 1080Ti، أما Jetson AGX Xavier داخل السيارة فيعمل بـ 11 fps)

LLMs outgrow GPU memoryالنماذج اللغوية الكبيرة تتجاوز ذاكرة GPU

weight bytes=Nparams×bytes per param,GPUs=⌈weight bytesGPU bytes⌉\text{weight bytes} = N_{\text{params}} \times \text{bytes per param}, \qquad \text{GPUs} = \left\lceil \frac{\text{weight bytes}}{\text{GPU bytes}} \right\rceil
Weights only; activations and the KV cache come on topالأوزان فقط؛ وتُضاف فوقها التنشيطات وذاكرة KV cache
Precisionالدقة العدديةBytes per paramبايت لكل معاملWeightsالأوزانGPUsوحدات GPU
FP3242,120 GB27
FP16 or BF16FP16 أو BF1621,060 GB14
INT81530 GB7
INT40.5265 GB4
MT-NLG (530 B) by precision on A100 80 GB cardsMT-NLG (530 B) حسب الدقة العددية على بطاقات A100 80 GB
ModelالنموذجYearالسنةParametersالمعاملاتFP16 weightsأوزان FP16
Transformer20170.05 B0.1 GB
GPT-220191.5 B3 GB
Megatron-LM20198.3 B16.6 GB
GPT-32020175 B350 GB
MT-NLG2022530 B1,060 GB
Slide 15 models, FP16 weightsنماذج الشريحة 15، أوزان بدقة FP16

Cloud GPUs and the memory wallوحدات GPU السحابية وجدار الذاكرة (memory wall)

TOPS=2×MACs per second1012,TOPS/W=peak TOPSboard power (W)\text{TOPS} = \frac{2 \times \text{MACs per second}}{10^{12}}, \qquad \text{TOPS/W} = \frac{\text{peak TOPS}}{\text{board power (W)}}
Dense figures; NVIDIA's 2:4 sparse figure is exactly doubleأرقام كثيفة (dense)؛ ورقم NVIDIA المتناثر 2:4 ضعفها تمامًا
PartالقطعةDense FP16 TOPSTOPS بدقة FP16 الكثيفةBandwidth GB/sعرض النطاق GB/sPower Wالقدرة WMemory GBالذاكرة GBTOPS/WTOPS/W
P100 (2016), PCIe18.7732250160.075
V100 SXM (2017)125900300320.42
A100 SXM (2020)3122,039400800.78
H100 SXM (2022)9903,430700961.41
B100 SXM (2024)1,7508,1927001922.5
Slide 18 values, TOPS per watt computedقيم الشريحة 18، مع حساب TOPS لكل واط

Growth from P100 to B100النمو من P100 إلى B100

Dense FP16 TOPSTOPS بدقة FP16 الكثيفة
18.7 to 1,750, about 94xمن 18.7 إلى 1,750، أي نحو 94x
Board powerقدرة البطاقة
250 to 700 W, 2.8xمن 250 إلى 700 W، أي 2.8x
Memory capacityسعة الذاكرة
16 to 192 GB, 12xمن 16 إلى 192 GB، أي 12x
Memory bandwidthعرض نطاق الذاكرة
732 to 8,192 GB/s, about 11xمن 732 إلى 8,192 GB/s، أي نحو 11x
TOPS per wattTOPS لكل واط
0.075 to 2.5, about 33xمن 0.075 إلى 2.5، أي نحو 33x

Memory wall on an H100جدار الذاكرة على H100

H100 computeحوسبة H100
990 x 10^12 dense FP16 ops/s990 x 10^12 عملية FP16 كثيفة في الثانية
H100 bandwidthعرض نطاق H100
3.35 x 10^12 bytes/s3.35 x 10^12 بايت في الثانية
Break-even intensityشدة التعادل الحسابية
990 / 3.35 = 295 ops per byte990 / 3.35 = 295 عملية لكل بايت
LLM decoding, batch 1فك الترميز في نموذج لغوي كبير، بدفعة حجمها 1
2 ops per 2-byte weight = 1 op per byteعمليتان لكل وزن حجمه بايتان = عملية واحدة لكل بايت
Trend (Gholami et al.)الاتجاه (Gholami et al.)
FLOPS 3.0x, DRAM bandwidth 1.6x, interconnect 1.4x per 2 yearsتنمو FLOPS بـ3.0x، وعرض نطاق DRAM بـ1.6x، والوصلات البينية (interconnect) بـ1.4x كل سنتين

Edge accelerator familiesعائلات المسرّعات على الحافة (edge)

FamilyالعائلةPerformanceالأداءPowerالقدرةTOPS/WTOPS/WShapeالشكل
Snapdragon 845 to 8 Gen 1من Snapdragon 845 إلى 8 Gen 13 to 52 TOPS, 17xمن 3 إلى 52 TOPS، أي 17x9 to 10 W, 1.1xمن 9 إلى 10 W، أي 1.1x0.33 to 5.2من 0.33 إلى 5.2fixed thermal lidسقف حراري ثابت
Apple A11 to A17 Proمن Apple A11 إلى A17 Pro0.6 to 35 TOPS, 58xمن 0.6 إلى 35 TOPS، أي 58x6 to 8 W, about 1xمن 6 إلى 8 W، أي نحو 1x0.075 to 2.63 (A15)من 0.075 إلى 2.63 (A15)fixed thermal lidسقف حراري ثابت
Jetson Nano to AGX Orin 64GBمن Jetson Nano إلى AGX Orin 64GB0.5 to 275 TOPS, 550xمن 0.5 إلى 275 TOPS، أي 550x10 to 60 W, 6xمن 10 إلى 60 W، أي 6x0.05 to 4.6من 0.05 إلى 4.6ladder of power tiersسلم من مستويات القدرة
Slides 19 to 21: fixed lid versus power ladderالشرائح 19 إلى 21: سقف ثابت مقابل سلم من القدرة

Which tier for which power budgetأي مستوى يناسب أي ميزانية قدرة

Microcontrollerمتحكم دقيق
milliwatts (STM32F746 about 360 mW)ملّي واط (STM32F746 نحو 360 mW)
Phone SoCشريحة الهاتف (SoC)
about 10 W, fixed by heatنحو 10 W، تحددها الحرارة
Robot module (Jetson)وحدة الروبوت (Jetson)
10 to 60 W, configurableمن 10 إلى 60 W، قابلة للضبط
Cloud GPUوحدة GPU سحابية
250 to 700 Wمن 250 إلى 700 W

The microcontroller tierمستوى المتحكم الدقيق (microcontroller)

A microcontroller is a compact integrated circuit for embedded systems that puts a processor, memory and I/O peripherals on a single chip: no OS, no DRAM, milliwatts and kilobytes. Part 03: Hardware gap

المتحكم الدقيق (microcontroller) دائرة متكاملة مدمجة للأنظمة المضمنة تجمع المعالج والذاكرة وطرفيات الإدخال والإخراج (I/O) على شريحة واحدة: بلا نظام تشغيل، وبلا DRAM، بالملّي واط والكيلوبايت. الجزء 03: فجوة العتاد

DMIPS=Dhrystones per second1757=(DMIPS/MHz)×fclock\text{DMIPS} = \frac{\text{Dhrystones per second}}{1757} = (\text{DMIPS/MHz}) \times f_{\text{clock}}
Integer benchmark normalized to the VAX 11/780; contains no MACsمعيار أداء للأعداد الصحيحة منسوب إلى VAX 11/780؛ لا يحتوي أي MAC
BoardاللوحةCoreالنواةMHzMHzDMIPSDMIPSmWmWSRAMSRAMFlashFlash
Arduino ZeroCortex-M0+4845632 kB256 kB
Arduino DueCortex-M3841582696 kB512 kB
STM32F407VGCortex-M4168210132192 kB1 MB
STM32F746NGCortex-M7216462360320 kB1 MB
Slide 22 boardsلوحات الشريحة 22

DMIPS arithmeticحساب DMIPS

Arm DMIPS/MHzقيم Arm لـ DMIPS/MHz
M0+ 0.95, M3 and M4 1.25, M7 2.14M0+ تساوي 0.95، وM3 وM4 تساويان 1.25، وM7 تساوي 2.14
STM32F746
2.14 x 216 = 462
STM32F407
1.25 x 168 = 210
MCU TOPS upper boundالحد الأعلى لـ TOPS في المتحكم الدقيق
216 MHz x 2 MACs x 2 ops = 0.0009 TOPS

Cloud, mobile and tiny AIالذكاء الاصطناعي في السحابة والهاتف والأجهزة الصغيرة جدا

TierالمستوىDeviceالجهازActivation memoryذاكرة التنشيطاتWeight storageتخزين الأوزانMemory vs tinyالذاكرة مقارنة بالصغير جداStorage vs tinyالتخزين مقارنة بالصغير جدا
Cloud AIذكاء السحابةA100-class GPUوحدة GPU من فئة A10080 GB HBMabout 1 TB or moreنحو 1 TB أو أكثر250,000xabout 1,000,000xنحو 1,000,000x
Mobile AIذكاء الهاتفFlagship phoneهاتف رائد4 GB DRAM256 GB flash12,500x256,000x
Tiny AIالذكاء الصغير جداSTM32F746320 kB SRAM1 MB flash1x1x
Slide 23, with ratios to the tiny tierالشريحة 23، مع النسب إلى المستوى الصغير جدا
80 GB320 kB=80×106 kB320 kB=250,000\frac{80\ \text{GB}}{320\ \text{kB}} = \frac{80 \times 10^{6}\ \text{kB}}{320\ \text{kB}} = 250{,}000
1 GB = 10^6 kB, 1 GB = 10^3 MB1 GB = 10^6 kB، و1 GB = 10^3 MB

Ratios to have readyنسب يجب أن تكون جاهزة في ذهنك

Cloud to mobile, activationمن السحابة إلى الهاتف، التنشيطات
80 GB / 4 GB = 20x
Mobile to tiny, activationمن الهاتف إلى الصغير جدا، التنشيطات
4 GB / 320 kB = 12,500x
Cloud to tiny, activationمن السحابة إلى الصغير جدا، التنشيطات
80 x 10^6 kB / 320 kB = 250,000x
Mobile to tiny, storageمن الهاتف إلى الصغير جدا، التخزين
256 GB / 1 MB = 256,000x
530 B FP16 against tinyنموذج 530 B بدقة FP16 مقابل الصغير جدا
1.06 TB / 1 MB = 1,060,000x
QuantityالكميةSizeالحجمCloud, 80 GBالسحابة، 80 GBMobile, 256 GB and 4 GBالهاتف، 256 GB و4 GBTiny, 1 MB and 320 kBالصغير جدا، 1 MB و320 kB
FP32 weightsأوزان بدقة FP32102.2 MByes, 783x headroomنعم، بهامش 783xyesنعمno, 102x over flashلا، 102x فوق ذاكرة flash
INT8 weightsأوزان بدقة INT825.6 MByesنعمyesنعمno, 25.6x over flashلا، 25.6x فوق ذاكرة flash
Peak activationذروة التنشيطات7.2 MByesنعمyesنعمno, 22.5x over SRAMلا، 22.5x فوق ذاكرة SRAM
Does ResNet-50 (25,557,032 parameters) fit? Two budgets checked separatelyهل يتسع ResNet-50 (25,557,032 معاملا)؟ ميزانيتان تُفحص كل منهما على حدة

Slide errataأخطاء الشرائح

Answer with the corrected fact, and name the slide version if a question depends on it. Part 01, Part 02, Part 03

أجب بالمعلومة المصححة، واذكر نسخة الشريحة إذا كان السؤال يعتمد عليها. الجزء 01، الجزء 02، الجزء 03

What the slides get wrongما تخطئ فيه الشرائح

Slide 2الشريحة 2
"without loosing accuracy" should read "without losing accuracy".عبارة "without loosing accuracy" صوابها "without losing accuracy".
Slide 5الشريحة 5
Legend bubbles 2M to 64M are parameter counts, not MACs. "ResNetXt" means ResNeXt. The chart is Figure 2 of the Once-for-All paper, credited to Deng et al.فقاعات مفتاح المخطط من 2M إلى 64M هي أعداد معاملات لا MACs. و"ResNetXt" المقصود بها ResNeXt. والمخطط هو الشكل 2 من ورقة Once-for-All، منسوبا إلى Deng et al.
Slide 6الشريحة 6
"ResNetXt-50" and "ResNetXt-101" are again ResNeXt."ResNetXt-50" و"ResNetXt-101" هما أيضا ResNeXt.
Slide 10الشريحة 10
The citation is the EfficientViT backbone paper (Cai et al., ICCV 2023). The 48.9x result is Zhang, Cai and Han, arXiv 2402.05008. "EfficientVIT" should read EfficientViT.المرجع المذكور هو ورقة العمود الفقري EfficientViT (Cai et al., ICCV 2023). أما نتيجة 48.9x فمصدرها Zhang, Cai and Han، arXiv 2402.05008. و"EfficientVIT" صوابها EfficientViT.
Slide 15الشريحة 15
The x axis skips 2019 with uneven spacing, so slopes are distorted. "MegatronLM" is Megatron-LM (8.3 B). The 2017 Transformer has 65 M (base) and 213 M (big), rounded to 0.05 B.المحور x يتخطى 2019 بتباعد غير منتظم، فتتشوه الميول. و"MegatronLM" هو Megatron-LM (8.3 B). ونموذج Transformer لعام 2017 فيه 65 M (base) و213 M (big)، وقد قُرِّب إلى 0.05 B.
Slide 18الشريحة 18
"Memory Bendwidth" means Bandwidth. H100 96 GB is an OEM SXM5 SKU, and 3,430 GB/s matches neither the 80 GB (3.35 TB/s) nor the 96 GB part. P100 values are the PCIe card (SXM2 was 300 W). B100 1,750 is the dense half of 3.5 PFLOPS sparse."Memory Bendwidth" المقصود بها Bandwidth. وذاكرة 96 GB في H100 هي نسخة SXM5 خاصة بالمصنّعين (OEM SKU)، وقيمة 3,430 GB/s لا تطابق نسخة 80 GB (3.35 TB/s) ولا نسخة 96 GB. وقيم P100 هي لبطاقة PCIe (أما SXM2 فكانت بقدرة 300 W). وقيمة 1,750 في B100 هي النصف الكثيف (dense) من 3.5 PFLOPS المتفرقة (sparse).
Slide 20الشريحة 20
No A17 power is plotted, so its TOPS/W cannot be computed. The A13 6 TOPS is NanoReview's figure; the A17 Pro 35 TOPS comes from Apple's 2023 event.لا توجد قيمة قدرة مرسومة لـ A17، لذلك لا يمكن حساب TOPS/W له. وقيمة 6 TOPS لـ A13 هي رقم NanoReview، أما 35 TOPS لـ A17 Pro فمصدرها مؤتمر Apple لعام 2023.
Slide 21الشريحة 21
Standard TX2 has 8 GB (4 GB is the TX2 4GB variant). The series mixes precisions: Nano and TX2 in FP16, Xavier INT8, Orin sparse INT8. The caption credits NanoReview but the URL is Connect Tech.النسخة القياسية من TX2 فيها 8 GB (و4 GB هي نسخة TX2 4GB). والسلسلة تخلط الدقات العددية: Nano وTX2 بدقة FP16، وXavier بدقة INT8، وOrin بدقة INT8 متفرقة (sparse). والتعليق ينسب الأرقام إلى NanoReview لكن الرابط يعود إلى Connect Tech.
Slide 22الشريحة 22
"on a single" is missing "chip". "KB" should be kB. STM32F407VG has 192 kB SRAM plus 4 kB backup, not 196 kB. Due's 158 DMIPS implies 1.88 DMIPS/MHz; Arm rates the M3 at 1.25 (105).عبارة "on a single" تنقصها كلمة "chip". و"KB" صوابها kB. ولوحة STM32F407VG فيها 192 kB من SRAM إضافة إلى 4 kB احتياطية (backup)، لا 196 kB. وقيمة 158 DMIPS للوحة Due تعني 1.88 DMIPS/MHz، بينما تقدّر Arm النواة M3 بـ1.25 (أي 105).
Slide 23الشريحة 23
Cloud and mobile columns were updated from MCUNet's 2020 table (V100 16 GB, iPhone 11 more than 64 GB) to 80 GB and 256 GB; the tiny column is unchanged, so the columns are not one dated snapshot.حُدِّث عمودا السحابة والهاتف من جدول MCUNet لعام 2020 (V100 بـ16 GB، وiPhone 11 بأكثر من 64 GB) إلى 80 GB و256 GB، أما عمود الأجهزة الصغيرة جدا فلم يتغير، لذلك لا تمثل الأعمدة لقطة واحدة من تاريخ واحد.
Slide 24الشريحة 24
The MIT course is 6.5940, "TinyML and Efficient Deep Learning Computing" (Fall 2024 page), now "TinyML and Efficient AI Computing". The slide omits year and URL.مقرر MIT هو 6.5940، بعنوان "TinyML and Efficient Deep Learning Computing" (صفحة خريف 2024)، واسمه الآن "TinyML and Efficient AI Computing". والشريحة تُغفل السنة والرابط.