Majid Al-RaimiPruning granularity: from irregular to regularدقة التقليم (Granularity): من غير المنتظم إلى المنتظم

COE 592Lecture 4.1المحاضرة 4.1Part 03الجزء 03

Pruning granularity: from irregular to regularدقة التقليم (Granularity): من غير المنتظم إلى المنتظم

Fine-grained versus coarse-grained pruning on a 2D weight matrix, the four dimensions of a convolution weight tensor, and the five commonly used granularities from fine-grained to channel-level.التقليم الدقيق (fine-grained) مقابل الخشن (coarse-grained) على مصفوفة أوزان ثنائية الأبعاد، والأبعاد الأربعة لموتر أوزان الالتفاف، ومستويات الدقة الخمسة الشائعة من الدقيق إلى مستوى القنوات.

Conceptsالمفاهيم
3
Slidesالشرائح
14-18
Readingمدة القراءة
18 min18 دقيقة
Understoodما فهمته
0/3 conceptsمفاهيم

Why this part mattersلماذا يهمّ هذا الجزء

Sooner or later your embedded project will hit this moment: a network that is 90% zeros runs no faster on the target MCU or GPU than the dense one did. Nothing is wrong with the pruning. What is wrong is the shape of the holes, and that shape is what this part is about.

Part 02 showed that pruning can remove most of a network's weights without hurting accuracy. The next question on the lecture's outline is in what pattern to remove them. We start with a single 8 x 8 matrix and two ways of cutting it, then open up a convolution weight to see that it has four dimensions and therefore many more ways to be cut, and finish with a ladder of five granularities adapted from Mao et al., who studied four. Exams ask you to order that ladder, to count the weights a given unit removes and to argue the trade between flexibility and acceleration. The same ladder returns in the next part as NVIDIA 2:4 sparsity, channel pruning and AMC, and again in lecture 04-2.

عاجلًا أو آجلًا سيصل مشروعك المدمج إلى هذه اللحظة: شبكة 90% من أوزانها أصفار لا تعمل على المتحكم الدقيق (MCU) أو الـGPU المستهدف أسرع مما كانت تعمل الشبكة الكثيفة. لا خطأ في التقليم نفسه. الخطأ في شكل الثقوب، وهذا الشكل هو موضوع هذا الجزء.

أوضح الجزء 02 أن التقليم يستطيع حذف معظم أوزان الشبكة دون الإضرار بالدقة. السؤال التالي في مخطط المحاضرة هو: بأي نمط نحذفها؟ نبدأ بمصفوفة واحدة حجمها 8 x 8 وطريقتين لقطعها، ثم نفتح وزن الالتفاف (convolution) لنرى أن له أربعة أبعاد وبالتالي طرقًا أكثر بكثير للقطع، ونختم بسلّم من خمس درجات للدقة (granularity) مقتبس من Mao et al. الذين درسوا أربعًا منها. تطلب منك الاختبارات ترتيب هذا السلّم، وعدّ الأوزان التي تحذفها وحدة معيّنة، ومناقشة المقايضة بين المرونة والتسريع. ويعود السلّم نفسه في الجزء التالي في صورة تفرّغ 2:4 من NVIDIA وتقليم القنوات وAMC، ثم مرة أخرى في المحاضرة 04-2.

By the end you canفي نهاية هذا الجزء ستستطيع

  1. Define pruning granularity and place fine-grained and coarse-grained pruning at its two ends.تعرّف دقة التقليم (pruning granularity) وتضع التقليم الدقيق (fine-grained) والتقليم الخشن (coarse-grained) عند طرفيها.
  2. Explain why coarse-grained choices are a subset of fine-grained ones and what that does to attainable sparsity at equal accuracy.تشرح لماذا تكون خيارات التقليم الخشن مجموعة جزئية من خيارات التقليم الدقيق، وما أثر ذلك على نسبة التفرّغ (sparsity) الممكن بلوغها عند الدقة نفسها.
  3. Read a convolution weight as [c_o, c_i, k_h, k_w] and count the weights in a filter, an input channel, a kernel and a row.تقرأ وزن الالتفاف (convolution) على أنه [c_o, c_i, k_h, k_w] وتعدّ الأوزان في المرشّح (filter) وفي قناة الإدخال (input channel) وفي النواة (kernel) وفي الصف.
  4. Order fine-grained, pattern-based, vector-level, kernel-level and channel-level from irregular to regular and say what hardware each maps onto.ترتّب المستويات fine-grained وpattern-based وvector-level وkernel-level وchannel-level من غير المنتظم إلى المنتظم، وتذكر العتاد الذي يناسب كلًّا منها.
  5. Compute the sparsity and the surviving shape after removing a given unit.تحسب نسبة التفرّغ والشكل المتبقي بعد حذف وحدة معيّنة.

Take a weight matrix with eight rows and eight columns, 64 weights in all, and decide to remove 24 of them. One way is to cross out rows 3, 4 and 7 completely. Another is to cross out 24 individual entries wherever the magnitude criterion of part 05 says they matter least. Both leave 40 weights and both reach a Sparsity of 24 / 64 = 37.5%. Everything else about them is different.

خذ مصفوفة أوزان من ثمانية صفوف وثمانية أعمدة، أي 64 وزنًا في المجموع، وقرّر حذف 24 منها. إحدى الطرق أن تشطب الصفوف 3 و4 و7 بالكامل. وطريقة أخرى أن تشطب 24 عنصرًا منفردًا أينما قال معيار المقدار (magnitude) في الجزء 05 إنها الأقل أهمية. كلتا الطريقتين تُبقي 40 وزنًا وكلتاهما تبلغ نسبة تفرّغ (sparsity) قدرها 24 / 64 = 37.5%. وكل ما عدا ذلك مختلف بينهما.

The unit you delete is the Pruning granularity. Deleting single weights is fine-grained, or unstructured, pruning. Deleting whole rows, columns, kernels or channels is coarse-grained, or structured, pruning. Two consequences pull in opposite directions as the unit grows. The number of masks you may choose from falls, which costs accuracy at a given Pruning ratio. The regularity of what survives rises, which is what lets ordinary hardware run the pruned layer faster.

