COE 592Lecture 4.2المحاضرة 4.2Referenceالمرجع
Reference sheetالورقة المرجعية
Pruning ratios, fine-tuning and sparse hardware compressed onto one page: the definitions, formulas and numbers to have in your head before a quiz or exam.محاضرة «نسب التقليم والضبط الدقيق والعتاد المتناثر» مضغوطة في صفحة واحدة: التعريفات والمعادلات والأرقام التي يجب أن تكون حاضرة في ذهنك قبل الاختبار القصير أو الامتحان.
The pruning problemمسألة الحذف (pruning)
Among all weight tensors with at most N nonzeros, pick the one with the lowest loss. Part 01: Where we are
من بين كل موترات الأوزان التي تحتوي على N قيمة غير صفرية على الأكثر، اختر الموتر صاحب أقل loss. Part 01: Where we are
Every symbolكل رمز
- L
- The training loss, for example cross-entropyدالة الخسارة (loss) أثناء التدريب، مثل cross-entropy
- x
- The input data the loss is evaluated onبيانات الإدخال التي تُحسب عليها الخسارة
- W
- The original dense trained weightsالأوزان الأصلية الكثيفة بعد التدريب
- W_P
- The pruned weights, same shape as W, some entries forced to exactly zeroالأوزان بعد الحذف، بنفس شكل W، وبعض عناصرها مُجبرة على أن تساوي الصفر تمامًا
- ||W_P||_0
- The number of nonzeros in W_P. Not a norm, no usable gradientعدد القيم غير الصفرية في W_P. ليس norm، وليس له تدرج (gradient) قابل للاستخدام
- N
- The nonzero budget. With M weights, sparsity is 1 - N / Mميزانية القيم غير الصفرية. مع M وزنًا تكون الـsparsity مساوية لـ 1 - N / M
Magnitude pruning on a 2 x 2 matrix at 50 percentحذف بالمقدار (magnitude pruning) على مصفوفة 2 x 2 بنسبة 50 بالمئة
- W
- [[3, -2], [1, -5]]
- |W|
- [[3, 2], [1, 5]]
- Keep top 2احتفظ بأعلى 2
- importances 5, 3, so -5 and 3 surviveالأهميات 5, 3، لذا تبقى -5 و3
- W_P
- [[3, 0], [0, -5]], ||W_P||_0 = 2, sparsity 50%[[3, 0], [0, -5]]، ||W_P||_0 = 2، والـsparsity تساوي 50%
| Questionالسؤال | Asksما يسأل عنه | Answered inتُجاب في |
|---|---|---|
| Formulationالصياغة (Formulation) | What is pruning and how is it written?ما هو الحذف وكيف يُكتب؟ | 04-1, and part 01 hereالمحاضرة 04-1، والجزء 01 هنا |
| Granularityدرجة الدقة (Granularity) | In what pattern are weights removed?بأي نمط تُحذف الأوزان؟ | 04-1 |
| Criterionالمعيار (Criterion) | By what score are weights ranked?بأي درجة تُرتَّب الأوزان؟ | 04-1 |
| Ratioالنسبة (Ratio) | What sparsity does each layer get?ما الـsparsity التي تحصل عليها كل طبقة؟ | Parts 02 to 05الأجزاء من 02 إلى 05 |
| Fine-tuneFine-tune | How is the lost accuracy recovered?كيف تُستعاد الدقة المفقودة؟ | Part 06الجزء 06 |
| Levelالمستوى | What is removedما الذي يُحذف | Flexibilityالمرونة | Hardware friendlinessملاءمة العتاد |
|---|---|---|---|
| Fine-grainedدقيق الحبيبات (Fine-grained) | Single weights anywhereأوزان مفردة في أي موضع | Highestالأعلى | Indices plus sparse kernels (EIE)فهارس مع sparse kernels (EIE) |
| Pattern-based (2:4)قائم على نمط (2:4) | Two of every four along a rowوزنان من كل أربعة على طول الصف | Highعالية | 2-bit tags, Ampere tensor coresعلامات بطول 2-bit، وtensor cores في Ampere |
| Vector or kernelمتجه أو kernel | A row segment or a whole k x k kernelجزء من صف أو kernel كامل بحجم k x k | Mediumمتوسطة | Fewer indices per blockفهارس أقل لكل كتلة |
| Channelقناة (Channel) | A whole filter and its output channelمرشح (filter) كامل مع قناة الخرج التابعة له | Lowestالأدنى | Dense kernels, layer simply narrowskernels كثيفة، والطبقة تضيق ببساطة |
Removing a neuron deletes one row of W (out x in); removing a conv channel deletes one whole filter (C_in x k x k). Both are coarse-grained weight pruning; the criterion is a separate choice from the granularity.
حذف neuron يحذف صفًا واحدًا من W (out x in)، وحذف قناة في طبقة conv يحذف filter كاملًا (C_in x k x k). كلاهما حذف أوزان خشن الحبيبات (coarse-grained)، والمعيار (criterion) اختيار منفصل عن درجة الدقة (granularity).
Sensitivity analysisتحليل الحساسية (sensitivity analysis)
Uniform shrinking gives every layer the same factor and loses 2.1 points on MobileNet at the same latency (68.4% at 72.3 ms against AMC 70.5% at 68.3 ms). Layers differ in sensitivity, so each needs its own ratio. Part 02: Why per-layer ratios
التقليص المنتظم (uniform shrinking) يعطي كل طبقة المعامل نفسه، ويخسر 2.1 points على MobileNet عند زمن التنفيذ نفسه (68.4% عند 72.3 ms مقابل 70.5% لـAMC عند 68.3 ms). الطبقات تختلف في حساسيتها، لذلك تحتاج كل طبقة نسبتها الخاصة. Part 02: Why per-layer ratios
The sweepالمسح
- 1. Pick a layer L_i1. اختر طبقة L_i
- Every other layer stays exactly as trainedتبقى كل الطبقات الأخرى تمامًا كما دُرّبت
- 2. Prune only L_i2. احذف من L_i فقط
- Magnitude, fine-grained, at r in {0, 0.1, ..., 0.9}بالمقدار (magnitude)، دقيق الحبيبات، عند r ضمن {0, 0.1, ..., 0.9}
- 3. Record Delta Acc3. سجّل Delta Acc
- Delta Acc_r^i = Acc_dense - Acc_r^i, one evaluation per r, no trainingDelta Acc_r^i = Acc_dense - Acc_r^i، تقييم واحد لكل r، دون تدريب
- 4. Restore and repeat4. استرجع وكرّر
- Copy the saved dense tensor back, move to the next layerانسخ الموتر الكثيف المحفوظ إلى مكانه، ثم انتقل إلى الطبقة التالية
- Costالتكلفة
- Layers x ratios evaluations: 11 x 10 = 110 for VGG-11, about 1.1 million forward passes on the 10,000 CIFAR-10 test imagesعدد الطبقات مضروبًا في عدد النسب من التقييمات: 11 x 10 = 110 لـVGG-11، أي نحو 1.1 million تمرير أمامي (forward pass) على صور اختبار CIFAR-10 البالغة 10,000
| Layerالطبقة | r = 0.5r = 0.5 | 0.60.6 | 0.70.7 | 0.80.8 | 0.90.9 | Verdictالحكم |
|---|---|---|---|---|---|---|
| L0 (first conv)L0 (أول طبقة conv) | 92 | 88 | 83 | 71 | 32 | Most sensitiveالأكثر حساسية |
| L1 | 93 | 93 | 93 | 92 | 85 | Most redundantالأكثر تكرارًا (redundancy) |
| L2 | 93 | 93 | 90 | 90 | 79 | Redundantفيها تكرار |
| L3 | 93 | 93 | 90 | 86 | 51 | Moderateمتوسطة |
| L4 | 93 | 93 | 90 | 78 | 38 | Sensitive past 70حساسة بعد 70 |
| L5 | 93 | 92 | 92 | 90 | 82 | Redundantفيها تكرار |
Threshold read-off and the overall rateالقراءة عند العتبة والمعدل الكلي
One horizontal line at accuracy threshold T turns six curves into six rates. Part 03: Reading sensitivity curves
خط أفقي واحد عند عتبة الدقة T يحوّل ستة منحنيات إلى ست نسب. Part 03: Reading sensitivity curves
| Layerالطبقة | Rateالنسبة | Whyالسبب |
|---|---|---|
| L0 | about 73%نحو 73% | Crosses T between the 70 and 80 percent pointsتعبر T بين نقطتي 70 و80 بالمئة |
| L1, L2, L5 | 90% (maximum swept)90% (أقصى قيمة في المسح) | Never cross T inside the sweepلا تعبر T أبدًا داخل المسح |
| L3 | about 82%نحو 82% | Crosses just past 80 percentتعبر بعد 80 بالمئة بقليل |
| L4 | about 80%نحو 80% | Its 80 percent point sits just under the lineنقطة 80 بالمئة فيها تقع تحت الخط بقليل |
| Layerالطبقة | r = 50%r = 50% | 60%60% | 70%70% | 80%80% | 90%90% | Rateالنسبة |
|---|---|---|---|---|---|---|
| A (100,000 weights)A (100,000 وزن) | 90% | 84% | 70% | 52% | 30% | 50% |
| B (400,000 weights)B (400,000 وزن) | 95% | 93% | 91% | 86% | 75% | 70% |
| C (500,000 weights)C (500,000 وزن) | 95% | 95% | 94% | 93% | 90% | 90% |
Worked numbersالأرقام المحلولة
- Weighted sumالمجموع الموزون
- 100,000 x 0.5 + 400,000 x 0.7 + 500,000 x 0.9 = 780,000
- Overall rate Rالمعدل الكلي R
- 780,000 / 1,000,000 = 78%
- Remaining, compressionالمتبقي، ونسبة الضغط
- 220,000 weights, about 4.5x220,000 وزن، أي نحو 4.5x
- Unweighted mean (wrong)المتوسط غير الموزون (خطأ)
- (50 + 70 + 90) / 3 = 70%
- VGG-11 at the slide's TVGG-11 عند T الخاصة بالشريحة
- rates 0.73, 0.90, 0.90, 0.82, 0.80, 0.90 give R = 86.3% (7.3x) against an unweighted 84.2%النسب 0.73, 0.90, 0.90, 0.82, 0.80, 0.90 تعطي R = 86.3% (7.3x) مقابل 84.2% للمتوسط غير الموزون
Three ways to allocate one budgetثلاث طرق لتوزيع ميزانية واحدة
| Methodالطريقة | Who chooses the ratiosمن يختار النسب | Costالتكلفة | Interaction modelledهل يُنمذَج التفاعل | Transfersقابلية النقل |
|---|---|---|---|---|
| Sensitivity analysisتحليل الحساسية | One curve per layer plus one threshold Tمنحنى لكل طبقة مع عتبة واحدة T | Layers x ratios single-layer evaluationsعدد الطبقات مضروبًا في عدد النسب من التقييمات لطبقة واحدة | No, layers swept aloneلا، كل طبقة تُمسح وحدها | No, curves belong to one networkلا، المنحنيات تخص شبكة واحدة |
| AMC | A DDPG agent, layer by layerوكيل DDPG، طبقة بعد طبقة | Hundreds of pruned networks, no retrainingمئات الشبكات المحذوفة، دون إعادة تدريب | Yes, the reward sees the whole networkنعم، المكافأة ترى الشبكة كلها | New search per model and budgetبحث جديد لكل نموذج وكل ميزانية |
| NetAdapt | A greedy rule: the proposal with the highest accuracyقاعدة جشعة (greedy): المقترح صاحب أعلى دقة | K proposals per iteration, each short-term fine-tunedK مقترحات في كل تكرار، ولكل منها fine-tune قصير المدى | Yes, one layer at a time on the current networkنعم، طبقة واحدة في كل مرة على الشبكة الحالية | New run per device and budgetتشغيل جديد لكل جهاز وكل ميزانية |
AMC: pruning as reinforcement learningAMC: الحذف كمسألة تعلم معزز (reinforcement learning)
Fifty layers with ten candidate ratios each is 10^50 configurations. A DDPG agent learns only the per-layer ratio; magnitude selection inside each layer and one final fine-tune are unchanged. Part 04: AMC
خمسون طبقة مع عشر نسب مرشحة لكل منها تعطي 10^50 تشكيلة. وكيل DDPG يتعلم فقط نسبة كل طبقة، أما اختيار الأوزان بالمقدار (magnitude) داخل كل طبقة وfine-tune النهائي الوحيد فيبقيان كما هما. Part 04: AMC
The RL ingredientsمكونات الـ RL
- Stateالحالة (State)
- Layer embedding: eleven scaled features (t, n, c, h, w, stride, k, FLOPs[t], reduced, rest, a[t-1])تمثيل الطبقة (layer embedding): إحدى عشرة خاصية مُقيَّسة (t, n, c, h, w, stride, k, FLOPs[t], reduced, rest, a[t-1])
- Actionالفعل (Action)
- One continuous sparsity ratio a_t in (0, 1] for the current layerنسبة sparsity متصلة واحدة a_t ضمن (0, 1] للطبقة الحالية
- Agentالوكيل (Agent)
- DDPG, actor-critic: actor proposes a_t, critic scores Q(s_t, a_t)DDPG من نوع actor-critic: الـactor يقترح a_t، والـcritic يقيّم Q(s_t, a_t)
- Environmentالبيئة (Environment)
- Channel pruning of the pretrained network, magnitude selection inside each layerحذف القنوات (channel pruning) من الشبكة المدربة مسبقًا، مع اختيار بالمقدار داخل كل طبقة
- Rewardالمكافأة (Reward)
- -Error after all layers are pruned, if the FLOPs or latency budget holds-Error بعد حذف كل الطبقات، إذا تحققت ميزانية FLOPs أو زمن التنفيذ
- Episodeالحلقة (Episode)
- One pass over all layers, one pruned network, one reward, no fine-tuning during searchمرور واحد على كل الطبقات، وشبكة محذوفة واحدة، ومكافأة واحدة، ولا fine-tuning أثناء البحث
| Regionالمنطقة | Human expertالخبير البشري | AMCAMC |
|---|---|---|
| Conv1 | 50% | 43% |
| ResBlock1 to ResBlock4من ResBlock1 إلى ResBlock4 | 31, 31, 30, 30% | 28, 28, 23, 19% |
| FC | 20% | 10% |
| Total (compression)الإجمالي (نسبة الضغط) | 29% (3.4x) | 20% (5x) |
| Top-1 | 76.13% | 76.11% |
The agent keeps 1x1 layers denser (peaks) and prunes 3x3 layers harder (crests): a stage-3 bottleneck holds about 590K of its 1.1M weights in the 3x3 layer.
يُبقي الوكيل طبقات 1x1 أكثر كثافة (القمم) ويحذف من طبقات 3x3 بقوة أكبر (القيعان): في bottleneck من المرحلة الثالثة تحمل طبقة 3x3 نحو 590K من أصل 1.1M وزن.
| Modelالنموذج | MACsMACs | Top-1Top-1 | Latencyزمن التنفيذ | Speedupالتسريع |
|---|---|---|---|---|
| 1.0 MobileNet | 569M | 70.6% | 119.0 ms | 1x |
| AMC (50% FLOPs)AMC (50% من FLOPs) | 285M | 70.5% | 64.4 ms | 1.8x |
| AMC (50% Time)AMC (50% من الزمن) | 272M | 70.2% | 59.7 ms | 2.0x |
| 0.75 MobileNet (uniform)0.75 MobileNet (منتظم) | 325M | 68.4% | 69.5 ms | 1.7x |
NetAdapt: platform-aware pruning to a latency budgetNetAdapt: حذف يراعي المنصة للوصول إلى ميزانية زمن تنفيذ
A rule-based, iterative, progressive method: tighten the constraint by Delta R each round, thin one layer, keep the proposal that hurts least. Part 05: NetAdapt
طريقة قائمة على قواعد، تكرارية وتدريجية: شدّد القيد بمقدار Delta R في كل جولة، وقلّص طبقة واحدة، واحتفظ بالمقترح الأقل ضررًا. Part 05: NetAdapt
One iterationتكرار واحد
- 1. Constraint1. القيد
- Con = Res_i - Delta R_i
- 2. Propose, per layer k2. اقترح، لكل طبقة k
- From the lookup table, the largest filter count that meets Con; keep the largest-l2 filtersمن جدول البحث (lookup table)، أكبر عدد من الـfilters يحقق Con؛ واحتفظ بالـfilters صاحبة أكبر l2
- 3. Short-term fine-tune3. fine-tune قصير المدى
- About 10k iterations, then measure holdout accuracyنحو 10k تكرار، ثم قِس الدقة على بيانات holdout
- 4. Pick4. اختر
- The proposal with the highest accuracy becomes Net_(i+1)المقترح صاحب أعلى دقة يصبح Net_(i+1)
- 5. Repeat5. كرّر
- While the latency is still above the budgetما دام زمن التنفيذ أعلى من الميزانية
- 6. Long-term fine-tune6. fine-tune طويل المدى
- Once, to convergence; adds 1.8 to 4.5 points and is the number reportedمرة واحدة حتى التقارب؛ يضيف من 1.8 إلى 4.5 نقطة، وهو الرقم المنشور
| Networkالشبكة | Top-1Top-1 | MACsMACs | Latencyزمن التنفيذ |
|---|---|---|---|
| 25% MobileNetV1 (128) | 45.1% | 13.6M (100%) | 4.65 ms (100%) |
| MorphNet | 46.0% | 15.0M (110%) | 6.52 ms (140%) |
| NetAdapt guided by MACsNetAdapt موجَّه بـMACs | 46.3% | 11.0M (81%) | 6.01 ms (129%) |
Per-layer tables are indexed by layer shape, measured once on the device and summed; removing filters in layer k also removes input channels of layer k + 1. Worked hand run: 10.0 ms to a 7.0 ms budget with Delta R = 1.0 ms takes three iterations (9.0, 7.6, 6.5 ms), and the constraint is always set from the current latency, not the budget.
جداول كل طبقة مفهرسة بشكل الطبقة، تُقاس مرة واحدة على الجهاز ثم تُجمع، وحذف filters من الطبقة k يحذف أيضًا قنوات الإدخال في الطبقة k + 1. مثال محلول يدويًا: الانتقال من 10.0 ms إلى ميزانية 7.0 ms مع Delta R = 1.0 ms يحتاج ثلاث تكرارات (9.0، 7.6، 6.5 ms)، والقيد يُحدد دائمًا من زمن التنفيذ الحالي لا من الميزانية.
| Initial Delta RDelta R الابتدائي | Decayمعامل التناقص (Decay) | Iterationsالتكرارات | Top-1Top-1 | Latencyزمن التنفيذ |
|---|---|---|---|---|
| 0.5 ms | 0.96 | 28 | 47.7% | 4.63 ms |
| 0.5 ms | 1.0 | 20 | 47.4% | 4.71 ms |
| 0.8 ms | 0.95 | 20 | 46.7% | 4.65 ms |
Slide 40: 1.7x faster than the width-multiplier baseline and 1.6x faster than MorphNet at equal or 0.3% higher accuracy on a Pixel 1 CPU; about 1.2x on a mobile GPU because of fixed overhead.
الشريحة 40: أسرع بـ1.7x من خط الأساس القائم على width multiplier، وأسرع بـ1.6x من MorphNet، بدقة مساوية أو أعلى بـ0.3% على CPU لهاتف Pixel 1، ونحو 1.2x فقط على GPU الهاتف بسبب التكلفة الثابتة.
| Aspectالجانب | AMCAMC | NetAdaptNetAdapt |
|---|---|---|
| Who decidesمن يقرر | DDPG agent learns a policy from rewardsوكيل DDPG يتعلم سياسة (policy) من المكافآت | Greedy rule: highest short-term accuracy winsقاعدة جشعة: الأعلى دقة على المدى القصير يفوز |
| Search unitوحدة البحث | Every layer once per episodeكل طبقة مرة واحدة في كل episode | One layer changed per iteration, all layers triedطبقة واحدة تتغير في كل تكرار، مع تجربة كل الطبقات |
| Cost modelنموذج التكلفة | FLOPs or latency in the reward, optional lookup tableFLOPs أو زمن التنفيذ داخل المكافأة، مع جدول بحث اختياري | Per-layer latency lookup table, measured and summedجدول بحث لزمن تنفيذ كل طبقة، يُقاس ثم يُجمع |
| Fine-tuningالـfine-tuning | One fine-tune of the final networkfine-tune واحد للشبكة النهائية | Short-term per proposal, long-term onceقصير المدى لكل مقترح، وطويل المدى مرة واحدة |
| Outputالمخرَج | One model per targetنموذج واحد لكل هدف | A model at every iteration, the whole frontierنموذج عند كل تكرار، أي منحنى الحدود (frontier) كاملًا |
Fine-tuning, iterative pruning and regularizationالـfine-tuning والحذف التكراري والـregularization
Pruning removes terms from a function the survivors were tuned to complete; fine-tuning at 1/10 to 1/100 of the original learning rate lets them absorb the work without leaving the minimum the ranking was measured in. Pipeline: Train Connectivity, Prune Connections, Train Weights, with a loop arrow back. Part 06: Fine-tuning and iterative pruning
الحذف يزيل حدودًا من دالة كانت الأوزان الباقية مضبوطة لتكملها، والـfine-tuning بمعدل تعلم يساوي 1/10 إلى 1/100 من الأصلي يسمح لها بامتصاص هذا العمل دون مغادرة النقطة الدنيا التي قيس فيها الترتيب. خط المعالجة: Train Connectivity ثم Prune Connections ثم Train Weights، مع سهم حلقة يعود إلى البداية. Part 06: Fine-tuning and iterative pruning
AlexNet, Han et al. 2015AlexNet، Han et al. 2015
- Parametersالمعاملات
- 61M to 6.7M (9x)61M إلى 6.7M (9x)
- Top-1 / top-5 errorخطأ top-1 / top-5
- 42.78 to 42.77% / 19.73 to 19.67%42.78 إلى 42.77% / 19.73 إلى 19.67%
- Learning rateمعدل التعلم
- 1/100 of the original for AlexNet, 1/10 for LeNet1/100 من الأصلي لـAlexNet، و1/10 لـLeNet
- Training versus retrainingالتدريب مقابل إعادة التدريب
- 75 h versus 173 h on a Titan X75 h مقابل 173 h على Titan X
- VGG-16
- 138M to 10.3M (13x) in five iterations138M إلى 10.3M (13x) في خمسة تكرارات
| Ratioالنسبة | Pruned awayالمحذوف | What happens thereما يحدث عندها |
|---|---|---|
| 2x | 50% | Free lunch, no retraining neededوجبة مجانية، لا حاجة لإعادة التدريب |
| 3x | 66.7% | Where pruning-only starts losingحيث يبدأ الحذف وحده بالخسارة |
| 5x | 80% | Single prune plus fine-tune, no lossحذف واحد مع fine-tune، دون خسارة |
| 9x | 88.9% | Iterative, no loss on AlexNetتكراري، دون خسارة على AlexNet |
| 10x | 90% | Iterative curve begins to dropيبدأ المنحنى التكراري بالهبوط |
| 13x | 92.3% | VGG-16 iterative resultنتيجة VGG-16 التكرارية |
| Curveالمنحنى | Within 0.5% loss up toضمن خسارة 0.5% حتى | Reaches about -4% atيصل إلى نحو -4% عند |
|---|---|---|
| Pruning onlyالحذف وحده | about 65%نحو 65% | about 80% (5x)نحو 80% (5x) |
| Pruning + fine-tuningالحذف + fine-tuning | about 85%نحو 85% | about 93% (14x)نحو 93% (14x) |
| Iterative pruning + fine-tuningالحذف التكراري + fine-tuning | about 92%نحو 92% | about 95.5% (22x)نحو 95.5% (22x) |
| L1L1 | L2L2 | |
|---|---|---|
| Penaltyالعقوبة (Penalty) | lambda |W| | lambda ||W||^2 |
| Gradientالتدرج (Gradient) | lambda sign(w), constantlambda sign(w)، ثابت | 2 lambda w, shrinks with w2 lambda w، يصغر مع w |
| Effect per stepالأثر في كل خطوة | Subtract a fixed amountطرح مقدار ثابت | Multiply by a factor below oneالضرب في معامل أقل من واحد |
| Where weights endأين تنتهي الأوزان | Exactly zero, then stayصفر تمامًا، ثم تبقى عنده | Small but never zeroصغيرة لكنها لا تصبح صفرًا أبدًا |
| Before retraining (Han et al.)قبل إعادة التدريب (Han et al.) | Betterأفضل | Worseأسوأ |
| After retraining (Han et al.)بعد إعادة التدريب (Han et al.) | Worseأسوأ | Better, best overallأفضل، والأفضل إجمالًا |
Worked: w = 0.05, lambda = 0.01, eta = 0.1. L1 subtracts 0.001 per step and reaches zero in 50 steps. L2 multiplies by 0.998 per step: 0.0452 after 50, 0.0068 after 1000, never zero. Han et al. found L2 best overall for magnitude pruning.
مثال محلول: w = 0.05، lambda = 0.01، eta = 0.1. الـL1 يطرح 0.001 في كل خطوة فيصل إلى الصفر خلال 50 خطوة. أما L2 فيضرب في 0.998 في كل خطوة: 0.0452 بعد 50 خطوة، و0.0068 بعد 1000، ولا يصل إلى الصفر أبدًا. وجد Han et al. أن L2 هو الأفضل إجمالًا لحذف الأوزان بالمقدار.
EIE: why sparsity needs hardwareEIE: لماذا تحتاج الـsparsity إلى عتاد
A 91% sparse AlexNet FC6 on vendor sparse kernels gains little and can lose. Part 07: EIE
طبقة FC6 من AlexNet بنسبة sparsity تبلغ 91%، عند تشغيلها بمكتبات sparse kernels من الشركات المصنعة، تكسب القليل وقد تخسر. Part 07: EIE
| Platformالمنصة | Batchالدفعة | Denseكثيف | Sparseمتناثر | Sparse vs denseالمتناثر مقابل الكثيف |
|---|---|---|---|---|
| Core i7-5930k CPU | 1 | 7516.2 us | 3066.5 us | 2.5x fasterأسرع 2.5x |
| Titan X GPU | 1 | 541.5 us | 134.8 us | 4.0x fasterأسرع 4.0x |
| Titan X GPU | 64 | 19.8 us | 94.6 us | 4.8x slowerأبطأ 4.8x |
| EIE, 64 PEsEIE، 64 وحدة PE | 1 | sparse onlyمتناثر فقط | 30.3 us | 248x vs dense CPU248x مقابل CPU الكثيف |
| Sourceالمصدر | Sparsity or bitsالـ sparsity أو عدد البتات | Computeالحساب | Memoryالذاكرة | Rule of thumbالقاعدة العامة |
|---|---|---|---|---|
| Sparse weightأوزان متناثرة | 90% static90% ثابتة (static) | 10x | 5x (index overhead)5x (زيادة الفهارس) | 0 x A = 0 |
| Sparse activationactivations متناثرة | 70% dynamic70% ديناميكية (dynamic) | 3x | none claimedلم يُذكر توفير | W x 0 = 0 |
| Weight sharingمشاركة الأوزان (weight sharing) | 4-bit codesرموز بطول 4-bit | none claimedلم يُذكر توفير | 8x | 2.09, 1.92 => 2 |
Worked 8 x 4 example with a = (0, 2, 0, 1) and eleven nonzeros: two broadcasts, seven multiplications instead of 32, columns 0 and 2 never visited, MACs per PE 3, 0, 3, 1. EIE accelerates only matrix-vector products in FC and LSTM layers at batch size 1.
مثال محلول 8 x 4 مع a = (0, 2, 0, 1) وإحدى عشرة قيمة غير صفرية: عمليتا بث، وسبع عمليات ضرب بدل 32، والعمودان 0 و2 لا يُزاران أبدًا، وعدد MACs لكل PE هو 3, 0, 3, 1. يسرّع EIE فقط ضرب المصفوفة في المتجه في طبقات FC وLSTM عند حجم دفعة يساوي 1.
Inside the PE and the storage formatداخل الـPE وصيغة التخزين
Five stages in orderخمس مراحل بالترتيب
- 1. Act Queue
- FIFO of broadcast (a_j, j) pairs, depth 8; depth 1 idles about half of all cyclesطابور FIFO لأزواج (a_j, j) المبثوثة، بعمق 8؛ والعمق 1 يترك الوحدة خاملة في نحو نصف الدورات
- 2. Pointer Read
- p_j and p_(j+1) from even and odd banks in one cycle; entry count is p(j+1) - p(j)p_j وp_(j+1) من البنكين الزوجي والفردي في دورة واحدة؛ وعدد المدخلات هو p(j+1) - p(j)
- 3. Sparse Matrix Access
- 8-bit entries, 4-bit code plus 4-bit relative index; one 64-bit read returns 8 entriesمدخلات بطول 8-bit: رمز 4-bit مع فهرس نسبي 4-bit؛ وقراءة واحدة بطول 64-bit تعيد 8 مدخلات
- 4. Arithmetic Unit
- Decoder expands the code to 16-bit fixed point; address accumulator sums relative indices; multiply-add with bypassالـdecoder يوسّع الرمز إلى 16-bit بفاصلة ثابتة (fixed point)؛ ومُجمِّع العناوين يجمع الفهارس النسبية؛ ثم ضرب وجمع (multiply-add) مع مسار تجاوز (bypass)
- 5. Act R/W
- Source and destination register files, 64 x 16 bits each, swap roles per layerملفا سجلات للمصدر والوجهة، كل منهما 64 x 16 bits، يتبادلان الدورين في كل طبقة
- Tailالذيل
- ReLU, then leading nonzero detection feeds the next layer's broadcastReLU، ثم leading nonzero detection يغذي البث في الطبقة التالية
Storage formats and bit widthsصيغ التخزين وعرض البتات
- Weight code vرمز الوزن v
- 4 bits, index into a 16-entry per-layer codebook4 bits، فهرس داخل codebook من 16 مدخلًا لكل طبقة
- Relative index xالفهرس النسبي x
- 4 bits, zeros since the previous entry, at most 154 bits، عدد الأصفار منذ المدخل السابق، بحد أقصى 15
- Paddingالحشو (Padding)
- gap above 15: insert v = 0, x = 15, keep countingفجوة أكبر من 15: أدخل v = 0, x = 15 واستمر في العد
- Pointer p(j)المؤشر p(j)
- 16 bits, start of column j16 bits، بداية العمود j
- Arithmeticالحساب
- 16-bit fixed point (79.8% vs 80.3% FP32; 8-bit collapses to 53%)16-bit بفاصلة ثابتة (79.8% مقابل 80.3% لـFP32؛ و8-bit تنهار إلى 53%)
- Per PEلكل PE
- 162 KB SRAM, 93% of area, 0.638 mm2, 9.157 mW at 800 MHz, 45 nm162 KB SRAM، تشغل 93% من المساحة، و0.638 mm2، و9.157 mW عند 800 MHz، بتقنية 45 nm
- Chipالشريحة
- 64 PEs, about 600 mW, 21 LNZD nodes (16 + 4 + 1)64 وحدة PE، نحو 600 mW، و21 عقدة LNZD (16 + 4 + 1)
Relative-index CSC on the running exampleصيغة relative-index CSC على المثال المستمر
- PE0 slice (rows 0, 4)شريحة PE0 (الصفان 0 و4)
- [w00, w01, 0, w03] over [0, 0, w42, w43][w00, w01, 0, w03] فوق [0, 0, w42, w43]
- Values vالقيم v
- [w00, w01, w42, w03, w43]
- Relative index xالفهرس النسبي x
- [0, 0, 1, 0, 0]
- Pointers pالمؤشرات p
- [0, 1, 2, 3, 5]
- Column [0,0,5,0,0,0,0,7]العمود [0,0,5,0,0,0,0,7]
- v = [5, 7], z = [2, 4]
EIE results and what came afterنتائج EIE وما جاء بعده
After the accumulators, ReLU then leading nonzero detection make the output the next layer's sparse input without leaving the chip. Part 09: EIE results and lessons
بعد المجمِّعات، تطبَّق ReLU ثم leading nonzero detection، فيصبح الخرج مدخلًا متناثرًا للطبقة التالية دون مغادرة الشريحة. Part 09: EIE results and lessons
| Factorالعامل | Sizeالحجم | Where it comes fromمن أين يأتي | Mechanismالآلية |
|---|---|---|---|
| SRAM instead of DRAMSRAM بدل DRAM | 120x | 5 pJ vs 640 pJ per 32-bit read (128x, rounded)5 pJ مقابل 640 pJ لكل قراءة 32-bit (128x، مقرّبة) | Compression makes the model fit on chipالضغط يجعل النموذج يتسع داخل الشريحة |
| Weight sparsityتناثر الأوزان (weight sparsity) | 10x | 10% densityكثافة 10% | Zeros never stored or fetchedالأصفار لا تُخزَّن ولا تُجلب أبدًا |
| Weight sharingمشاركة الأوزان | 8x | 4-bit codes vs 32-bitرموز 4-bit مقابل 32-bit | Decoder expands on the way to the multiplierالـdecoder يوسّع الرمز في الطريق إلى المضاعِف |
| Activation skippingتخطي الـactivations | 3x | about 70% zeros after ReLUنحو 70% أصفار بعد ReLU | Never broadcast a zeroلا يُبث الصفر أبدًا |
Headline numbers to quote and qualifyالأرقام الرئيسية التي تُذكر مع شروطها
- Speedالسرعة
- 189x vs Core i7 CPU, 13x vs Titan X GPU, batch size 1189x مقابل Core i7 CPU، و13x مقابل Titan X GPU، بحجم دفعة 1
- Energyالطاقة
- 24,000x vs CPU, 3,400x vs GPU, 2,700x vs Tegra K124,000x مقابل CPU، و3,400x مقابل GPU، و2,700x مقابل Tegra K1
- Theory versus measuredالنظري مقابل المقاس
- 28,800x on paper; about 10x lower measured because of index overhead and 45 nm vs 28 nm28,800x على الورق؛ والمقاس أقل بنحو 10x بسبب زيادة الفهارس والفرق بين 45 nm و28 nm
- Throughputالإنتاجية (Throughput)
- 102 GOPS on the compressed network equals about 3 TOPS dense102 GOPS على الشبكة المضغوطة تعادل نحو 3 TOPS على شبكة كثيفة
- FLOP reduction per layerتقليل FLOP لكل طبقة
- 1 / (d_weight x d_activation): AlexNet-6 33x, VGG-6 100x, LSTM layers 10x (activation density 100%)1 / (d_weight x d_activation): AlexNet-6 بمقدار 33x، وVGG-6 بمقدار 100x، وطبقات LSTM بمقدار 10x (كثافة الـactivations تساوي 100%)
- Versus DaDianNao, matched nodeمقابل DaDianNao بعقدة التصنيع نفسها
- 2.9x throughput, 19x energy, 3x area2.9x في الإنتاجية، و19x في الطاقة، و3x في المساحة
The cross-platform chart mixes 22, 28 and 45 nm, a projected 256-PE bar and a bandwidth estimate for DaDianNao: read it as decades, not ratios. EIE at 0.59 W gives 138,927 frames per joule against 9,263 for DaDianNao at 15.97 W.
الرسم المقارن بين المنصات يخلط بين 22 و28 و45 nm، وعمودًا متوقعًا لـ256 PE، وتقديرًا لعرض النطاق لـDaDianNao: اقرأه كمراتب عشرية لا كنسب دقيقة. يعطي EIE عند 0.59 W عدد 138,927 إطارًا لكل جول مقابل 9,263 لـDaDianNao عند 15.97 W.
| Verdictالحكم | Pointالنقطة | Evidence or successorالدليل أو الخلف |
|---|---|---|
| Held upصمد | Special-purpose hardware pays off earlyالعتاد المخصص يؤتي ثماره مبكرًا | Sparse stays cost-effective to 50% density on EIE; software only below 1%الـsparse يبقى مجديًا من حيث التكلفة حتى كثافة 50% على EIE؛ أما بالبرمجيات وحدها فتحت 1% فقط |
| Held upصمد | Both sparsities, cycles and energyنوعا الـsparsity معًا، في الدورات وفي الطاقة | NVDLA, Samsung NPU, Ambarella CV22NVDLA، وSamsung NPU، وAmbarella CV22 |
| Held upصمد | W4A16 | GPTQ, AWQ, llama.cpp, MLC LLM for batch-1 LLM decodingGPTQ وAWQ وllama.cpp وMLC LLM لفك ترميز LLM بدفعة 1 |
| Did notلم يصمد | Irregular sparsity on vector processorsالـsparsity غير المنتظمة على معالجات المتجهات | 2:4 Sparse Tensor Cores, ESE load-balance-aware pruning2:4 Sparse Tensor Cores، وESE مع حذف يراعي توازن الحمل (load-balance-aware pruning) |
| Did notلم يصمد | 50% index overhead around one MACزيادة فهارس بنسبة 50% حول MAC واحدة | Coarse-grained block sparsityالـblock sparsity خشنة الحبيبات |
| Did notلم يصمد | FC layers only, batch 1طبقات FC فقط، بدفعة 1 | SCNN, Cambricon-X, Eyeriss v2 for sparse convolutionSCNN وCambricon-X وEyeriss v2 للالتفاف المتناثر |
| Did notلم يصمد | Everything in SRAMكل شيء في SRAM | 10 to 100 billion parameter LLMs do not fitنماذج LLM بحجم 10 إلى 100 مليار معامل لا تتسع |
M:N sparsity on tensor coresالـM:N sparsity على tensor cores
Fine-grained in what it removes, structured in how many: exactly two of every four consecutive weights along a row. Part 10: M:N sparsity
دقيقة الحبيبات في ما تحذفه، ومنتظمة في عدد ما تحذفه: وزنان بالضبط من كل أربعة أوزان متتالية على طول الصف. Part 10: M:N sparsity
One group of four, and A100 peaksمجموعة واحدة من أربعة، وقمم A100
- FP16 denseFP16 كثيف
- 4 x 16 = 64 bits
- FP16 compressedFP16 مضغوط
- 2 x 16 + 2 x 2 = 36 bits, about 44% saved2 x 16 + 2 x 2 = 36 bits، أي توفير نحو 44%
- INT8 denseINT8 كثيف
- 4 x 8 = 32 bits
- INT8 compressedINT8 مضغوط
- 2 x 8 + 2 x 2 = 20 bits, about 38% saved2 x 8 + 2 x 2 = 20 bits، أي توفير نحو 38%
- A100 peak TOPSقمة TOPS في A100
- FP16 312 dense, 624 sparse; INT8 624 dense, 1248 sparseFP16: 312 كثيف و624 متناثر؛ INT8: 624 كثيف و1248 متناثر
| Caseالحالة | Denseكثيف | Valuesالقيم | Metadataالبيانات الوصفية (Metadata) | Totalالإجمالي | Savingالتوفير |
|---|---|---|---|---|---|
| FP16, 1024 x 1024 | 16,777,216 (2 MiB) | 8,388,608 (1 MiB) | 1,048,576 (128 KiB) | 9,437,184 (1.125 MiB) | 43.75% |
| INT8, 4096 x 4096 | 134,217,728 (16 MiB) | 67,108,864 (8 MiB) | 16,777,216 (2 MiB) | 83,886,080 (10 MiB) | 37.5% |
- Train the model dense, exactly as usual.درّب النموذج كثيفًا، تمامًا كالمعتاد.
- Prune to 2:4 by magnitude: zero the two smallest of every four along each row.احذف إلى نمط 2:4 بالمقدار: صفّر أصغر وزنين من كل أربعة على طول كل صف.
- Retrain with the same optimizer, schedule and epochs, zeros held fixed. No hyper-parameter search.أعد التدريب بنفس الـoptimizer والجدول الزمني وعدد الـepochs، مع تثبيت الأصفار. دون أي بحث عن hyper-parameters.
| GEMM-KGEMM-K | Speedupالتسريع |
|---|---|
| 1280 | about 1.2xنحو 1.2x |
| 3840 | about 1.7xنحو 1.7x |
| 12800 | about 1.9xنحو 1.9x |
| 20480 | about 1.95xنحو 1.95x |
Speedup grows with K because only the math halves; small GEMMs are memory and overhead bound (low arithmetic intensity). Amdahl with GEMMs at 70% of time: 1.8x on GEMMs gives about 1.45x end to end, 1.2x gives 1.13x. Accuracy: ResNet-50 76.1 dense, 76.2 sparse FP16 and INT8, within run-to-run noise on twenty CNNs. MobileNet v2 drops from 71.55 to 69.56 under the plain recipe and recovers to 71.56 with channel permutation.
يزداد التسريع مع K لأن الحساب وحده هو ما ينتصف، أما عمليات GEMM الصغيرة فمقيدة بالذاكرة والتكلفة الثابتة (شدة حسابية (arithmetic intensity) منخفضة). وفق قانون Amdahl حين تشغل GEMMs نسبة 70% من الوقت: 1.8x على GEMMs تعطي نحو 1.45x من البداية إلى النهاية، و1.2x تعطي 1.13x. الدقة: ResNet-50 تبلغ 76.1 كثيفة و76.2 متناثرة في FP16 وINT8، ضمن ضوضاء التشغيل على عشرين شبكة CNN. أما MobileNet v2 فتنخفض من 71.55 إلى 69.56 بالوصفة البسيطة، وتتعافى إلى 71.56 مع channel permutation.
| Aspectالجانب | EIE (2016)EIE (2016) | 2:4 tensor core (2020)2:4 tensor core (2020) |
|---|---|---|
| Sparsity exploitedالـsparsity المستغلة | Weights about 90% plus activations about 70%الأوزان بنحو 90% مع الـactivations بنحو 70% | Weights only, exactly 50%الأوزان فقط، 50% بالضبط |
| Weight formatصيغة الأوزان | CSC, 4-bit index plus 4-bit code, pointers, paddingCSC، فهرس 4-bit مع رمز 4-bit، ومؤشرات، وحشو | Contiguous values plus one 2-bit index eachقيم متجاورة مع فهرس واحد بطول 2-bit لكل منها |
| Finding workإيجاد العمل | Leading nonzero detection, FIFO for load balanceleading nonzero detection، وFIFO لموازنة الحمل | Multiplexer driven by 2-bit indicesمُختار (multiplexer) تقوده فهارس 2-bit |
| Hardwareالعتاد | Custom 45 nm ASICASIC مخصصة بتقنية 45 nm | Every Ampere or later GPUكل GPU من جيل Ampere أو أحدث |
| Ceiling on mathسقف الحساب | Proportional to combined sparsityمتناسب مع الـsparsity المجتمعة | 2x, fixed by the pattern2x، يحدده النمط |
Sparse convolutionالالتفاف المتناثر (sparse convolution)
Outdoor LiDAR grids are below 0.01% dense. A dense 3 x 3 convolution dilates one active site to 3^d, then 5^d. Submanifold sparse convolution computes an output only where an input exists, so P_out = P_in. Part 11: Sparse convolution
شبكات LiDAR الخارجية كثافتها أقل من 0.01%. الالتفاف الكثيف 3 x 3 يوسّع موقعًا نشطًا واحدًا إلى 3^d ثم 5^d. أما submanifold sparse convolution فيحسب الخرج فقط حيث يوجد مدخل، لذلك P_out = P_in. Part 11: Sparse convolution
| Stageالمرحلة | Active cellsالخلايا النشطة | Densityالكثافة |
|---|---|---|
| Inputالمدخل | 4 of 204 من 20 | 20% |
| After one dense 3 x 3 layerبعد طبقة كثيفة واحدة 3 x 3 | 17 of 2017 من 20 | 85% |
| After one submanifold layerبعد طبقة submanifold واحدة | 4 of 204 من 20 | 20% |
| After a second dense layerبعد طبقة كثيفة ثانية | 20 of 2020 من 20 | 100% |
For P0 on slide 95: nine conventional entries, two sparse entries (W(0,0) to itself and W(-1,-1) to the point at (2, 2)). State the sign convention before computing anything: TorchSparse writes the opposite sign.
بالنسبة لـP0 في الشريحة 95: تسعة مدخلات في الطريقة التقليدية، ومدخلان في الطريقة المتناثرة (W(0,0) إلى نفسها، وW(-1,-1) إلى النقطة عند (2, 2)). حدد اصطلاح الإشارة قبل أن تحسب أي شيء: TorchSparse يكتب الإشارة المعاكسة.
| Methodالطريقة | Entriesالمدخلات | MACsMACs |
|---|---|---|
| Fully dense 3 x 3 over 20 outputsكثيف تمامًا 3 x 3 على 20 مخرجًا | 180 | 737,280 |
| Conventional, skipping zero inputsتقليدي، مع تخطي المدخلات الصفرية | 30 | 122,880 |
| Submanifold sparseSubmanifold متناثر | 10 | 40,960 |
| Weightالوزن | Entries (In, Out)المدخلات (In, Out) | Rowsالصفوف |
|---|---|---|
| W(-1,-1) | (P0, Q1), (P3, Q4) | 2 |
| W(-1,0) | (P1, Q3) | 1 |
| W(0,0) | (Pi, Qi) for all five points(Pi, Qi) لكل النقاط الخمس | 5 |
| W(1,0) | (P3, Q1) | 1 |
| W(1,1) | (P1, Q0), (P4, Q3) | 2 |
| Other four offsetsالإزاحات الأربع الأخرى | noneلا شيء | 0 |
TorchSparse: regularity from irregularityTorchSparse: انتظام من قلب عدم الانتظام
A 3 x 3 x 3 kernel launches 27 (or 26 plus a separate centre) small uneven matmuls per layer. Part 12: TorchSparse
kernel بحجم 3 x 3 x 3 يطلق 27 (أو 26 مع مركز منفصل) عملية matmul صغيرة غير متساوية في كل طبقة. Part 12: TorchSparse
| Strategyالاستراتيجية | Launchesمرات الإطلاق | Rows computedالصفوف المحسوبة | Pad rowsصفوف الحشو | Overheadالزيادة (Overhead) |
|---|---|---|---|---|
| Separate (one mm per offset)منفصل (mm واحدة لكل إزاحة) | 9 | 302 | 0 | 0% |
| Dense (one bmm, batch 9, padded to 100)كثيف (bmm واحدة، دفعة 9، محشوة إلى 100) | 1 | 900 | 598 | 66.4% |
| Adaptive (epsilon 0.05, S = 50)تكيفي (epsilon 0.05, S = 50) | 3 | 308 | 6 | 1.9% |
| Datasetمجموعة البيانات | Strategyالاستراتيجية | TFLOP/sTFLOP/s | Speedupالتسريع |
|---|---|---|---|
| SemanticKITTI | Separateمنفصل | 8.1 | 1.00x |
| SemanticKITTI | Fixed groupingتجميع ثابت | 8.7 | 0.87x |
| SemanticKITTI | Adaptive groupingتجميع تكيفي | 11.9 | 1.39x |
| nuScenes | Separateمنفصل | 10.4 | 1.00x |
| nuScenes | Fixed groupingتجميع ثابت | 21.1 | 1.50x |
| nuScenes | Adaptive groupingتجميع تكيفي | 16.9 | 1.54x |
Numbers to keepأرقام يجب حفظها
- Baseline bottlenecksاختناقات خط الأساس
- Gather and scatter 40 to 50% of runtime; matmul about 30% utilization (8.1 TFLOP/s on an RTX 2080 Ti)الـgather والـscatter يأخذان من 40 إلى 50% من زمن التشغيل؛ والـmatmul باستغلال نحو 30% (8.1 TFLOP/s على RTX 2080 Ti)
- Groups sweep (slide 105)مسح عدد المجموعات (الشريحة 105)
- 26 groups 1.0x, 13 about 1.2x, 6 about 1.5x, 3 below 1.0x, 1 about 0.35x26 مجموعة: 1.0x، و13: نحو 1.2x، و6: نحو 1.5x، و3: أقل من 1.0x، و1: نحو 0.35x
- End to endمن البداية إلى النهاية
- 1.6x over MinkowskiEngine, 1.5x over SpConv, memory movement cost 2.7x lower1.6x مقارنة بـMinkowskiEngine، و1.5x مقارنة بـSpConv، وتكلفة نقل الذاكرة أقل بـ2.7x
- TorchSparse++ on A100TorchSparse++ على A100
- 2.9x, 3.3x, 2.2x, 1.7x over MinkowskiEngine, SpConv 1.2.1, TorchSparse, SpConv 2.3.52.9x و3.3x و2.2x و1.7x مقارنة بـMinkowskiEngine وSpConv 1.2.1 وTorchSparse وSpConv 2.3.5 على الترتيب
- TorchSparse++ on Jetson OrinTorchSparse++ على Jetson Orin
- 1.25x over SpConv 2.3.5 on average1.25x مقارنة بـSpConv 2.3.5 في المتوسط
- Implicit GEMM redundancyالتكرار في Implicit GEMM
- Slide 109: 12 to 10 (row reordering) to 8 (column splitting)الشريحة 109: من 12 إلى 10 (إعادة ترتيب الصفوف) ثم إلى 8 (تقسيم الأعمدة)
| Dataflowتدفق البيانات | Stationaryالثابت (Stationary) | Kernelsالنوى (Kernels) | Memory and computeالذاكرة والحساب | Redundancyالتكرار (Redundancy) |
|---|---|---|---|---|
| Gather-GEMM-scatter | Weightالأوزان | Three kernels per offsetثلاث نوى لكل إزاحة | No overlapدون تداخل | Zero (plus padding if grouped)صفر (مع حشو إذا جُمّعت) |
| Fetch-on-demand | Weight, fusedالأوزان، مدمجة | One fused kernelنواة مدمجة واحدة | Loads overlap on-chip multiplyالتحميل يتداخل مع الضرب داخل الشريحة | Zero, but 4x to 10x more output writesصفر، لكن عمليات كتابة الخرج أكثر بـ4x إلى 10x |
| Implicit GEMM | Outputالخرج | One fused kernel, pipelined tilesنواة مدمجة واحدة، مع بلاطات متداخلة المراحل (pipelined) | Next tile loads overlap the current oneتحميل البلاطة التالية يتداخل مع الحالية | Lockstep redundancy inside each warpتكرار متزامن (lockstep) داخل كل warp |
TorchSparse++ fuses the phases so loads for the next tile overlap the current multiply, and contributes the Sparse Kernel Generator (fused, pipelined kernels at under a tenth of SpConv v2's 40,000 lines) and the Sparse Autotuner (dataflow and tile parameters per layer group). Adaptive grouping stays in its design space.
يدمج TorchSparse++ المراحل بحيث يتداخل تحميل البلاطة التالية مع ضرب البلاطة الحالية، ويضيف Sparse Kernel Generator (نوى مدمجة ومتداخلة المراحل بأقل من عُشر أسطر SpConv v2 البالغة 40,000) وSparse Autotuner (يختار الـdataflow ومعاملات البلاطة لكل مجموعة طبقات). ويبقى التجميع التكيفي (adaptive grouping) ضمن فضاء تصميمه.
PointAcc: mapping in hardwarePointAcc: بناء الخرائط في العتاد
On point clouds more than half of runtime on general-purpose hardware is map construction, and a TPU must ship coordinates back to its host (60 to 90% of runtime in data movement). Part 13: PointAcc and summary
في السحب النقطية، أكثر من نصف زمن التشغيل على العتاد العام يذهب إلى بناء الخرائط، وTPU مضطر إلى إرسال الإحداثيات إلى المضيف (من 60% إلى 90% من الزمن في نقل البيانات). Part 13: PointAcc and summary
| W1,1 (slide 112)W1,1 (الشريحة 112) | W-1,-1 (slide 111)W-1,-1 (الشريحة 111) | |
|---|---|---|
| Offset deltaفرق الإزاحة | (1, 1) | (-1, -1) |
| Shift applied to inputsالإزاحة المطبقة على المدخلات | + (-1, -1) | + (1, 1) |
| Shifted inputs P0 to P4المدخلات المزاحة من P0 إلى P4 | (0,0) (1,1) (1,3) (2,1) (3,2) | (2,2) (3,3) (3,5) (4,3) (5,4) |
| Equal neighbors after the mergeالجيران المتساوون بعد الدمج | Q0 = P1, Q3 = P4 | Q1 = P0, Q4 = P3 |
| Tuples emittedالثلاثيات الناتجة | (P1, Q0, W1,1), (P4, Q3, W1,1) | (P0, Q1, W-1,-1), (P3, Q4, W-1,-1) |
| Hash tableجدول التجزئة (Hash table) | Merge sortالترتيب بالدمج (Merge sort) | |
|---|---|---|
| Memory accessالوصول إلى الذاكرة | Random probes, one per output per offsetاستعلامات عشوائية، واحد لكل خرج ولكل إزاحة | Two sequential streams, read onceتدفقان متتاليان، يُقرأ كل منهما مرة واحدة |
| Parallel hardwareالعتاد المتوازي | N x N crossbar, O(N^2) areaشبكة تبديل (crossbar) بحجم N x N، بمساحة O(N^2) | One comparator per merge stepمقارن واحد لكل خطوة دمج |
| Storageالتخزين | Table up to 160 MBجدول يصل إلى 160 MB | Sorted coordinate lists, no tableقوائم إحداثيات مرتبة، دون جدول |
| At equal parallelismعند التوازي نفسه | Baselineخط الأساس | 1.4x faster, up to 14x less areaأسرع 1.4x، ومساحة أقل حتى 14x |
One ranking unit also serves stride downsampling (quantize then deduplicate), farthest point sampling (top-1), kNN (top-k) and ball query (threshold). The mapping unit emits indices only; the systolic matrix unit does the multiplies.
وحدة الترتيب نفسها تخدم أيضًا stride downsampling (تكميم ثم إزالة التكرار)، وfarthest point sampling (top-1)، وkNN (top-k)، وball query (عتبة). وحدة بناء الخرائط تُخرج الفهارس فقط، ووحدة المصفوفات الانقباضية (systolic) تنفذ عمليات الضرب.
| Metricالمقياس | vs RTX 2080Tiمقابل RTX 2080Ti | vs Xeon Skylake + TPU V3مقابل Xeon Skylake + TPU V3 | vs Xeon Gold 6130مقابل Xeon Gold 6130 |
|---|---|---|---|
| Speedupالتسريع | 3.7x | 53x | 90x |
| Energy savingتوفير الطاقة | 22x | 210x | 176x (slide prints 193x)176x (الشريحة تطبع 193x) |
The TPU column swings from 3.4x (DGCNN, feature-space neighbour search is already dense matmul) to 269x (F-PointNet++, dominated by sampling and neighbour search the TPU sends back to the host). The energy number is the embedded number.
يتأرجح عمود TPU بين 3.4x (DGCNN، حيث البحث عن الجيران في فضاء الخصائص هو أصلًا matmul كثيف) و269x (F-PointNet++، الذي يهيمن عليه أخذ العينات والبحث عن الجيران اللذان يرسلهما TPU إلى المضيف). ورقم الطاقة هو رقم النسخة المدمجة (embedded).
Sparsity types and the systems that exploit themأنواع الـsparsity والأنظمة التي تستغلها
| Sparsityالـ Sparsity | Originالمنشأ | Systemالنظام | Mechanismالآلية |
|---|---|---|---|
| Fine-grained weightأوزان دقيقة الحبيبات | Pruning, staticالحذف، ثابتة | EIE | CSC storage, PE array, weight sharing, skip zero weightsتخزين CSC، ومصفوفة PE، ومشاركة الأوزان، وتخطي الأوزان الصفرية |
| M:N weight (2:4)أوزان M:N (2:4) | Patterned pruning, staticحذف بنمط محدد، ثابتة | NVIDIA Ampere sparse tensor coressparse tensor cores في NVIDIA Ampere | 2-bit metadata selects activations, 2x mathبيانات وصفية بطول 2-bit تختار الـactivations، وحساب أسرع 2x |
| Activation (ReLU zeros)الـactivations (أصفار ReLU) | ReLU at run time, dynamicReLU وقت التشغيل، ديناميكية | EIE | Leading nonzero detection, never broadcast a zeroleading nonzero detection، ولا يُبث الصفر أبدًا |
| Activation (point clouds)الـactivations (السحب النقطية) | Data occupancy, dynamicإشغال البيانات، ديناميكية | TorchSparse, PointAccTorchSparse وPointAcc | Maps plus gather, matmul, scatter; merge-sort mapping unitخرائط مع gather وmatmul وscatter؛ ووحدة بناء خرائط تعتمد الترتيب بالدمج |
Slide errataأخطاء الشرائح
Answer with the corrected fact, and name the slide if a question depends on it.
أجب بالمعلومة المصححة، واذكر رقم الشريحة إذا كان السؤال يعتمد عليها.
What the slides get wrongما تخطئ فيه الشرائح
- Slide 3الشريحة 3
- Text writes ||W_p||_0 < N, figure writes ||W_P||_0 <= N. Read <= N and one matrix.النص يكتب ||W_p||_0 < N، والشكل يكتب ||W_P||_0 <= N. اقرأها <= N ومصفوفة واحدة.
- Slide 29الشريحة 29
- "constrains" means constraints. Action range is (0, 1] in the paper, not [0, 1).كلمة "constrains" المقصود بها constraints (القيود). ومجال الفعل في الورقة هو (0, 1] وليس [0, 1).
- Slide 40الشريحة 40
- "a serial of models" means a series of models.عبارة "a serial of models" المقصود بها a series of models (سلسلة من النماذج).
- Slide 43الشريحة 43
- "the model may decrease" means the model accuracy may decrease. "Finetuing" means Finetuning.عبارة "the model may decrease" المقصود بها أن دقة النموذج قد تنخفض. و"Finetuing" المقصود بها Finetuning.
- Slide 51الشريحة 51
- "Finetuing" again. 5X to 9X are compression ratios 5x and 9x."Finetuing" مرة أخرى. و5X to 9X هما نسبتا الضغط 5x و9x.
- Slide 52الشريحة 52
- "fine-tuning quantized networks" means pruned networks here. Network Slimming uses plain L1, not smooth-L1.عبارة "fine-tuning quantized networks" المقصود بها هنا الشبكات المحذوفة (pruned). وNetwork Slimming يستخدم L1 العادي، وليس smooth-L1.
- Slide 56الشريحة 56
- "Han et al (MIT)": all five papers list Stanford and NVIDIA; Han joined MIT afterwards.عبارة "Han et al (MIT)": الأوراق الخمس كلها تذكر Stanford وNVIDIA؛ وقد انضم Han إلى MIT لاحقًا.
- Slides 61 to 64الشرائح من 61 إلى 64
- With a = (0, a1, 0, a3), outputs b1, b3, b5 must be zero; the figure draws them nonzero.مع a = (0, a1, 0, a3) يجب أن تكون المخرجات b1 وb3 وb5 صفرًا؛ لكن الشكل يرسمها غير صفرية.
- Slide 74الشريحة 74
- Axes say Layers/s and Layers/J; the paper says frames. Same quantity for one FC layer.المحاور تقول Layers/s وLayers/J، والورقة تقول إطارات (frames). وهي الكمية نفسها لطبقة FC واحدة.
- Slide 77الشريحة 77
- PointAcc is MICRO 2021, not Micro'22.PointAcc منشورة في MICRO 2021، وليس Micro'22.
- Slide 86الشريحة 86
- Credit says Graham, BMVC 2015; submanifold sparse convolution is Graham and van der Maaten 2017 and CVPR 2018.الإسناد يقول Graham, BMVC 2015؛ أما submanifold sparse convolution فهو لـGraham وvan der Maaten عام 2017 وفي CVPR 2018.
- Slide 101الشريحة 101
- "TorshSparse" means TorchSparse."TorshSparse" المقصود بها TorchSparse.
- Slide 113الشريحة 113
- CPU energy GeoMean printed as 193; the paper and the eight bars give 176x.المتوسط الهندسي لطاقة CPU مطبوع 193؛ والورقة والأعمدة الثمانية تعطي 176x.
- Slide 115الشريحة 115
- Missing NetAdapt, EIE, Mishra et al. 2021, TorchSparse, TorchSparse++, PointAcc. Hu et al. is 2016 (arXiv 1607.03250), not 2017.تنقصها NetAdapt وEIE وMishra et al. 2021 وTorchSparse وTorchSparse++ وPointAcc. وHu et al. عام 2016 (arXiv 1607.03250)، وليس 2017.