Majid Al-RaimiWhy efficient deep learningلماذا التعلم العميق الكفء

COE 592Lecture 01المحاضرة 01

Why efficient deep learningلماذا التعلم العميق الكفء

Why modern vision, generative and language models cost so much to train and run, how algorithm, hardware and data together drive deep learning, and why the huge gap between cloud GPUs, phones and microcontrollers makes efficiency the central problem for embedded and edge AI.لماذا تكلّف نماذج الرؤية والنماذج التوليدية والنماذج اللغوية الحديثة كثيرًا في التدريب والتشغيل، وكيف تقود الخوارزمية والعتاد والبيانات معًا التعلم العميق، ولماذا تجعل الفجوة الهائلة بين وحدات GPU السحابية والهواتف والمتحكمات الدقيقة الكفاءةَ هي المشكلة المحورية للذكاء الاصطناعي المضمّن وعلى الحافة.

Partsالأجزاء
3
Conceptsالمفاهيم
15
Slidesالشرائح
24
Readingمدة القراءة
90 min90 دقيقة
Understoodما فهمته
0/15 conceptsمفاهيم
Read the full guideاقرأ الشرح الكاملEvery part on one long page: 3 parts, 15 concepts, about 90 min.كل الأجزاء في صفحة واحدة طويلة: 3 أجزاء، و15 مفهومًا، في نحو 90 دقيقة.

AOverviewنظرة عامة

Modern deep learning is expensive and it is everywhere. This lecture measures both halves of that sentence: how much computation and memory the models you already use actually cost, and how little of either the devices you want to deploy on can supply. Between those two measurements sits the question every later lecture answers, which is how to shrink a model without giving away the accuracy that made it worth running.

التعلم العميق الحديث مكلف، وهو في كل مكان. تقيس هذه المحاضرة نصفي هذه الجملة معا: كم تكلف النماذج التي تستخدمها أصلا من حوسبة وذاكرة، وكم هو قليل ما تستطيع الأجهزة التي تريد التشغيل عليها أن توفره من كليهما. وبين هذين القياسين يقع السؤال الذي تجيب عنه كل محاضرة لاحقة: كيف تصغّر النموذج دون أن تفرّط في الدقة التي جعلته يستحق التشغيل أصلا.

As a PhD student you need this lecture in three places. Exams turn it into arithmetic: a reduction ratio between two models, bytes per parameter at a given precision, a frame rate converted into milliseconds and checked against a budget, or TOPS per watt for a GPU generation. Your research project puts a model on a board with kilobytes of SRAM, and the sizing step you defend there is this lecture's comparison of demand against supply. And every efficient-model paper you read from now on, from MCUNet to an edge language model, opens by making exactly the trade you will learn to state in one line: what the model costs, what the target can pay, and how large the gap is.

بصفتك طالب دكتوراه تحتاج هذه المحاضرة في ثلاثة مواضع. الاختبارات تحوّلها إلى حساب: نسبة تخفيض بين نموذجين، وعدد البايتات لكل معامل عند دقة معينة، ومعدل إطارات يُحوَّل إلى ملّي ثانية ويُقارن بالميزانية، أو TOPS per watt لجيل من وحدات GPU. ومشروعك البحثي يضع نموذجا على لوحة فيها بضعة كيلوبايتات من SRAM، وخطوة التحجيم التي تدافع عنها هناك هي بالضبط مقارنة هذه المحاضرة بين الطلب والعرض. وكل ورقة عن النماذج الكفؤة ستقرؤها من الآن فصاعدا، من MCUNet إلى نموذج لغوي على الحافة (edge)، تبدأ بالموازنة نفسها التي ستتعلم صياغتها في سطر واحد: كم يكلف النموذج، وكم يستطيع الجهاز المستهدف أن يدفع، وكم حجم الفجوة بينهما.

From the ImageNet curve to the cloud-to-tiny gapمن منحنى ImageNet إلى الفجوة بين السحابة والأجهزة الصغيرة جدا