الوحدة التي تحذفها هي دقة التقليم (pruning granularity). حذف أوزان منفردة هو التقليم الدقيق أو غير المنظَّم (fine-grained / unstructured pruning). وحذف صفوف أو أعمدة أو أنوية (kernels) أو قنوات كاملة هو التقليم الخشن أو المنظَّم (coarse-grained / structured pruning). كلما كبرت الوحدة ظهرت نتيجتان تشدّان في اتجاهين متعاكسين. عدد الأقنعة التي يمكنك الاختيار منها يقلّ، وهذا يكلّف دقة عند نسبة تقليم (pruning ratio) معيّنة. وانتظام ما يبقى يزداد، وهذا ما يسمح للعتاد العادي بتشغيل الطبقة المقلَّمة أسرع.

Removing rows 3, 4 and 7 of an 8 x 8 matrix leaves a dense 5 x 8 block. Nothing needs an index, so any matrix library multiplies it as is.حذف الصفوف 3 و4 و7 من مصفوفة 8 x 8 يترك كتلة كثيفة بحجم 5 x 8. لا شيء يحتاج إلى فهرس، لذلك تضربها أي مكتبة مصفوفات كما هي.
Removing 24 scattered entries reaches the same 37.5% sparsity, but the matrix keeps its 8 x 8 footprint and each survivor needs a stored position.حذف 24 عنصرًا متناثرًا يبلغ نسبة التفرّغ نفسها 37.5%، لكن المصفوفة تحتفظ بحجمها 8 x 8 ويحتاج كل وزن باقٍ إلى تخزين موضعه.

Counting the choicesعدّ الخيارات

The slide calls fine-grained pruning "more flexible" and coarse-grained pruning "a subset of the fine-grained case". Both statements can be made exact by counting masks. A mask is the set of positions you zero, and the pruning problem of part 01 searches over masks for the one with the lowest loss.

تصف الشريحة التقليم الدقيق بأنه "أكثر مرونة" والتقليم الخشن بأنه "مجموعة جزئية من حالة التقليم الدقيق". يمكن جعل العبارتين دقيقتين بعدّ الأقنعة. القناع (mask) هو مجموعة المواضع التي تصفّرها، ومسألة التقليم (pruning) في الجزء 01 تبحث بين الأقنعة عن القناع ذي أقل خسارة (loss).

Worked exampleمثال محلول

How many masks remove 24 of 64 weightsكم قناعًا يحذف 24 وزنًا من 64

  1. Fine-grainedالتقليم الدقيق (Fine-grained)

    Any 24 of the 64 positions may go, so there are C(64, 24) = 250,649,105,469,666,120 masks, about 2.5 x 10^17.
    يمكن حذف أي 24 موضعًا من المواضع الـ64، لذلك يوجد C(64, 24) = 250,649,105,469,666,120 قناعًا، أي نحو 2.5 x 10^17.
  2. Row-structuredالتقليم المنظَّم بالصفوف (Row-structured)

    Any 3 of the 8 rows may go, so there are C(8, 3) = 56 masks.
    يمكن حذف أي 3 صفوف من الصفوف الـ8، لذلك يوجد C(8, 3) = 56 قناعًا.
  3. Nest one inside the otherضع إحداهما داخل الأخرى

    Every one of the 56 row masks is also a set of 24 individual positions, so it is one of the 2.5 x 10^17 fine-grained masks. The structured menu sits strictly inside the unstructured menu.
    كل قناع من أقنعة الصفوف الـ56 هو أيضًا مجموعة من 24 موضعًا منفردًا، فهو إذن أحد أقنعة التقليم الدقيق البالغة 2.5 x 10^17. قائمة الخيارات المنظَّمة تقع بالكامل داخل قائمة الخيارات غير المنظَّمة.
  4. Consequence for accuracyالنتيجة على الدقة

    The best row mask can at most tie the best fine-grained mask on the loss. It can never beat it. At a fixed accuracy target, structured pruning therefore reaches equal or lower sparsity, never higher, for the best achievable mask under the same retraining.
    أفضل قناع صفوف يمكنه في أحسن الأحوال أن يعادل أفضل قناع دقيق في قيمة الخسارة، ولا يمكنه أبدًا أن يتفوق عليه. لذلك عند هدف دقة ثابت يبلغ التقليم المنظَّم نسبة تفرّغ مساوية أو أقل، لا أعلى أبدًا، وذلك لأفضل قناع ممكن تحت إعادة التدريب نفسها.

Same sparsity, different search spacesنسبة التفرّغ نفسها، وفضاءات بحث مختلفة

Weights removedالأوزان المحذوفة
24 of 64 (37.5%)24 من 64 (37.5%)
Fine-grained masksأقنعة التقليم الدقيق
C(64, 24) ≈ 2.5 x 10^17C(64, 24) ≈ 2.5 x 10^17
Row-structured masksأقنعة حذف الصفوف الكاملة
C(8, 3) = 56C(8, 3) = 56
Surviving shape, fine-grainedالشكل المتبقي، التقليم الدقيق
8 x 8 with 24 holes8 x 8 مع 24 ثقبًا
Surviving shape, row-structuredالشكل المتبقي، حذف الصفوف
5 x 8 dense5 x 8 كثيفة

Why irregular means hard to accelerateلماذا يعني عدم الانتظام صعوبة التسريع

Multiply a vector by the 5 x 8 survivor and nothing special happens. It is just a smaller dense matrix, and every BLAS routine, every tensor core and every microcontroller loop handles it at full speed. That is the slide's "easy to accelerate (just a smaller matrix!)". Now multiply by the 8 x 8 matrix with 24 holes. A dense routine still performs all 64 multiplies, 24 of them by zero, and gains nothing. To gain, you must store the 40 surviving values together with their positions, in a compressed sparse format, and let the hardware skip the zeros one by one. Mao et al. draw the same line: fine-grained sparsity scatters the tensor into isolated weights and needs custom accelerators such as EIE or SCNN to exploit it, while filter and channel sparsity is simple to accelerate on general-purpose processors because it "is equivalent to obtaining a smaller dense model" (Mao et al., 2017, section 2).

اضرب متجهًا في المصفوفة الباقية 5 x 8 ولن يحدث شيء خاص. إنها ببساطة مصفوفة كثيفة أصغر، وكل دالة BLAS وكل tensor core وكل حلقة على متحكم دقيق تعالجها بالسرعة الكاملة. هذا ما تعنيه الشريحة بعبارة "سهل التسريع (مجرد مصفوفة أصغر!)". الآن اضرب في المصفوفة 8 x 8 التي فيها 24 ثقبًا. الدالة الكثيفة ما زالت تنفّذ عمليات الضرب الـ64 كلها، منها 24 ضربًا في صفر، ولا تكسب شيئًا. لكي تكسب، يجب أن تخزّن القيم الـ40 الباقية مع مواضعها في صيغة متفرّغة مضغوطة (compressed sparse format)، وأن تدع العتاد يتخطى الأصفار واحدًا واحدًا. يرسم Mao et al. الخط نفسه: التفرّغ الدقيق يبعثر الموتّر إلى أوزان معزولة ويحتاج إلى مسرّعات مخصّصة مثل EIE أو SCNN للاستفادة منه، بينما تفرّغ المرشّحات والقنوات سهل التسريع على المعالجات العامة لأنه "يكافئ الحصول على نموذج كثيف أصغر" (Mao et al., 2017، القسم 2).

The gap is measurable. Wen et al. trained AlexNet with structured sparsity and reported average layer-wise speedups of the convolutional layers of 5.1x on CPU and 3.1x on GPU with off-the-shelf libraries, against 3.0x and 0.9x for non-structured l1 sparsity (Wen et al., 2016, Table 4). The fine-grained model had more zeros. The structured model ran faster.

الفجوة قابلة للقياس. درّب Wen et al. شبكة AlexNet بتفرّغ منظَّم وأبلغوا عن متوسط تسريع لكل طبقة في الطبقات الالتفافية قدره 5.1x على الـCPU و3.1x على الـGPU باستخدام مكتبات جاهزة، مقابل 3.0x و0.9x للتفرّغ غير المنظَّم بـl1 (Wen et al., 2016، الجدول 4). النموذج الدقيق كان فيه أصفار أكثر، لكن النموذج المنظَّم كان أسرع.

What the accuracy price looks likeكيف يبدو ثمن الدقة

Because coarse units search a smaller space, they lose a little accuracy at the same density (the fraction of weights kept). Mao et al. measured this on ImageNet with the same pipeline at every granularity. The differences are small between fine and vector grains and grow as the grain reaches whole kernels; pruning entire filters "loses nearly 1% validation accuracy at the very first pruning stage" on AlexNet (Mao et al., 2017).

لأن الوحدات الخشنة تبحث في فضاء أصغر، فإنها تخسر قليلًا من الدقة عند الكثافة نفسها (density، أي نسبة الأوزان المُبقاة). قاس Mao et al. ذلك على ImageNet بخط المعالجة نفسه عند كل مستوى دقة. الفروق صغيرة بين المستوى الدقيق ومستوى المتجهات وتكبر حين تصل الوحدة إلى أنوية كاملة؛ وتقليم مرشّحات كاملة "يخسر قرابة 1% من دقة التحقق في أول مرحلة تقليم" على AlexNet (Mao et al., 2017).

NetworkالشبكةDensity keptالكثافة المُبقاةFine-grainedدقيق (Fine-grained)Vector-levelمستوى المتجه (Vector-level)Kernel-levelمستوى النواة (Kernel-level)
AlexNetAlexNet24.8%24.8%80.41%80.41%79.94%79.94%79.20%79.20%
VGG-16VGG-1623.5%23.5%90.56%90.56%90.48%90.48%89.70%89.70%
ResNet-50ResNet-5040.0%40.0%92.34%92.34%92.26%92.26%92.07%92.07%
Top-5 ImageNet accuracy at equal density (Mao et al., 2017, Table 1)دقة Top-5 على ImageNet عند الكثافة نفسها (Mao et al., 2017، الجدول 1)
Granularityمستوى الدقةDensity keptالكثافة المُبقاةStorage relative to denseالتخزين نسبةً إلى الشبكة الكثيفة
Fine-grainedدقيق (Fine-grained)22.1%22.1%33.0%33.0%
Vector-levelمستوى المتجه (Vector-level)29.9%29.9%34.5%34.5%
Kernel-levelمستوى النواة (Kernel-level)37.8%37.8%39.7%39.7%
AlexNet at baseline accuracy: density versus storage with 4-bit indices (Mao et al., 2017, Table 2)شبكة AlexNet عند دقة خط الأساس: الكثافة مقابل التخزين بفهارس 4-bit (Mao et al., 2017، الجدول 2)

Recall

Rows 3, 4 and 7 of an 8 x 8 weight matrix are pruned. What is the sparsity, and what shape survives?قُلِّمت الصفوف 3 و4 و7 من مصفوفة أوزان 8 x 8. ما نسبة التفرّغ، وما الشكل الذي يبقى؟

24 of 64 weights become zero, a sparsity of 37.5%. The survivor is a dense 5 x 8 matrix with no index storage.
يصبح 24 وزنًا من 64 صفرًا، أي نسبة تفرّغ 37.5%. وما يبقى مصفوفة كثيفة 5 x 8 بلا أي تخزين للفهارس.

Recall

Why does the slide call coarse-grained choices a subset of the fine-grained case, and what does that imply for compression?لماذا تسمّي الشريحة خيارات التقليم الخشن مجموعة جزئية من حالة التقليم الدقيق، وماذا يعني ذلك للضغط؟

Every set of whole rows is also a set of individual weights, so each structured mask is one of the unstructured masks. The structured optimum can only tie the unstructured optimum, so at equal accuracy the attainable sparsity is lower or equal, never higher.
كل مجموعة من الصفوف الكاملة هي أيضًا مجموعة من الأوزان المنفردة، فكل قناع منظَّم هو أحد الأقنعة غير المنظَّمة. الحل الأمثل المنظَّم لا يستطيع إلا أن يعادل الحل الأمثل غير المنظَّم، لذلك عند الدقة نفسها تكون نسبة التفرّغ الممكنة أقل أو مساوية، لا أعلى أبدًا.

Quick checkاختبار سريع

Why is fine-grained pruning hard to accelerate on an ordinary GPU?لماذا يصعب تسريع التقليم الدقيق (fine-grained) على GPU عادي؟

Quick checkاختبار سريع

Which statement about coarse-grained pruning matches slide 15?أي عبارة عن التقليم الخشن (coarse-grained) تطابق الشريحة 15؟

A linear layer's weight is a matrix, so its only structured units are rows and columns. A convolution weight is richer. Slide 17 draws one: three rows of kernels stacked vertically, two columns of kernels side by side, and each kernel a 3 x 3 grid. Count the cells and you get 3 x 2 x 3 x 3 = 54 weights.