The path has five stops. You watch ImageNet error fall from 28.2% to 2.3% and ask what each drop cost, then read the frontier chart where accuracy is bought with MACs and parameters and see architecture search bend that frontier downward. You follow the same question into models that are not classifiers at all, promptable segmentation, video diffusion, 3D perception and language models, where the bill is set by tokens and denoising steps rather than parameter count. You then measure supply, reading a data center GPU trajectory of 94x more compute on 2.8x the power against phone NPUs, Jetson modules and a microcontroller at 320 kB of SRAM. The lecture closes on the ratio between the two measurements, 80 GB of cloud activation memory against 320 kB on a microcontroller, about 250,000x end to end.

المسار له خمس محطات. ترى خطأ ImageNet ينخفض من 28.2% إلى 2.3% وتسأل كم كلّف كل انخفاض، ثم تقرأ مخطط الحد الأمثل (frontier) حيث تُشترى الدقة بعدد MACs وبالمعاملات، وترى البحث عن المعمارية (architecture search) يحني هذا الحد نحو الأسفل. ثم تتبع السؤال نفسه إلى نماذج ليست مصنِّفات أصلا: التجزئة المعتمدة على الأوامر (promptable segmentation)، وانتشار الفيديو (video diffusion)، والإدراك ثلاثي الأبعاد، والنماذج اللغوية، حيث تحدد الفاتورةَ عددُ الرموز (tokens) وخطوات إزالة الضجيج لا عدد المعاملات. بعد ذلك تقيس العرض: تقرأ مسار وحدات GPU في مراكز البيانات الذي يعطي 94x من الحوسبة مقابل 2.8x فقط من القدرة، وتقارنه بوحدات NPU في الهواتف، ووحدات Jetson، ومتحكم دقيق (microcontroller) بذاكرة SRAM قدرها 320 kB. وتُختتم المحاضرة بالنسبة بين القياسين: 80 GB من ذاكرة التنشيطات في السحابة مقابل 320 kB على المتحكم الدقيق، أي نحو 250,000x من طرف إلى طرف.

The numbers this lecture anchorsالأرقام المرجعية في هذه المحاضرة

Each row is introduced with its own worked arithmetic in one of the three parts, so that by the end of the lecture no number here is a fact you memorized. They are the anchors the exam and the reference sheet return to, and the vocabulary every later lecture assumes.

كل صف يُقدَّم مع حسابه المفصل في أحد الأجزاء الثلاثة، بحيث لا يبقى أي رقم هنا في نهاية المحاضرة مجرد معلومة حفظتها. هذه هي المراسي التي يعود إليها الاختبار وورقة المراجعة، وهي المفردات التي تفترضها كل محاضرة لاحقة.