وزن الطبقة الخطية مصفوفة، لذلك وحداته المنظَّمة الوحيدة هي الصفوف والأعمدة. أما وزن الالتفاف فأغنى. ترسم الشريحة 17 واحدًا منه: ثلاثة صفوف من الأنوية مكدّسة عموديًا، وعمودان من الأنوية متجاوران، وكل نواة شبكة 3 x 3. عُدّ الخلايا تحصل على 3 x 2 x 3 x 3 = 54 وزنًا.

Those four factors are the four dimensions of a convolution weight. The tensor has shape [c_o, c_i, k_h, k_w]: c_o output channels, also called filters; c_i input channels; and a kernel of height k_h and width k_w. Goodfellow, Bengio and Courville write the same object as a 4-D kernel tensor K whose element K[i, j, k, l] is the connection strength between output channel i and input channel j at a row offset of k and a column offset of l (Goodfellow et al., 2016, section 9.5). PyTorch stores Conv2d.weight with exactly the slide's ordering, (out_channels, in_channels / groups, kernel_size[0], kernel_size[1]) (PyTorch documentation).

هذه العوامل الأربعة هي الأبعاد الأربعة لوزن الالتفاف (dimensions of a convolution weight). شكل الموتّر [c_o, c_i, k_h, k_w]: c_o قنوات الإخراج، وتسمّى أيضًا المرشّحات (filters)؛ وc_i قنوات الإدخال؛ ونواة ارتفاعها k_h وعرضها k_w. يكتب Goodfellow وBengio وCourville الشيء نفسه على أنه موتّر نواة رباعي الأبعاد (4-D) اسمه K، عنصره K[i, j, k, l] هو قوة الاتصال بين قناة الإخراج i وقناة الإدخال j عند إزاحة صف قدرها k وإزاحة عمود قدرها l (Goodfellow et al., 2016، القسم 9.5). ويخزّن PyTorch Conv2d.weight بترتيب الشريحة نفسه تمامًا، (out_channels, in_channels / groups, kernel_size[0], kernel_size[1]) (توثيق PyTorch).

N=co⋅ci⋅kh⋅kwN = c_o \cdot c_i \cdot k_h \cdot k_w
Weights in one convolution layerالأوزان في طبقة التفاف واحدة
The slide 17 tensor with its four dimensions labeled on one object: three filters down, two input channels across, nine weights per kernel, 54 in all.موتّر الشريحة 17 وأبعاده الأربعة موسومة على شكل واحد: ثلاثة مرشّحات نزولًا، وقناتا إدخال عرضًا، وتسعة أوزان في كل نواة، أي 54 وزنًا في المجموع.

Slicing the tensor into unitsتقطيع الموتّر إلى وحدات

The reason the lecture stops to name the dimensions is that each way of slicing the tensor is a candidate pruning unit. Mao et al. name the slices with array notation, and reading them that way makes the counts automatic. Fix the output channel and you have a filter, a 3-D slab. Fix the output and input channel and you have one kernel, a 2-D grid. Fix a row inside that kernel and you have a 1-D vector. Fix everything and you have a single scalar weight (Mao et al., 2017, section 3.2).

السبب الذي يجعل المحاضرة تتوقف لتسمية الأبعاد هو أن كل طريقة لتقطيع الموتّر هي وحدة تقليم مرشّحة. يسمّي Mao et al. الشرائح بترميز المصفوفات، وقراءتها بهذه الطريقة تجعل العدّ تلقائيًا. ثبّت قناة الإخراج تحصل على مرشّح، وهو لوح ثلاثي الأبعاد (3-D). ثبّت قناتَي الإخراج والإدخال تحصل على نواة واحدة، وهي شبكة ثنائية الأبعاد (2-D). ثبّت صفًا داخل تلك النواة تحصل على متجه أحادي البعد (1-D). ثبّت كل شيء تحصل على وزن عددي واحد (Mao et al., 2017، القسم 3.2).

UnitالوحدةSliceالمقطعWeightsالأوزانShare of 54النسبة من 54
Single weightوزن مفردW[o, i, r, c]W[o, i, r, c]111.9%1.9%
Row inside a kernelصف داخل نواةW[o, i, r, :]W[o, i, r, :]k_w = 3k_w = 35.6%5.6%
Kernelنواة (kernel)W[o, i, :, :]W[o, i, :, :]k_h x k_w = 9k_h x k_w = 916.7%16.7%
Filter (output channel)مرشّح (filter)، أي قناة إخراجW[o, :, :, :]W[o, :, :, :]c_i x k_h x k_w = 18c_i x k_h x k_w = 1833.3%33.3%
Input channelقناة إدخال (input channel)W[:, i, :, :]W[:, i, :, :]c_o x k_h x k_w = 27c_o x k_h x k_w = 2750.0%50.0%
Units inside the 54-weight tensor of slide 17الوحدات داخل موتّر الشريحة 17 ذي الأوزان الـ 54

Two formulas do all the work. A filter holds c_i · k_h · k_w weights, because it has one kernel per input channel. An input channel holds c_o · k_h · k_w weights, because every filter has a kernel that reads it. In the slide these are 18 and 27, and it is easy to mix them up, so picture the grid: a filter is a row of kernels, an input channel is a column of kernels.

صيغتان تؤديان كل العمل. المرشّح يحوي c_i · k_h · k_w وزنًا، لأن فيه نواة واحدة لكل قناة إدخال. وقناة الإدخال تحوي c_o · k_h · k_w وزنًا، لأن كل مرشّح فيه نواة تقرأها. في الشريحة تساويان 18 و27، ومن السهل الخلط بينهما، لذلك تخيّل الشبكة: المرشّح صف من الأنوية، وقناة الإدخال عمود من الأنوية.

The same counts at a realistic scaleالعدّ نفسه على مقياس واقعي

Slide 17 is a toy so the picture fits. A VGG-style layer with 64 input and 64 output channels and 3 x 3 kernels has 64 x 64 x 9 = 36,864 weights, and the same slicing rules apply.

الشريحة 17 مثال مصغّر لكي تتسع الصورة. طبقة على نمط VGG فيها 64 قناة إدخال و64 قناة إخراج وأنوية 3 x 3 تحوي 64 x 64 x 9 = 36,864 وزنًا، وقواعد التقطيع نفسها تنطبق.

Unit removedالوحدة المحذوفةWeights removedالأوزان المحذوفةShareالنسبةSurviving shapeالشكل المتبقي
One kernelنواة واحدة990.024%0.024%Still [64, 64, 3, 3] with holesيبقى [64, 64, 3, 3] مع ثقوب
One filterمرشّح واحد64 x 9 = 57664 x 9 = 5761.56%1.56%[63, 64, 3, 3][63, 64, 3, 3]
One input channelقناة إدخال واحدة64 x 9 = 57664 x 9 = 5761.56%1.56%[64, 63, 3, 3][64, 63, 3, 3]
Sixteen input channelsست عشرة قناة إدخال16 x 576 = 9,21616 x 576 = 9,21625%25%[64, 48, 3, 3][64, 48, 3, 3]
Removing units from a [64, 64, 3, 3] layerحذف وحدات من طبقة بالشكل [64, 64, 3, 3]

Removing a whole filter has a second effect that Li et al. spell out. The filter's output feature map disappears, so the next layer no longer receives that channel, and the corresponding kernels in the next layer's weight tensor disappear too. Pruning m of the n filters of a layer removes m / n of the compute in that layer and in the one after it (Li et al., 2017).

لحذف مرشّح كامل (filter pruning) أثر ثانٍ يوضّحه Li et al.. خريطة الخصائص (feature map) التي يخرجها المرشّح تختفي، فلا تعود الطبقة التالية تستقبل تلك القناة، وتختفي أيضًا الأنوية المقابلة لها في موتّر أوزان الطبقة التالية. تقليم m من المرشّحات الـn في طبقة يحذف m / n من الحساب في تلك الطبقة وفي التي تليها (Li et al., 2017).

Recall

Name the four dimensions of a convolution weight in the slide's order, and give the weight count for c_o = 3, c_i = 2 and 3 x 3 kernels.سمِّ الأبعاد الأربعة لوزن الالتفاف بترتيب الشريحة، وأعطِ عدد الأوزان عندما c_o = 3 وc_i = 2 والأنوية 3 x 3.

[c_o, c_i, k_h, k_w]: output channels (filters), input channels, kernel height, kernel width. The count is 3 x 2 x 3 x 3 = 54.
[c_o, c_i, k_h, k_w]: قنوات الإخراج (المرشّحات)، وقنوات الإدخال، وارتفاع النواة، وعرض النواة. العدد 3 x 2 x 3 x 3 = 54.

Recall

How many weights go when you remove one kernel, one input channel and one filter from the 54-weight tensor?كم وزنًا يُحذف عندما تحذف نواة واحدة، وقناة إدخال واحدة، ومرشّحًا واحدًا من الموتّر ذي الـ 54 وزنًا؟

One kernel removes k_h x k_w = 9 (16.7%). One input channel removes c_o x k_h x k_w = 27 (50%). One filter removes c_i x k_h x k_w = 18 (33.3%).
النواة الواحدة تحذف k_h x k_w = 9 (16.7%). وقناة الإدخال الواحدة تحذف c_o x k_h x k_w = 27 (50%). والمرشّح الواحد يحذف c_i x k_h x k_w = 18 (33.3%).

Quick checkاختبار سريع

A convolution layer has c_o = 3, c_i = 2 and 3 x 3 kernels. Channel-level pruning removes one input channel. How many weights are removed?طبقة التفاف فيها c_o = 3 وc_i = 2 ونوى بحجم 3 x 3. يحذف التقليم على مستوى القنوات (channel-level) قناة إدخال واحدة. كم وزنًا يُحذف؟

Put the two previous ideas together and the lecture's central figure appears. Slide 18 takes the same 54-weight tensor and prunes it five times, once per unit, arranging the results on an axis from irregular to regular. Read from left to right, the holes grow from single cells, to fixed shapes inside kernels, to whole rows, to whole kernels, to an entire column of kernels.

اجمع الفكرتين السابقتين يظهر الشكل المركزي في المحاضرة. تأخذ الشريحة 18 الموتّر نفسه ذا الـ54 وزنًا وتقلّمه خمس مرات، مرة لكل وحدة، وترتّب النتائج على محور من غير المنتظم إلى المنتظم. اقرأ من اليسار إلى اليمين: تكبر الثقوب من خلايا منفردة، إلى أشكال ثابتة داخل الأنوية، إلى صفوف كاملة، إلى أنوية كاملة، إلى عمود كامل من الأنوية.

Five prunings of one tensor. Each step to the right deletes a larger unit, until the channel-level panel simply drops a column and leaves a dense 3 x 1 x 3 x 3 tensor.خمسة تقليمات لموتّر واحد. كل خطوة إلى اليمين تحذف وحدة أكبر، حتى تُسقط لوحة channel-level عمودًا كاملًا ببساطة وتترك موتّرًا كثيفًا 3 x 1 x 3 x 3.

Every panel can be counted, and counting them shows something the picture hides: every panel removes between a third and two thirds of the weights, so the real difference between them is not how much Sparsity they reach but how the zeros are arranged. The fine-grained panel keeps 23 scattered weights. The pattern-based panel keeps exactly four cells in every kernel, and each kept shape is a Tetris piece (a T or an L of four cells). The vector-level panel keeps seven of the eighteen kernel rows. The kernel-level panel drops the first filter's right kernel and the second filter's left kernel. The channel-level panel drops the whole second input channel across all three filters, and what survives is a dense [3, 1, 3, 3] tensor.

كل لوحة يمكن عدّها، والعدّ يكشف شيئًا تخفيه الصورة: كل لوحة تحذف ما بين ثلث الأوزان وثلثيها، لذلك الفرق الحقيقي بينها ليس مقدار نسبة التفرّغ (sparsity) التي تبلغها بل طريقة ترتيب الأصفار. لوحة التقليم الدقيق (fine-grained) تُبقي 23 وزنًا متناثرًا. لوحة التقليم بالأنماط (pattern-based) تُبقي أربع خلايا بالضبط في كل نواة، وكل شكل مُبقى قطعة Tetris (حرف T أو L من أربع خلايا). لوحة مستوى المتجهات (vector-level) تُبقي سبعة من صفوف الأنوية الثمانية عشر. لوحة مستوى النواة (kernel-level) تُسقط النواة اليمنى للمرشّح الأول والنواة اليسرى للمرشّح الثاني. لوحة مستوى القناة (channel-level) تُسقط قناة الإدخال الثانية كاملة عبر المرشّحات الثلاثة، وما يبقى موتّر كثيف [3, 1, 3, 3].