AnchorالمرساةNumberالرقمWhy it mattersلماذا يهم
ImageNet top-5 errorخطأ top-5 على ImageNet28.2% to 2.3%, human 5.1%من 28.2% إلى 2.3%، والإنسان 5.1%Accuracy arrived, but each step was paid for in computation and model size.تحققت الدقة، لكن كل خطوة دُفع ثمنها حوسبةً وحجمَ نموذج.
Once-for-All against XceptionOnce-for-All مقابل Xception14.1x less compute, 80.0% top-1حوسبة أقل بـ14.1x، ودقة top-1 قدرها 80.0%Architecture search moves the frontier left instead of climbing it.البحث عن المعمارية يزيح الحد الأمثل نحو اليسار بدلا من تسلقه.
MCUNet on a Cortex-M7MCUNet على Cortex-M7320 kB SRAM, 1 MB flash320 kB من SRAM و1 MB من flashTinyML runs where a phone's memory is already three orders of magnitude away.يعمل TinyML حيث تبعد ذاكرة الهاتف أصلا بثلاث رتب عشرية.
EfficientViT-SAM against SAMEfficientViT-SAM مقابل SAM538 img/s versus 11 img/s, 48.9x538 img/s مقابل 11 img/s، أي 48.9xReplace the block that dominates the cost and keep the rest untouched.استبدل الكتلة التي تهيمن على التكلفة واترك الباقي كما هو.
Stable Diffusion trainingتدريب Stable Diffusion256 A100s, 150k GPU-hours, $600,000256 وحدة A100، و150k ساعة GPU، و$600,000Generative cost follows tokens and steps, not parameters.تكلفة النماذج التوليدية تتبع عدد الرموز والخطوات، لا عدد المعاملات.
Fast-LiDARNetFast-LiDARNet5 fps to 47 fps inside a 33.3 ms budgetمن 5 fps إلى 47 fps ضمن ميزانية 33.3 msTurn a rate into a frame time before arguing that a system is real time.حوّل المعدل إلى زمن إطار قبل أن تجادل بأن النظام يعمل في الزمن الحقيقي.
MT-NLG weightsأوزان MT-NLG530 B parameters, 1,060 GB, 14 A100 80 GB GPUs530 B معامل، و1,060 GB، و14 وحدة A100 80 GBModel size outgrew GPU memory, so serving alone needs a cluster.تجاوز حجم النموذج ذاكرة وحدة GPU، فصار التشغيل وحده يحتاج إلى عنقود.
Cloud to tiny activation memoryذاكرة التنشيطات من السحابة إلى الأجهزة الصغيرة جدا80 GB to 320 kB, 250,000xمن 80 GB إلى 320 kB، أي 250,000xThe gap the rest of the course exists to close on the model side.الفجوة التي يوجد بقية المقرر لسدها من جهة النموذج.
The anchors of lecture 01, with what each one teachesمراسي المحاضرة 01، مع ما يعلّمه كل منها

Success looks likeعلامات النجاح

  • State the course challenge in one sentence and name the three pillars, algorithm, hardware and data, with one efficiency lever for each.أن تصوغ تحدي المقرر في جملة واحدة، وتسمي الركائز الثلاث: الخوارزمية والعتاد والبيانات، مع رافعة كفاءة واحدة لكل منها.
  • Define top-5 error and top-1 accuracy precisely, say why the two cannot be compared directly, and read a bubble chart of accuracy against MACs and parameters.أن تعرّف top-5 error وtop-1 accuracy بدقة، وتشرح لماذا لا يمكن المقارنة بينهما مباشرة، وتقرأ مخطط الفقاعات للدقة مقابل MACs والمعاملات.
  • Compute a computation reduction ratio, such as 8400 / 595 = 14.1x, and explain the Pareto frontier shift that architecture search produces.أن تحسب نسبة تخفيض الحوسبة، مثل 8400 / 595 = 14.1x، وتشرح إزاحة حد باريتو (Pareto frontier) التي ينتجها البحث عن المعمارية.
  • Convert parameters and precision into bytes, divide by a device budget, and report the overshoot as a ratio, for example 102 MB of FP32 ResNet-50 weights against 1 MB of flash.أن تحوّل المعاملات والدقة العددية إلى بايتات، وتقسم على ميزانية الجهاز، وتذكر التجاوز كنسبة، مثلا 102 MB من أوزان ResNet-50 بدقة FP32 مقابل 1 MB من ذاكرة flash.
  • Turn a rate into a time, compare it against a budget, and say which of two levers crosses the line, as in 5 fps to 47 fps against a 33.3 ms frame period.أن تحوّل المعدل إلى زمن، وتقارنه بالميزانية، وتحدد أي الرافعتين تعبر الخط، كما في الانتقال من 5 fps إلى 47 fps مقابل زمن إطار قدره 33.3 ms.
  • Read a GPU spec sheet: define TOPS, memory bandwidth and TDP, and compute TOPS per watt for any generation.أن تقرأ ورقة مواصفات GPU: تعرّف TOPS وعرض نطاق الذاكرة (memory bandwidth) وTDP، وتحسب TOPS per watt لأي جيل.
  • Compare cloud, mobile and tiny tiers on activation memory and weight storage, separate the two budgets, and decide whether a given model fits each tier.أن تقارن مستويات السحابة والهاتف والأجهزة الصغيرة جدا (cloud, mobile, tiny) من حيث ذاكرة التنشيطات وتخزين الأوزان، وتفصل بين الميزانيتين، وتقرر هل يتسع نموذج معين لكل مستوى.