PanelاللوحةWhat was removedما حُذفWeights removedالأوزان المحذوفةSparsityنسبة التفرّغSurvivorما يبقى
Fine-grainedدقيق (Fine-grained)31 single weights31 وزنًا مفردًا313157.4%57.4%54 slots with holes54 موضعًا مع ثقوب
Pattern-basedقائم على الأنماط (Pattern-based)5 of 9 cells in each of 6 kernels5 من 9 خلايا في كل نواة من النوى الست6 x 5 = 306 x 5 = 3055.6%55.6%54 slots, one shape per kernel54 موضعًا، وشكل واحد لكل نواة
Vector-levelمستوى المتجه (Vector-level)11 of 18 kernel rows11 من 18 صفًّا من صفوف النوى11 x 3 = 3311 x 3 = 3361.1%61.1%54 slots with empty rows54 موضعًا مع صفوف فارغة
Kernel-levelمستوى النواة (Kernel-level)2 of 6 kernels2 من 6 نوى2 x 9 = 182 x 9 = 1833.3%33.3%54 slots with empty kernels54 موضعًا مع نوى فارغة
Channel-levelمستوى القنوات (Channel-level)1 of 2 input channels1 من قناتَي الإدخال3 x 9 = 273 x 9 = 2750.0%50.0%dense [3, 1, 3, 3]موتّر كثيف [3, 1, 3, 3]
Counting the five panels of slide 18 (54 weights each)عدّ اللوحات الخمس في الشريحة 18 (54 وزنًا في كل لوحة)

The ladder, rung by rungالسلّم درجةً درجة

Mao et al. organise four grains (fine, vector, kernel, filter) by how many dimensions each unit spans. The slide keeps their order, inserts pattern-based pruning between fine-grained and vector-level, and shows the 3-D rung as an input channel instead of Mao's filter (Mao et al., 2017, section 3.2). At the bottom, fine-grained pruning removes 0-D scalars anywhere. Pattern-based pruning keeps a small catalogue of fixed shapes inside each kernel, which the slide calls "like Tetris": the hardware knows the finite set of masks in advance instead of facing arbitrary holes. Niu et al. describe it as "fine-grained pruning patterns inside the coarse-grained structures" and, by compiling specialised code per pattern, ran networks on mobile CPUs and GPUs up to 44.5x faster than TensorFlow Lite and up to 11.4x faster than TVM with no accuracy loss (Niu et al., 2020). Vector-level pruning removes 1-D rows, W[o, i, r, :], of a kernel. Kernel-level pruning removes 2-D kernels, W[o, i, :, :]. At the top, channel pruning removes a 3-D slab: on the slide, an input channel W[:, i, :, :] across every filter.

يرتّب Mao et al. أربعة مستويات (الدقيق، والمتجه، والنواة، والمرشّح) بحسب عدد الأبعاد التي تمتد عليها كل وحدة. تحافظ الشريحة على ترتيبهم، وتُدخل التقليم بالأنماط (pattern-based) بين المستوى الدقيق ومستوى المتجه، وتعرض الدرجة ثلاثية الأبعاد (3-D) على أنها قناة إدخال بدلًا من المرشّح عند Mao (Mao et al., 2017، القسم 3.2). في الأسفل، يحذف التقليم الدقيق قيمًا عددية 0-D في أي مكان. التقليم بالأنماط يحتفظ بفهرس صغير من الأشكال الثابتة داخل كل نواة، وتصفه الشريحة بأنه "مثل Tetris": يعرف العتاد مسبقًا المجموعة المحدودة من الأقنعة بدلًا من مواجهة ثقوب عشوائية. يصفه Niu et al. بأنه "أنماط تقليم دقيقة داخل البنى الخشنة"، وبتوليد شيفرة مخصّصة لكل نمط شغّلوا الشبكات على معالجات CPU وGPU في الهواتف أسرع بما يصل إلى 44.5x من TensorFlow Lite وبما يصل إلى 11.4x من TVM دون أي خسارة في الدقة (Niu et al., 2020). تقليم مستوى المتجه يحذف صفوفًا أحادية البعد (1-D) من النواة، W[o, i, r, :]. وتقليم مستوى النواة يحذف أنوية ثنائية الأبعاد (2-D)، W[o, i, :, :]. وفي الأعلى، يحذف تقليم القنوات لوحًا ثلاثي الأبعاد (3-D): في الشريحة هو قناة إدخال W[:, i, :, :] عبر كل المرشّحات.

Granularityمستوى الدقةUnitالوحدةWeights per unitالأوزان في الوحدةIndex costكلفة الفهارسRuns efficiently onيعمل بكفاءة على
Fine-grainedدقيق (Fine-grained)Any single weight (0-D)أي وزن مفرد (0-D)11One index per surviving weightفهرس واحد لكل وزن باقٍCustom sparse engines such as EIE or SCNNمحرّكات تفرّغ مخصّصة مثل EIE أو SCNN
Pattern-basedقائم على الأنماط (Pattern-based)A fixed mask inside each kernelقناع ثابت داخل كل نواة5 per kernel5 لكل نواةOne pattern id per kernelمعرّف نمط واحد لكل نواةCompilers that specialize code per pattern (PatDNN)مترجمات (compilers) تخصّص الشيفرة لكل نمط (PatDNN)
Vector-levelمستوى المتجه (Vector-level)A row of a kernel (1-D)صف من نواة (1-D)k_w = 3k_w = 3One index per surviving rowفهرس واحد لكل صف باقٍCustom 1-D convolution hardware such as Eyerissعتاد التفاف 1-D مخصّص مثل Eyeriss
Kernel-levelمستوى النواة (Kernel-level)A whole k_h x k_w kernel (2-D)نواة كاملة k_h x k_w (2-D)99One index per surviving kernelفهرس واحد لكل نواة باقيةCustom 2-D convolution hardware (not stock dense libraries)عتاد التفاف 2-D مخصّص (وليس مكتبات الحساب الكثيف الجاهزة)
Channel-levelمستوى القنوات (Channel-level)An input channel across all filters (3-D)قناة إدخال عبر جميع المرشّحات (3-D)2727None: the tensor shrinksلا شيء: الموتّر نفسه يصغرAny dense CPU or GPU libraryأي مكتبة حساب كثيف على CPU أو GPU
Five granularities on the 54-weight tensor and the hardware each maps onto (Mao et al., 2017, section 6; Niu et al., 2020)خمسة مستويات للدقة على موتّر الأوزان الـ 54 والعتاد الذي يناسب كلًّا منها (Mao et al., 2017، القسم 6؛ Niu et al., 2020)

The right-hand column is the practical half of the story. Only the channel and filter rungs run faster on unmodified dense libraries, because the tensor simply shrinks. Kernel and vector sparsity line up with 2-D and 1-D convolution primitives (Winograd, Eyeriss-style 1-D units), which makes custom hardware simpler, but Mao et al. note they are still hard to accelerate on general-purpose processors. Pattern-based pruning needs compiler support (PatDNN) or dedicated support such as NVIDIA's 2:4 sparse tensor cores, and fine-grained sparsity needs accelerators such as EIE (Mao et al., 2017, section 6).

العمود الأيمن هو النصف العملي من القصة. درجتا القناة والمرشّح فقط تعملان أسرع على المكتبات الكثيفة دون تعديل، لأن الموتّر يصغر ببساطة. تفرّغ النواة وتفرّغ المتجه يتوافقان مع عمليات الالتفاف الأساسية 2-D و1-D (Winograd، ووحدات 1-D على نمط Eyeriss)، وهذا يبسّط العتاد المخصّص، لكن Mao et al. يلاحظون أنهما ما زالا صعبَي التسريع على المعالجات العامة. التقليم بالأنماط يحتاج إلى دعم من المترجم (PatDNN) أو دعم مخصّص مثل نوى الموتّرات المتفرّغة (sparse tensor cores) بنمط 2:4 من NVIDIA، والتفرّغ الدقيق يحتاج إلى مسرّعات مثل EIE (Mao et al., 2017، القسم 6).

Try every rung on one tensorجرّب كل درجة على موتّر واحد

The simulator below holds a random [3, 2, 3, 3] tensor and lets you prune it with any of the six units, including the filter unit that Mao et al. list alongside channels. It groups the weights by the chosen unit, scores each group with the L1 or L2 magnitude that part 05 develops, zeros the weakest groups until the target is met, and reports what survives. Watch three things as you switch units: the achieved sparsity snaps to coarser steps, the index count collapses as units grow, and only the channel and filter units ever produce a smaller dense tensor.

المحاكي أدناه يحمل موتّرًا عشوائيًا [3, 2, 3, 3] ويسمح لك بتقليمه بأي من الوحدات الست، ومنها وحدة المرشّح التي يذكرها Mao et al. إلى جانب القنوات. يجمّع الأوزان بحسب الوحدة المختارة، ويقيّم كل مجموعة بمقدار L1 أو L2 الذي يطوّره الجزء 05، ويصفّر المجموعات الأضعف حتى يبلغ الهدف، ثم يعرض ما يبقى. راقب ثلاثة أشياء وأنت تبدّل الوحدات: نسبة التفرّغ المحقّقة تقفز بخطوات أخشن، وعدد الفهارس ينهار كلما كبرت الوحدات، ووحدتا القناة والمرشّح وحدهما تنتجان موتّرًا كثيفًا أصغر.

SimulatorمحاكيGranularity pruner: one tensor, six ways to cut itمقلّم الدقة الحبيبية: موتر واحد، وست طرق لقصه
c_o = 3c_i = 2k_h × k_w = 3 × 3filter 0, input channel 0, kernel 0, row 0, column 0: -0.73filter 0, input channel 0, kernel 0, row 0, column 1: 0.39filter 0, input channel 0, kernel 0, row 0, column 2: 0.15 (pruned)filter 0, input channel 0, kernel 0, row 1, column 0: 0.15 (pruned)filter 0, input channel 0, kernel 0, row 1, column 1: 0.58filter 0, input channel 0, kernel 0, row 1, column 2: -0.19 (pruned)filter 0, input channel 0, kernel 0, row 2, column 0: -0.63filter 0, input channel 0, kernel 0, row 2, column 1: 0.09 (pruned)filter 0, input channel 0, kernel 0, row 2, column 2: 0.36filter 0, input channel 1, kernel 1, row 0, column 0: 0.25 (pruned)filter 0, input channel 1, kernel 1, row 0, column 1: 0.38filter 0, input channel 1, kernel 1, row 0, column 2: 0.05 (pruned)filter 0, input channel 1, kernel 1, row 1, column 0: -0.97filter 0, input channel 1, kernel 1, row 1, column 1: 0.24 (pruned)filter 0, input channel 1, kernel 1, row 1, column 2: -0.16 (pruned)filter 0, input channel 1, kernel 1, row 2, column 0: -0.93filter 0, input channel 1, kernel 1, row 2, column 1: 0.72filter 0, input channel 1, kernel 1, row 2, column 2: -0.45filter 1, input channel 0, kernel 2, row 0, column 0: -0.33filter 1, input channel 0, kernel 2, row 0, column 1: -0.67filter 1, input channel 0, kernel 2, row 0, column 2: 0.29 (pruned)filter 1, input channel 0, kernel 2, row 1, column 0: 0.55filter 1, input channel 0, kernel 2, row 1, column 1: -0.31 (pruned)filter 1, input channel 0, kernel 2, row 1, column 2: -0.47filter 1, input channel 0, kernel 2, row 2, column 0: 0.34filter 1, input channel 0, kernel 2, row 2, column 1: 0.19 (pruned)filter 1, input channel 0, kernel 2, row 2, column 2: -0.02 (pruned)filter 1, input channel 1, kernel 3, row 0, column 0: 0.92filter 1, input channel 1, kernel 3, row 0, column 1: -0.96filter 1, input channel 1, kernel 3, row 0, column 2: 0.70filter 1, input channel 1, kernel 3, row 1, column 0: 0.68filter 1, input channel 1, kernel 3, row 1, column 1: -0.88filter 1, input channel 1, kernel 3, row 1, column 2: 0.68filter 1, input channel 1, kernel 3, row 2, column 0: -0.22 (pruned)filter 1, input channel 1, kernel 3, row 2, column 1: -0.12 (pruned)filter 1, input channel 1, kernel 3, row 2, column 2: -0.19 (pruned)filter 2, input channel 0, kernel 4, row 0, column 0: -0.12 (pruned)filter 2, input channel 0, kernel 4, row 0, column 1: 0.75filter 2, input channel 0, kernel 4, row 0, column 2: -0.11 (pruned)filter 2, input channel 0, kernel 4, row 1, column 0: -0.63filter 2, input channel 0, kernel 4, row 1, column 1: -0.38filter 2, input channel 0, kernel 4, row 1, column 2: -0.48filter 2, input channel 0, kernel 4, row 2, column 0: 0.55filter 2, input channel 0, kernel 4, row 2, column 1: 0.70filter 2, input channel 0, kernel 4, row 2, column 2: 0.78filter 2, input channel 1, kernel 5, row 0, column 0: 0.28 (pruned)filter 2, input channel 1, kernel 5, row 0, column 1: 0.65filter 2, input channel 1, kernel 5, row 0, column 2: 0.66filter 2, input channel 1, kernel 5, row 1, column 0: -0.87filter 2, input channel 1, kernel 5, row 1, column 1: 0.47filter 2, input channel 1, kernel 5, row 1, column 2: -0.56filter 2, input channel 1, kernel 5, row 2, column 0: 0.25 (pruned)filter 2, input channel 1, kernel 5, row 2, column 1: -0.53filter 2, input channel 1, kernel 5, row 2, column 2: -0.85
Unit
Individual weight
Weights per unit
1
Slice
W[o, i, r, c]
Units removed
19 of 54