How to study this lectureكيف تذاكر هذه المحاضرة

  1. Read the parts in order. Demand comes before supply: the model costs of the first two parts only become meaningful once the third part shows what a device can pay.اقرأ الأجزاء بالترتيب. الطلب يأتي قبل العرض: تكاليف النماذج في الجزأين الأولين لا يصبح لها معنى إلا بعد أن يبين الجزء الثالث ما يستطيع الجهاز دفعه.
  2. Keep a pencil next to every worked example. Compute the slide's number before you reveal it, then check yourself against the arithmetic in the concept.أبقِ قلما بجانب كل مثال محلول. احسب رقم الشريحة قبل أن تكشفه، ثم راجع نفسك على الحساب الموجود في المفهوم.
  3. Answer every recall prompt in your head before opening it. Ratios that you retrieved stay; the ones you only read do not.أجب عن كل سؤال استرجاع في ذهنك قبل أن تفتحه. النسب التي استرجعتها بنفسك تبقى، أما التي قرأتها فقط فلا تبقى.
  4. Take each quiz and read the explanation even when you are right; the wrong options are the exam traps.حل كل اختبار قصير واقرأ الشرح حتى لو كانت إجابتك صحيحة، فالخيارات الخاطئة هي فخاخ الاختبار.
  5. Read the slide errata carefully. Several slides carry inherited arithmetic slips, and spotting why a number is wrong is the best proof that you own the computation behind it.اقرأ أخطاء الشرائح (errata) بعناية. عدة شرائح تحمل أخطاء حسابية موروثة، وإدراك سبب خطأ الرقم هو أفضل دليل على أنك تملك الحساب الذي وراءه.
  6. Mark a concept understood only when you could redo its number and its ratio from a blank page. Unmarked concepts show you where to return.لا تعلّم على مفهوم بأنه مفهوم إلا إذا استطعت إعادة رقمه ونسبته من صفحة بيضاء. المفاهيم غير المعلَّمة تريك أين تعود.
  7. Come back after a few days and size a model cold on a device you have not used, such as the board your own project targets. Spaced practice on a new example is what turns a formula into a skill.عد بعد بضعة أيام واحسب حجم نموذج من الصفر على جهاز لم تستخدمه، مثل اللوحة التي يستهدفها مشروعك. التدرب المتباعد على مثال جديد هو ما يحوّل المعادلة إلى مهارة.

Sourcesالمصادر