Units are ranked by the L1 norm of the weights they would remove, lowest first, and pruned until at least 19 of 54 weights are zero. Achieved sparsity snaps to whole units.تُرتَّب الوحدات حسب معيار L1 للأوزان التي ستزيلها، من الأصغر إلى الأكبر، وتُقلَّم حتى يصبح 19 وزنًا على الأقل من أصل 54أصفارًا. وتقفز التناثرية المحققة إلى مضاعفات الوحدات الكاملة.

Achieved sparsityالتناثر المحقق (sparsity)35.2%19 zerostarget 35%, rounded up to whole unitsالهدف 35%، مقرّبًا للأعلى إلى وحدات كاملة
Remaining parametersالمعاملات المتبقية35of 54values that still need storingقيم ما زالت تحتاج إلى تخزين
Index entriesمدخلات الفهرس35positionsone index per surviving weightفهرس واحد لكل وزن باقٍ
Still 54 slots in memory. The zeros sit inside the tensor, so a dense library computes them anyway; skipping them needs a sparse format and hardware that reads indices.ما زالت هناك 54 خانة في الذاكرة. الأصفار موجودة داخل الموتر، لذلك تحسبها المكتبة الكثيفة على أي حال؛ وتخطّيها يحتاج إلى صيغة متناثرة وعتاد يقرأ الفهارس.

The energy argument from part 01 also runs along this axis. Mao et al. simulated the SCNN sparse accelerator on VGG-16 and found that, at the same density, vector-level sparsity needs 30 to 35% fewer output memory references than fine-grained sparsity. Neighbouring surviving weights in a row write to the same output address, so SCNN can skip the repeated read and write of that address (Mao et al., 2017, section 6 and Table 4). Since a DRAM access costs about two hundred times a multiply, fewer memory references is where the energy goes, not fewer multiplies.

حجة الطاقة من الجزء 01 تسري أيضًا على هذا المحور. حاكى Mao et al. المسرّع المتفرّغ SCNN على VGG-16 ووجدوا أنه عند الكثافة نفسها يحتاج تفرّغ مستوى المتجه إلى مراجع ذاكرة للمخرجات أقل بنسبة 30 إلى 35% من التفرّغ الدقيق. الأوزان الباقية المتجاورة في صف واحد تكتب إلى عنوان المخرج نفسه، فيستطيع SCNN تخطّي القراءة والكتابة المكررة لذلك العنوان (Mao et al., 2017، القسم 6 والجدول 4). وبما أن الوصول إلى DRAM يكلّف نحو مئتي ضعف عملية الضرب، فإن تقليل مراجع الذاكرة هو حيث تذهب الطاقة، لا تقليل عمليات الضرب.

Recall

Order fine-grained, kernel-level, pattern-based, channel-level and vector-level pruning from irregular to regular.رتّب التقليم fine-grained وkernel-level وpattern-based وchannel-level وvector-level من غير المنتظم إلى المنتظم.

Fine-grained, pattern-based, vector-level, kernel-level, channel-level.
Fine-grained ثم pattern-based ثم vector-level ثم kernel-level ثم channel-level.

Quick checkاختبار سريع

Which granularity turns the weight tensor into a smaller dense tensor that needs no index storage at all?أي مستوى للدقة يحوّل موتّر الأوزان إلى موتّر كثيف أصغر لا يحتاج إلى تخزين أي فهارس على الإطلاق؟

Recapالخلاصة

If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا

  • Granularity is the unit you delete. Smaller units give more index choices, larger units give regular structure.الدقة (granularity) هي الوحدة التي تحذفها. الوحدات الأصغر تعطي خيارات أكثر لمواضع الحذف، والوحدات الأكبر تعطي بنية منتظمة.
  • Coarse-grained masks are a subset of fine-grained masks, so at equal accuracy structured pruning reaches equal or lower sparsity, never higher, for the best achievable mask under the same retraining.أقنعة التقليم الخشن مجموعة جزئية من أقنعة التقليم الدقيق، لذلك عند الدقة نفسها يبلغ التقليم المنظَّم (structured) نسبة تفرّغ مساوية أو أقل، لا أعلى أبدًا، وذلك لأفضل قناع ممكن تحت إعادة التدريب نفسها.
  • Fine-grained pruning is hard to accelerate because zeros sit anywhere. Channel or filter pruning yields a smaller dense tensor that any library runs.يصعب تسريع التقليم الدقيق لأن الأصفار قد تقع في أي مكان. أما تقليم القنوات أو المرشّحات فينتج موتّرًا (tensor) كثيفًا أصغر تشغّله أي مكتبة.
  • Convolution weights are [c_o, c_i, k_h, k_w]. Slide 17's example holds 3 x 2 x 3 x 3 = 54 weights.أوزان الالتفاف بالشكل [c_o, c_i, k_h, k_w]. مثال الشريحة 17 يحوي 3 x 2 x 3 x 3 = 54 وزنًا.
  • From irregular to regular: fine-grained, pattern-based, vector-level, kernel-level, channel-level.من غير المنتظم إلى المنتظم: fine-grained ثم pattern-based ثم vector-level ثم kernel-level ثم channel-level.
  • Removing one kernel drops k_h x k_w weights, one input channel drops c_o x k_h x k_w, one filter drops c_i x k_h x k_w.حذف نواة واحدة يُسقط k_h x k_w من الأوزان، وحذف قناة إدخال واحدة يُسقط c_o x k_h x k_w، وحذف مرشّح واحد يُسقط c_i x k_h x k_w.
  • Coarser grains share indices, so their storage penalty is smaller than their sparsity penalty (Mao et al.).الوحدات الأخشن تتشارك الفهارس، لذلك تكون خسارتها في التخزين أصغر من خسارتها في نسبة التفرّغ (Mao et al.).

Sourcesالمصادر