BThe 3 partsالأجزاء الـ3

  1. 01Accuracy comes at a costالدقة لها ثمنDeep learning now beats humans on ImageNet, but every accuracy gain was paid for in computation and model size, and efficient design (NAS, MCUNet, on-device training) is what brings it to phones and IoT devices.تتفوق نماذج التعلم العميق اليوم على البشر في ImageNet، لكن كل زيادة في الدقة دُفع ثمنها حسابًا وحجمًا للنموذج، والتصميم الكفء (NAS وMCUNet والتدريب على الجهاز) هو ما يوصلها إلى الهواتف وأجهزة إنترنت الأشياء (IoT).6 concepts6 مفاهيمSlides 1-8الشرائح 1-836 min36 دقيقة
    1. 1.1Deep learning is everywhere and expensive: the challenge of this courseالتعلم العميق في كل مكان ومكلف: تحدي هذا المقرر
    2. 1.2ImageNet: eight years from 28.2% to below humanImageNet: ثماني سنوات من 28.2% إلى أقل من الخطأ البشري
    3. 1.3Reading the bubble chart: accuracy is bought with MACs and parametersقراءة مخطط الفقاعات: الدقة تُشترى بـ MACs والمعاملات
    4. 1.4Architecture search moves the frontier: 14x less compute at equal accuracyالبحث عن المعماريات يزيح الحدّ: حوسبة أقل بـ 14x عند الدقة نفسها
    5. 1.5TinyML: deep learning on a microcontroller with kilobytes of memoryTinyML: التعلم العميق على متحكم دقيق بذاكرة من الكيلوبايت
    6. 1.6Learning on the device: why it is wanted and why it is hardالتعلم على الجهاز: لماذا نريده ولماذا هو صعب
  2. 02Segmentation, generative models and LLMsالتقطيع (Segmentation) والنماذج التوليدية ونماذج LLMPromptable segmentation, diffusion models, 3D perception and large language models push computation and memory far beyond classification, and each has an efficient counterpart that recovers speed without losing quality.التقطيع القابل للتوجيه بالأوامر (promptable segmentation) ونماذج الانتشار (diffusion) والإدراك ثلاثي الأبعاد والنماذج اللغوية الكبيرة تدفع الحساب والذاكرة إلى ما يتجاوز التصنيف بكثير، ولكل منها نظير كفء يستعيد السرعة دون فقدان الجودة.5 concepts5 مفاهيمSlides 9-16الشرائح 9-1630 min30 دقيقة
    1. 2.1Promptable segmentation: one heavy encoder, one cheap decoderالتقسيم القابل للتوجيه بالتلميحات: مُرمِّز ثقيل واحد ومفكِّك رخيص واحد
    2. 2.2Generative models: tokens and steps set the bill, not parametersالنماذج التوليدية: الـ tokens والخطوات هي التي تحدد الفاتورة، لا المعاملات
    3. 2.3DistriFusion: splitting one image across GPUs without splitting the storyDistriFusion: تقسيم صورة واحدة على عدة وحدات GPU دون تقسيم القصة
    4. 2.4Fast-LiDARNet: reaching real time by co-designing kernels and modelFast-LiDARNet: بلوغ الزمن الحقيقي بالتصميم المشترك للنوى والنموذج
    5. 2.5LLMs outgrow GPU memory, and why they must still run at the edgeنماذج LLM تتجاوز ذاكرة GPU، ولماذا يجب أن تعمل على الحافة رغم ذلك
  3. 03Cloud and edge AI hardware, and the gap between themعتاد الذكاء الاصطناعي في السحابة وعلى الحافة، والفجوة بينهماHow NVIDIA data center GPUs, mobile NPUs, Jetson modules and microcontrollers compare in performance, power and memory, and why the orders-of-magnitude gap from cloud to tiny devices demands efficient models.كيف تُقارَن وحدات NVIDIA GPU في مراكز البيانات ووحدات NPU في الهواتف ووحدات Jetson والمتحكمات الدقيقة من حيث الأداء والطاقة والذاكرة، ولماذا تتطلب الفجوة التي تبلغ عدة رتب عشرية بين السحابة والأجهزة الصغيرة جدًا نماذج كفؤة.4 concepts4 مفاهيمSlides 17-24الشرائح 17-2424 min24 دقيقة
    1. 3.1The hardware pillar: cloud GPUs grew 94x in compute on 2.8x the powerركيزة العتاد: نمت قدرة الحوسبة في وحدات GPU السحابية 94 ضعفا مقابل 2.8 ضعف فقط في القدرة الكهربائية
    2. 3.2Phones, Apple silicon and Jetson: performance inside a power envelopeالهواتف وشرائح Apple وJetson: الأداء داخل حدود قدرة كهربائية ثابتة
    3. 3.3Microcontrollers: milliwatts, kilobytes and a different yardstickالمتحكمات الدقيقة: ميلي واط وكيلوبايت ومقياس مختلف تماما
    4. 3.4The gap: 250,000x in activation memory, and why the rest of the course existsالفجوة: 250,000 ضعف في ذاكرة التنشيطات، ولماذا وُجد باقي المقرر

CGlossary and referenceالمصطلحات والمرجع