COE 592Lecture 03المحاضرة 03Part 04الجزء 04
MACs, FLOPs and operationsعمليات MAC وFLOP والعمليات
Counting computation as multiply-accumulate operations for matrix products and each layer type, AlexNet's 724M MACs, and converting to FLOPs, FLOPS, OPs and OPS.عدّ الحساب بوصفه عمليات ضرب وتجميع (MAC) لضرب المصفوفات ولكل نوع من الطبقات، و724M عملية MAC في AlexNet، والتحويل إلى FLOPs وFLOPS وOPs وOPS.
- Conceptsالمفاهيم
- 5
- Slidesالشرائح
- 23-29
- Readingمدة القراءة
- 30 min30 دقيقة
Why this part mattersلماذا يهمّ هذا الجزء
Part 02 measured what a network stores and part 03 what it must hold in memory. This part measures what it must compute. That number is the numerator of computation time in the Latency model of slide 8, the figure every accelerator datasheet is quoted against, and the figure you will report for any model in the research project.
The counting unit is the multiply-accumulate, and everything else is bookkeeping on top of it: how many MACs a matrix product costs, how many each layer type costs, what AlexNet adds up to, and how the count becomes FLOPs, OPs and finally milliseconds on a specific chip. The surprise waiting at the centre of the part is that the layers holding almost all of AlexNet's weights do almost none of its arithmetic. Every exam question on efficiency metrics circles back to that inversion.
قاس الجزء 02 ما تخزّنه الشبكة، وقاس الجزء 03 ما يجب أن تحمله في الذاكرة. أما هذا الجزء فيقيس ما يجب أن تحسبه. هذا الرقم هو بسط زمن الحساب computation time في نموذج latency (زمن التأخير) في الشريحة 8، وهو الرقم الذي تُقاس عليه كل نشرة بيانات (datasheet) لأي مسرّع، والرقم الذي ستذكره لأي نموذج في مشروع البحث.
وحدة العدّ هي عملية الضرب والتجميع (multiply-accumulate)، وكل ما عداها حسابات مبنية فوقها: كم MAC يكلف ضرب المصفوفات، وكم يكلف كل نوع من الطبقات، وما مجموع AlexNet، وكيف يتحول العدد إلى FLOPs وOPs ثم إلى ملّي ثوانٍ على شريحة محددة. المفاجأة التي تنتظرك في قلب هذا الجزء أن الطبقات التي تحمل تقريبًا كل أوزان AlexNet لا تؤدي تقريبًا أي شيء من حساباته. كل سؤال امتحان عن مقاييس الكفاءة يعود إلى هذا الانقلاب.
By the end you canفي نهاية هذا الجزء ستستطيع
- Define a multiply-accumulate operation and count MACs for a matrix-vector product and a matrix-matrix product.تعرّف عملية الضرب والتجميع (multiply-accumulate) وتحسب عدد MACs لضرب مصفوفة في متجه ولضرب مصفوفة في مصفوفة.
- Fill the MACs table for linear, convolution, grouped and depthwise layers, and explain why conv MACs equal parameters times h_o·w_o.تملأ جدول MACs للطبقات الخطية والالتفافية والمجمّعة (grouped) والعمقية (depthwise)، وتشرح لماذا تساوي MACs الالتفاف عدد المعاملات مضروبًا في h_o·w_o.
- Reproduce AlexNet's 724M MACs layer by layer and explain why convolutions dominate compute while linear layers dominate parameters.تعيد حساب الـ 724M MACs في AlexNet طبقةً طبقة، وتشرح لماذا تهيمن طبقات الالتفاف على الحساب بينما تهيمن الطبقات الخطية على المعاملات.
- Convert MACs to FLOPs and OPs, and tell a count (FLOPs, OPs) apart from a rate (FLOPS, OPS).تحوّل MACs إلى FLOPs و OPs، وتميّز العدد (FLOPs و OPs) عن المعدل (FLOPS و OPS).
- Estimate T_computation for a model on a device from the model's OPs and the device's OPS.تقدّر T_computation لنموذج على جهاز معين من عدد OPs للنموذج ومن OPS للجهاز.
Start with one neuron that has four inputs. Its output before the activation function is w₁x₁ + w₂x₂ + w₃x₃ + w₄x₄. A processor evaluates that as four identical steps: multiply a weight by an input, add the product to a running total. Each step is one multiply-accumulate operation, and the whole of neural network inference is this step repeated a few hundred million times.
ابدأ بعصبون واحد له أربعة مدخلات. مخرجه قبل دالة التفعيل هو w₁x₁ + w₂x₂ + w₃x₃ + w₄x₄. يحسب المعالج ذلك في أربع خطوات متطابقة: اضرب وزنًا في مدخل، ثم أضف الناتج إلى مجموع جارٍ. كل خطوة هي عملية ضرب وتجميع واحدة (multiply-accumulate operation)، والاستدلال (inference) في الشبكة العصبية بأكمله هو هذه الخطوة مكررة بضع مئات من ملايين المرات.
The definition is standard well beyond this course. The Wikipedia entry on the multiply-accumulate operation gives exactly a ← a + (b × c), and notes that IEEE 754-2008 defines a fused multiply-add that performs the whole step with a single rounding. Sze, Chen, Yang and Emer call the MAC "the fundamental component" of DNN processing in their survey of efficient DNN hardware. Counting MACs is therefore counting what the hardware executes, not an abstraction layered over it.
هذا التعريف معتمد على نطاق أوسع بكثير من هذا المقرر. مدخل ويكيبيديا عن عملية الضرب والتجميع يعطي بالضبط a ← a + (b × c)، ويذكر أن IEEE 754-2008 يعرّف عملية ضرب وجمع مدمجة (fused multiply-add) تنفّذ الخطوة كلها بتقريب واحد فقط. ويصف Sze وChen وYang وEmer عملية MAC بأنها "المكوّن الأساسي" (the fundamental component) لمعالجة الشبكات العصبية العميقة (DNN) في مسحهم لعتاد DNN الكفء. لذلك فإن عدّ MACs هو عدّ لما ينفّذه العتاد فعلًا، وليس تجريدًا مبنيًا فوقه.
From one neuron to a matrix-vector productمن عصبون واحد إلى ضرب مصفوفة في متجه
A layer of m neurons that each read the same n inputs is a matrix-vector multiplication: an m × n weight matrix times an n-vector. Each of the m outputs needs n MACs, one per weight in its row, so the product costs m · n MACs. Notice that this is also the number of weights. In a matrix-vector product, every weight is touched exactly once.
طبقة من m عصبون يقرأ كل منها المدخلات نفسها البالغ عددها n هي ضرب مصفوفة في متجه (matrix-vector multiplication): مصفوفة أوزان حجمها m × n مضروبة في متجه طوله n. كل مخرج من المخرجات الـ m يحتاج n من MACs، واحدة لكل وزن في صفه، لذا يكلف الضرب m · n من MACs. لاحظ أن هذا هو أيضًا عدد الأوزان. في ضرب مصفوفة في متجه، يُستخدم كل وزن مرة واحدة بالضبط.
Feed the layer a batch of inputs at once and the vector becomes a matrix. The slide renames the dimensions here: the input count becomes k and the letter n is reused for the batch, the number of columns of B. The result is a general matrix-matrix multiplication: A of size m × k times B of size k × n gives C of size m × n. Every one of the m · n cells of C is a dot product over the shared dimension k, so it costs k MACs, and the whole product costs m · n · k.
إذا أدخلت إلى الطبقة دفعة (batch) من المدخلات مرة واحدة يصبح المتجه مصفوفة. هنا تعيد الشريحة تسمية الأبعاد: عدد المدخلات يصبح k، ويُعاد استخدام الحرف n للدفعة، أي عدد أعمدة B. الناتج هو الضرب العام لمصفوفة في مصفوفة (general matrix-matrix multiplication): A بحجم m × k مضروبة في B بحجم k × n تعطي C بحجم m × n. كل خلية من خلايا C البالغ عددها m · n هي ضرب نقطي (dot product) على البعد المشترك k، فتكلف k من MACs، ويكلف الضرب كله m · n · k.
Dimensions used in the GEMM countالأبعاد المستخدمة في عدّ GEMM
- m
- Rows of A and of C: the number of outputs (neurons)صفوف A وصفوف C: عدد المخرجات (العصبونات)
- k
- Columns of A and rows of B: the shared dimension summed over, the number of inputs per neuronأعمدة A وصفوف B: البعد المشترك الذي يُجمع عليه، أي عدد المدخلات لكل عصبون
- n
- Columns of B and of C: the number of input vectors, the batchأعمدة B وأعمدة C: عدد متجهات المدخل، أي الدفعة (batch)
Why a whole network reduces to thisلماذا تُختزل الشبكة كلها إلى هذا
A Linear layer is literally a matrix-vector product at batch size one and a GEMM for a batch. Convolution looks different but is executed the same way: frameworks reorder the input patches into columns (the im2col trick described in the CS231n notes) so that a convolution becomes one large GEMM, and the MobileNets paper points out that this is why convolutions can ride on "highly optimized general matrix multiply (GEMM) functions". NVIDIA's performance guide states the cost of a GEMM as 2 · M · N · K floating point operations because "each FMA is 2 operations, a multiply and an add", which previews the FLOP conversion at the end of this part. Once you can count MACs for a matrix product, you can count them for every layer.
الطبقة الخطية (linear layer) هي حرفيًا ضرب مصفوفة في متجه عندما يكون حجم الدفعة (batch size) واحدًا، وهي GEMM عند وجود دفعة. الالتفاف يبدو مختلفًا لكنه يُنفّذ بالطريقة نفسها: تعيد أطر العمل ترتيب رقع المدخل (patches) في أعمدة (حيلة im2col الموصوفة في ملاحظات CS231n) فيصبح الالتفاف عملية GEMM واحدة كبيرة، وتشير ورقة MobileNets إلى أن هذا هو سبب قدرة الالتفاف على الاعتماد على "دوال ضرب المصفوفات العامة (GEMM) المحسّنة للغاية". ويذكر دليل الأداء من NVIDIA أن كلفة GEMM هي 2 · M · N · K عملية فاصلة عائمة لأن "كل FMA عبارة عن عمليتين، ضرب وجمع"، وهذا تمهيد لتحويل FLOP في آخر هذا الجزء. بمجرد أن تستطيع عدّ MACs لضرب المصفوفات، تستطيع عدّها لكل طبقة.
Recall
Write the MAC operation, and state how many MACs an m × n matrix times an n-vector costs.اكتب عملية MAC، واذكر كم MAC يكلف ضرب مصفوفة m × n في متجه طوله n.
Take the first layer of AlexNet. One filter spans all 3 input channels with an 11 × 11 window, so it holds 3 × 11 × 11 = 363 weights. Producing a single output pixel is one dot product of those 363 weights against a patch of the image: 363 MACs. But the filter does not produce one pixel. It slides to every one of the 55 × 55 = 3,025 output positions, and there are 96 filters. So the layer costs 363 × 3,025 × 96 = 105,415,200 MACs from only 34,848 weights.
خذ الطبقة الأولى من AlexNet. يمتد المرشح (filter) الواحد على قنوات المدخل الـ 3 كلها بنافذة 11 × 11، فيحمل 3 × 11 × 11 = 363 وزنًا. إنتاج بكسل واحد في المخرج هو ضرب نقطي واحد لهذه الأوزان الـ 363 مع رقعة من الصورة: 363 من MACs. لكن المرشح لا ينتج بكسلًا واحدًا، بل ينزلق إلى كل موضع من مواضع المخرج البالغة 55 × 55 = 3,025، وهناك 96 مرشحًا. لذا تكلف الطبقة 363 × 3,025 × 96 = 105,415,200 من MACs انطلاقًا من 34,848 وزنًا فقط.
That example contains the whole rule. In a convolution layer every weight is applied once per output position, so the MAC count is the parameter count from part 02 multiplied by the output height and width:
هذا المثال يحتوي القاعدة كلها. في طبقة الالتفاف (convolution layer) يُطبَّق كل وزن مرة واحدة لكل موضع في المخرج، لذا فإن عدد MACs هو عدد المعاملات (parameter count) من الجزء 02 مضروبًا في ارتفاع المخرج وعرضه (output height and width):
The other rows of the slide's table follow from the same idea. A Linear layer has h_o = w_o = 1, so its MACs equal its parameters, c_o · c_i. A Grouped convolution splits the channels into g groups, so each filter sees only c_i / g input channels and both parameters and MACs are divided by g. A Depthwise convolution is the extreme case g = c_i = c_o: each filter sees exactly one channel, so c_i disappears from the formula entirely and only c_o · k_h · k_w weights remain, each still applied h_o · w_o times.
بقية صفوف جدول الشريحة تنتج من الفكرة نفسها. الطبقة الخطية (linear layer) لها h_o = w_o = 1، لذا فإن MACs فيها تساوي معاملاتها، c_o · c_i. والالتفاف المجمّع (grouped convolution) يقسم القنوات إلى g groups (أي g من المجموعات)، فلا يرى كل مرشح إلا c_i / g من قنوات المدخل، وتُقسم المعاملات وMACs كلاهما على g. أما الالتفاف العمقي (depthwise convolution) فهو الحالة القصوى g = c_i = c_o: كل مرشح يرى قناة واحدة بالضبط، فيختفي c_i من الصيغة تمامًا ولا يبقى إلا c_o · k_h · k_w وزنًا، كل منها لا يزال يُطبَّق h_o · w_o مرة.
| Layerالطبقة | Parametersالمعاملات | MACsMACs | MACs per parameterMACs لكل معامل |
|---|---|---|---|
| Linearخطية (Linear) | c_o · c_ic_o · c_i | c_o · c_ic_o · c_i | 11 |
| Convolutionالتفاف (Convolution) | c_o · c_i · k_h · k_wc_o · c_i · k_h · k_w | c_o · c_i · k_h · k_w · h_o · w_oc_o · c_i · k_h · k_w · h_o · w_o | h_o · w_oh_o · w_o |
| Grouped convolutionالتفاف مجمّع (Grouped convolution) | c_o · c_i · k_h · k_w / gc_o · c_i · k_h · k_w / g | c_o · c_i · k_h · k_w · h_o · w_o / gc_o · c_i · k_h · k_w · h_o · w_o / g | h_o · w_oh_o · w_o |
| Depthwise convolutionالتفاف عمقي (Depthwise convolution) | c_o · k_h · k_wc_o · k_h · k_w | c_o · k_h · k_w · h_o · w_oc_o · k_h · k_w · h_o · w_o | h_o · w_oh_o · w_o |
How a convolution slides, how padding and stride set the output size, and how groups partition channels were covered in lecture 02, part 02 and part 03. This part only counts, and it takes the kernel size and output shape of each layer as given.
كيف ينزلق الالتفاف، وكيف يحدد الحشو (padding) والخطوة (stride) حجم المخرج، وكيف تقسّم المجموعات القنوات، كل ذلك شُرح في المحاضرة 02، الجزء 02 والجزء 03. هذا الجزء يكتفي بالعدّ، ويأخذ حجم النواة (kernel size) وشكل المخرج لكل طبقة كمعطيات.
Why this mirrors part 02لماذا يعكس هذا الجزء صورة الجزء 02
Goodfellow, Bengio and Courville explain parameter sharing in one sentence that is the whole story of this part: sharing "does not affect the runtime of forward propagation, it is still O(k × n), but it does further reduce the storage requirements of the model to k parameters". Convolution saves storage by reusing weights, and reusing weights is exactly what makes the arithmetic grow. That is why parts 02 and 04 are mirror images. The layers cheapest to store are the most expensive to run.
يشرح Goodfellow وBengio وCourville مشاركة المعاملات (parameter sharing) في جملة واحدة هي قصة هذا الجزء كلها: المشاركة "لا تؤثر في زمن تشغيل الانتشار الأمامي، فهو لا يزال O(k × n)، لكنها تقلل أكثر متطلبات تخزين النموذج إلى k من المعاملات". الالتفاف يوفّر التخزين بإعادة استخدام الأوزان، وإعادة استخدام الأوزان هي بالضبط ما يجعل الحسابات تكبر. لهذا فإن الجزأين 02 و04 صورتان متعاكستان. الطبقات الأرخص تخزينًا هي الأغلى تشغيلًا.
Worked example: the MobileNet block that makes depthwise worth itمثال محلول: كتلة MobileNet التي تجعل الالتفاف العمقي (depthwise) مجديًا
The MobileNets paper replaces one standard 3 × 3 convolution with a depthwise 3 × 3 followed by a pointwise 1 × 1. Its equations 4 and 5 give the depthwise and separable costs, and dividing by the standard cost gives the ratio 1 / N + 1 / D_K², where N is the number of output channels and D_K the kernel size. The formulas in the table let you reproduce that with real numbers.
تستبدل ورقة MobileNets التفافًا قياسيًا واحدًا 3 × 3 بالتفاف عمقي 3 × 3 يتبعه التفاف نقطي (pointwise) 1 × 1. معادلتاها 4 و5 تعطيان كلفة الالتفاف العمقي وكلفة الالتفاف المنفصل (separable)، والقسمة على كلفة الالتفاف القياسي تعطي النسبة 1 / N + 1 / D_K²، حيث N عدد قنوات المخرج وD_K حجم النواة. الصيغ في الجدول تتيح لك إعادة إنتاج ذلك بأرقام حقيقية.
Worked exampleمثال محلول
Standard versus depthwise separable at 112 × 112, 32 to 64 channelsالالتفاف القياسي مقابل الالتفاف العمقي المنفصل عند 112 × 112، من 32 إلى 64 قناة
Standard 3 × 3 convolutionالتفاف قياسي 3 × 3
64 × 32 × 3 × 3 × 112 × 112 = 231,211,008 MACs.64 × 32 × 3 × 3 × 112 × 112 = 231,211,008 من MACs.Depthwise 3 × 3التفاف عمقي 3 × 3
32 × 3 × 3 × 112 × 112 = 3,612,672 MACs. No c_i factor.32 × 3 × 3 × 112 × 112 = 3,612,672 من MACs. لا يوجد عامل c_i.Pointwise 1 × 1التفاف نقطي 1 × 1
64 × 32 × 1 × 1 × 112 × 112 = 25,690,112 MACs. A convolution with k = 1.64 × 32 × 1 × 1 × 112 × 112 = 25,690,112 من MACs. إنه التفاف فيه k = 1.Ratioالنسبة
(3,612,672 + 25,690,112) / 231,211,008 = 0.1267, and 1 / 64 + 1 / 9 = 0.1267.(3,612,672 + 25,690,112) / 231,211,008 = 0.1267، و1 / 64 + 1 / 9 = 0.1267.Resultالنتيجة
About 7.9× fewer MACs at 64 output channels, approaching the paper's "between 8 to 9 times less computation" as the channel count grows and the 1 / D_K² = 1 / 9 pointwise term is all that remains.عدد MACs أقل بنحو 7.9× عند 64 قناة مخرج، ويقترب من عبارة الورقة "حساب أقل بما بين 8 و9 مرات" كلما زاد عدد القنوات ولم يبق إلا حد الالتفاف النقطي 1 / D_K² = 1 / 9.
The calculator below lets you scrub every symbol in the table. Its FLOPs, OPs and hardware rows are explained in the last concept of this part; for now watch how parameters and MACs move apart as the output size grows.
تتيح لك الحاسبة أدناه تحريك كل رمز في الجدول. صفوف FLOPs وOPs والعتاد فيها تُشرح في المفهوم الأخير من هذا الجزء؛ أما الآن فراقب كيف يتباعد عدد المعاملات وعدد MACs كلما كبر حجم المخرج.
illustrative mobile GPU-class figureرقم توضيحي بمستوى معالجات GPU المحمولة
Drag h_o = w_o and watch MACs climb while parameters stay put: a convolution reuses every weight at every output position. Switch to linear and the two counts collapse into one. The hardware box only divides: the same layer takes 1000× longer at 1 GFLOPS than at 1 TFLOPS, and marketing peak TOPS are rarely sustained, so treat the time as a floor.اسحب h_o = w_o وراقب ارتفاع MACs بينما تبقى المعاملات ثابتة: فالالتفاف يعيد استخدام كل وزن عند كل موضع في المُخرج. انتقل إلى الطبقة الخطية فيندمج العددان في عدد واحد. صندوق العتاد يقسم فقط: الطبقة نفسها تستغرق وقتًا أطول بمقدار 1000× عند 1 GFLOPSمقارنةً بـ1 TFLOPS، وقيم TOPS التسويقية القصوى نادرًا ما تتحقق باستمرار، فتعامل مع الزمن على أنه حد أدنى.
Quick checkاختبار سريع
A grouped convolution has c_i = 96, c_o = 256, a 5 × 5 kernel, a 27 × 27 output and g = 2. How many MACs does it perform?التفاف مجمّع فيه c_i = 96 و c_o = 256، ونواة 5 × 5، ومخرج 27 × 27، و g = 2. كم عدد MACs التي ينفّذها؟
Recall
A grouped convolution has 384 filters over 384 input channels, a 3 × 3 kernel, a 13 × 13 output and g = 2. How many MACs, how many parameters, and what is their ratio?التفاف مجمّع فيه 384 مرشحًا على 384 قناة مدخل، ونواة 3 × 3، ومخرج 13 × 13، و g = 2. كم عدد MACs، وكم عدد المعاملات، وما النسبة بينهما؟
Slide 25 hands you the eight weighted layers of AlexNet with their output shapes and an empty MACs column. Slide 26 fills it in, except for one layer hidden behind a question mark. Work through the column yourself before you read the answers. Every entry is the formula from the previous concept with the layer's numbers substituted, and the pooling layers contribute nothing because they hold no weights.
تعطيك الشريحة 25 الطبقات الثماني ذات الأوزان في AlexNet مع أشكال مخرجاتها وعمود MACs فارغ. وتملؤه الشريحة 26، باستثناء طبقة واحدة مخفية خلف علامة استفهام. احسب العمود بنفسك قبل أن تقرأ الإجابات. كل خانة هي الصيغة من المفهوم السابق بعد التعويض بأرقام الطبقة، وطبقات التجميع (pooling) لا تضيف شيئًا لأنها لا تحمل أوزانًا.
Worked exampleمثال محلول
AlexNet, layer by layer (batch size 1, bias ignored)AlexNet طبقةً طبقة (حجم الدفعة 1، مع إهمال الانحياز)
conv1: 11 × 11, 3 to 96 channels, output 55 × 55conv1: نواة 11 × 11، من 3 إلى 96 قناة، المخرج 55 × 55
96 × 3 × 11 × 11 × 55 × 55 = 105,415,20096 × 3 × 11 × 11 × 55 × 55 = 105,415,200conv2: 5 × 5, 96 to 256 channels, groups 2, output 27 × 27conv2: نواة 5 × 5، من 96 إلى 256 قناة، مجموعتان، المخرج 27 × 27
256 × 96 × 5 × 5 × 27 × 27 / 2 = 223,948,800. Without the groups it would be 447,897,600; g = 2 halves it.256 × 96 × 5 × 5 × 27 × 27 / 2 = 223,948,800. بدون المجموعات سيكون العدد 447,897,600؛ وg = 2 ينصّفه.conv3: 3 × 3, 256 to 384 channels, output 13 × 13conv3: نواة 3 × 3، من 256 إلى 384 قناة، المخرج 13 × 13
384 × 256 × 3 × 3 × 13 × 13 = 149,520,384384 × 256 × 3 × 3 × 13 × 13 = 149,520,384conv4: 3 × 3, 384 to 384 channels, groups 2, output 13 × 13conv4: نواة 3 × 3، من 384 إلى 384 قناة، مجموعتان، المخرج 13 × 13
384 × 384 × 3 × 3 × 13 × 13 / 2 = 112,140,288384 × 384 × 3 × 3 × 13 × 13 / 2 = 112,140,288conv5: 3 × 3, 384 to 256 channels, groups 2, output 13 × 13conv5: نواة 3 × 3، من 384 إلى 256 قناة، مجموعتان، المخرج 13 × 13
This is the entry the slide hides. Compute it before revealing.Recall
conv5 MACs?كم عدد MACs في conv5؟
256 × 384 × 3 × 3 × 13 × 13 / 2 = 74,760,192256 × 384 × 3 × 3 × 13 × 13 / 2 = 74,760,192هذه هي الخانة التي تخفيها الشريحة. احسبها قبل كشف الإجابة.Recall
conv5 MACs?كم عدد MACs في conv5؟
256 × 384 × 3 × 3 × 13 × 13 / 2 = 74,760,192256 × 384 × 3 × 3 × 13 × 13 / 2 = 74,760,192fc6: 256 × 6 × 6 = 9,216 inputs to 4,096 outputsfc6: من 256 × 6 × 6 = 9,216 مدخلًا إلى 4,096 مخرجًا
4,096 × 9,216 = 37,748,736. The flattened pooling output is the input vector.4,096 × 9,216 = 37,748,736. مخرج طبقة التجميع بعد تسطيحه (flatten) هو متجه المدخل.fc7: 4,096 to 4,096fc7: من 4,096 إلى 4,096
4,096 × 4,096 = 16,777,2164,096 × 4,096 = 16,777,216fc8: 4,096 to 1,000 classesfc8: من 4,096 إلى 1,000 فئة
1,000 × 4,096 = 4,096,0001,000 × 4,096 = 4,096,000Totalالمجموع
724,406,816 MACs, the slide's "724M in total". Sze et al. list the same figure, 724M MACs and 61M weights, in their survey table.724,406,816 من MACs، وهو "724M في المجموع" في الشريحة. ويذكر Sze وزملاؤه الرقم نفسه، 724M من MACs و61M من الأوزان، في جدول مسحهم.
Put the parameters next to the MACsضع المعاملات بجانب MACs
The total is not the interesting number. The interesting number appears when you place the parameter counts from part 02 beside the MACs and add a column for their ratio, which by the previous concept is just h_o · w_o.
المجموع ليس الرقم المثير للاهتمام. الرقم المثير يظهر عندما تضع أعداد المعاملات من الجزء 02 بجانب MACs وتضيف عمودًا للنسبة بينهما، وهي بحسب المفهوم السابق مجرد h_o · w_o.
| Layerالطبقة | Shapeالشكل | Parametersالمعاملات | MACsMACs | MACs per parameterMACs لكل معامل |
|---|---|---|---|---|
| conv1conv1 | 96 × 3 × 11 × 11, out 55 × 5596 × 3 × 11 × 11، المخرج 55 × 55 | 34,84834,848 | 105,415,200105,415,200 | 3,0253,025 |
| conv2conv2 | 256 × 96 × 5 × 5 / 2, out 27 × 27256 × 96 × 5 × 5 / 2، المخرج 27 × 27 | 307,200307,200 | 223,948,800223,948,800 | 729729 |
| conv3conv3 | 384 × 256 × 3 × 3, out 13 × 13384 × 256 × 3 × 3، المخرج 13 × 13 | 884,736884,736 | 149,520,384149,520,384 | 169169 |
| conv4conv4 | 384 × 384 × 3 × 3 / 2, out 13 × 13384 × 384 × 3 × 3 / 2، المخرج 13 × 13 | 663,552663,552 | 112,140,288112,140,288 | 169169 |
| conv5conv5 | 256 × 384 × 3 × 3 / 2, out 13 × 13256 × 384 × 3 × 3 / 2، المخرج 13 × 13 | 442,368442,368 | 74,760,19274,760,192 | 169169 |
| fc6fc6 | 4096 × (256 × 6 × 6)4096 × (256 × 6 × 6) | 37,748,73637,748,736 | 37,748,73637,748,736 | 11 |
| fc7fc7 | 4096 × 40964096 × 4096 | 16,777,21616,777,216 | 16,777,21616,777,216 | 11 |
| fc8fc8 | 1000 × 40961000 × 4096 | 4,096,0004,096,000 | 4,096,0004,096,000 | 11 |
| conv1 to conv5من conv1 إلى conv5 | five convolutionsخمس طبقات التفاف | 2,332,704 (3.8%)2,332,704 (3.8%) | 665,784,864 (91.9%)665,784,864 (91.9%) | |
| fc6 to fc8من fc6 إلى fc8 | three linear layersثلاث طبقات خطية | 58,621,952 (96.2%)58,621,952 (96.2%) | 58,621,952 (8.1%)58,621,952 (8.1%) | |
| Totalالمجموع | eight weighted layersثماني طبقات ذات أوزان | 60,954,65660,954,656 | 724,406,816724,406,816 |
The five convolutions hold 2,332,704 parameters, under 4% of the network, yet perform 665,784,864 MACs, 92% of the compute. The three linear layers hold 58,621,952 parameters, 96% of the network, yet perform only 58,621,952 MACs, 8% of the compute. The last column explains it: each conv1 weight is used 3,025 times, each conv3 to conv5 weight 169 times, each linear weight once. Large spatial maps early in the network make convolution compute heavy. Large c_i · c_o products late in the network make the linear layers parameter heavy.
الالتفافات الخمسة تحمل 2,332,704 من المعاملات، أي أقل من 4% من الشبكة، ومع ذلك تنفّذ 665,784,864 من MACs، أي 92% من الحساب. والطبقات الخطية الثلاث تحمل 58,621,952 من المعاملات، أي 96% من الشبكة، ومع ذلك لا تنفّذ إلا 58,621,952 من MACs، أي 8% من الحساب. العمود الأخير يفسّر ذلك: كل وزن في conv1 يُستخدم 3,025 مرة، وكل وزن في conv3 إلى conv5 يُستخدم 169 مرة، وكل وزن خطي مرة واحدة. الخرائط المكانية الكبيرة في بداية الشبكة تجعل الالتفاف ثقيلًا في الحساب. وحواصل الضرب الكبيرة c_i · c_o في نهاية الشبكة تجعل الطبقات الخطية ثقيلة في المعاملات.
Flip the toggle and watch which single layer is largest. Under parameters it is fc6, about 62% of the network on its own. Under MACs it is conv2, about 31%, while conv1, invisible on the parameter bar at 0.06%, grows to 15% because its 34,848 weights each fire 3,025 times. Each layer's exact count is listed below the bar.بدّل المفتاح وراقب أي طبقة منفردة هي الأكبر. عند قياس المعاملات تكون fc6، وحدها نحو 62% من الشبكة. وعند قياس MACsتكون conv2، نحو 31%، بينما conv1 التي لا تكاد تظهر على شريط المعاملات عند 0.06% تكبر إلى 15%لأن كل وزن من أوزانها البالغة 34,848 يُستخدم 3,025 مرة. العدد الدقيق لكل طبقة مُدرج تحت الشريط.
- conv134,848 (0.1%)
- conv2307,200 (0.5%)
- conv3884,736 (1.5%)
- conv4663,552 (1.1%)
- conv5442,368 (0.7%)
- fc637,748,736 (61.9%)
- fc716,777,216 (27.5%)
- fc84,096,000 (6.7%)
What this means for making a model fasterماذا يعني هذا لجعل النموذج أسرع
The inversion sets the strategy for the rest of the course. Pruning or quantizing the linear layers shrinks Model size dramatically, because that is where the weights are, but it barely changes the MAC count and therefore barely changes computation time. To make inference faster you must attack the convolutions: fewer channels, grouped or depthwise filters as in MobileNet, or a lower input resolution so that h_o · w_o shrinks in every layer at once. The pruning lecture that follows will keep returning to this table, and when you profile a model for the research project, report both columns, not one.
هذا الانقلاب يحدد الاستراتيجية لبقية المقرر. التقليم (pruning) أو التكميم (quantization) للطبقات الخطية يقلّص حجم النموذج (model size) بشكل كبير، لأن الأوزان موجودة هناك، لكنه بالكاد يغيّر عدد MACs، وبالتالي بالكاد يغيّر زمن الحساب (computation time). لجعل الاستدلال أسرع يجب أن تستهدف الالتفافات: قنوات أقل، أو مرشحات مجمّعة أو عمقية كما في MobileNet، أو دقة مدخل أقل بحيث يصغر h_o · w_o في كل الطبقات دفعة واحدة. محاضرة التقليم التالية ستعود إلى هذا الجدول مرارًا، وعندما تحلّل نموذجًا في مشروع البحث، اذكر العمودين معًا لا عمودًا واحدًا.
Quick checkاختبار سريع
Pruning removes 90 percent of the weights in AlexNet's fc6 and fc7. Roughly how much does the network's total MAC count fall?يزيل التقليم 90 بالمئة من الأوزان في fc6 و fc7 من AlexNet. بكم ينخفض تقريبًا العدد الكلي لـ MACs في الشبكة؟
Recall
Which AlexNet layer family holds most of the parameters, which performs most of the MACs, and why?أي عائلة طبقات في AlexNet تحمل معظم المعاملات، وأيها تنفّذ معظم MACs، ولماذا؟
A MAC hides two arithmetic operations: a multiply and an add. When each is counted as one floating point operation, one MAC is two FLOPs, and AlexNet's 724,406,816 MACs become 1,448,813,632 FLOPs. The slide rounds that to 1.4G; the exact figure is 1.449G, and showing the factor of two matters more than the rounding.
تخفي عملية MAC عمليتين حسابيتين: ضربًا وجمعًا. عندما تُعدّ كل منهما عملية فاصلة عائمة (floating point operation) واحدة، تصبح عملية MAC الواحدة اثنتين من FLOPs، وتصبح MACs في AlexNet البالغة 724,406,816 عددًا قدره 1,448,813,632 من FLOPs. تقرّب الشريحة ذلك إلى 1.4G؛ والرقم الدقيق 1.449G، وإظهار معامل الاثنين أهم من التقريب.
The count on its own says nothing about time. To get time you need to know how fast a processor can drain it, and that is a different quantity with an almost identical name. FLOPS, with a capital S, is floating point operations per second: a throughput that belongs to the hardware. FLOPs, with a lowercase s, is a plural count that belongs to the model. TOP500 ranks supercomputers by exactly this rate, reporting Linpack results as Rmax and Rpeak in Flop/s, and NVIDIA's GPU performance background guide writes the time a math-limited kernel takes as its number of operations divided by the processor's math bandwidth, which is FLOPs over FLOPS.
العدد وحده لا يقول شيئًا عن الزمن. لتحصل على الزمن تحتاج أن تعرف مدى سرعة المعالج في استهلاكه، وهذه كمية مختلفة باسم شبه مطابق. FLOPS، بحرف S كبير، هي عدد عمليات الفاصلة العائمة في الثانية: معدل إنتاجية (throughput) يخص العتاد. أما FLOPs، بحرف s صغير، فهي عدد بصيغة الجمع يخص النموذج. تصنّف قائمة TOP500 الحواسيب الفائقة بهذا المعدل بالضبط، إذ تذكر نتائج Linpack على شكل Rmax وRpeak بوحدة Flop/s، ويكتب دليل خلفية أداء وحدات GPU من NVIDIA زمن النواة (kernel) المحدودة بالحساب على أنه عدد عملياتها مقسومًا على عرض النطاق الحسابي للمعالج، أي FLOPs على FLOPS.
This is the computation time term of the latency model on slide 8, where the numerator is a network specification and the denominator a hardware specification. Run AlexNet's count through a few devices and the scale of the answer changes by orders of magnitude while the model does not change at all.
هذا هو حد زمن الحساب (computation time) في نموذج التأخير في الشريحة 8، حيث البسط هو مواصفة الشبكة (network specification) والمقام مواصفة العتاد. مرّر عدد AlexNet عبر عدة أجهزة وسترى أن مقياس الإجابة يتغير بعدة مراتب عشرية بينما لا يتغير النموذج إطلاقًا.
| Processorالمعالج | Count ÷ rateالعدد ÷ المعدل | T_computationT_computation |
|---|---|---|
| 1 GFLOPS1 GFLOPS | 1.449 × 10^9 / 10^91.449 × 10^9 / 10^9 | 1,449 ms1,449 ms |
| 100 GFLOPS100 GFLOPS | 1.449 × 10^9 / 10^111.449 × 10^9 / 10^11 | 14.5 ms14.5 ms |
| 1 TFLOPS1 TFLOPS | 1.449 × 10^9 / 10^121.449 × 10^9 / 10^12 | 1.45 ms1.45 ms |
| 67 TOPS (Orin Nano, INT8 sparse peak)67 TOPS (Orin Nano، القيمة القصوى المتفرقة بدقة INT8) | 1.449 × 10^9 / 6.7 × 10^131.449 × 10^9 / 6.7 × 10^13 | 0.022 ms0.022 ms |
OPs: the same count for any data typeOPs: العدد نفسه لأي نوع من البيانات
The F in FLOP assumes floating point arithmetic. A quantized network, the kind you deploy on a microcontroller or an INT8 accelerator, stores weights and activations at an Bit width of 8 bits and multiplies integers. Those are not floating point operations, but they are still operations, and there are still two per MAC. The lecture therefore generalizes: an operation (OP) is one multiply or add of any data type, AlexNet is 724M × 2 = 1.4G OPs, and OPS is operations per second. The layer compute calculator in the second concept of this part uses OPS in its hardware box for exactly this reason: the formula for time does not care whether the operands were floats.
حرف F في FLOP يفترض حسابًا بالفاصلة العائمة. الشبكة المكمّمة، من النوع الذي تنشره على متحكم دقيق (microcontroller) أو على مسرّع INT8، تخزّن الأوزان والتنشيطات (activations) بعرض بت (bit-width) قدره 8 بتات وتضرب أعدادًا صحيحة. هذه ليست عمليات فاصلة عائمة، لكنها لا تزال عمليات، ولا يزال هناك اثنتان منها لكل MAC. لذلك تعمّم المحاضرة: العملية (operation (OP)) هي ضرب أو جمع واحد لأي نوع من البيانات، وAlexNet يساوي 724M × 2 = 1.4G من OPs، وOPS هي عدد العمليات في الثانية. حاسبة حساب الطبقة في المفهوم الثاني من هذا الجزء تستخدم OPS في خانة العتاد لهذا السبب بالضبط: صيغة الزمن لا تهتم بما إذا كانت المُعامَلات الحسابية (operands) أعدادًا عائمة.
| Termالمصطلح | Kindالنوع | Meaningالمعنى | Belongs toيخص |
|---|---|---|---|
| MACMAC | Countعدد | One multiply accumulated into a sumعملية ضرب واحدة تُجمع في مجموع جارٍ | A model, per inferenceالنموذج، لكل استدلال |
| FLOPFLOP | Countعدد | One floating point multiply or add; a MAC is twoعملية ضرب أو جمع واحدة بالفاصلة العائمة، وعملية MAC تساوي اثنتين | A model, per inferenceالنموذج، لكل استدلال |
| OPOP | Countعدد | One operation of any data type; a MAC is twoعملية واحدة لأي نوع من البيانات، وعملية MAC تساوي اثنتين | A model, per inferenceالنموذج، لكل استدلال |
| FLOPSFLOPS | Rateمعدل | Floating point operations per secondعدد عمليات الفاصلة العائمة في الثانية | A processorالمعالج |
| OPSOPS | Rateمعدل | Operations per second, any data typeعدد العمليات في الثانية، لأي نوع من البيانات | A processorالمعالج |
Quick checkاختبار سريع
A model needs 3.6G FLOPs and a chip sustains 400 GFLOPS. What is T_computation?يحتاج نموذج 3.6G FLOPs، وتحافظ شريحة على 400 GFLOPS. ما قيمة T_computation؟
Quick checkاختبار سريع
Why does the lecture generalize from FLOPs to OPs?لماذا تعمّم المحاضرة من FLOPs إلى OPs؟
Quick checkاختبار سريع
A datasheet advertises a board at 67 TOPS. What kind of quantity is that?تعلن نشرة بيانات أن لوحة ما تصل إلى 67 TOPS. ما نوع هذه الكمية؟
Recall
State the rule that turns a MAC count into a FLOP count and a FLOP count into a time, then apply it: AlexNet on a 1 TFLOPS processor.اذكر القاعدة التي تحوّل عدد MACs إلى عدد FLOPs، وعدد FLOPs إلى زمن، ثم طبّقها: AlexNet على معالج سرعته 1 TFLOPS.
Recall
Why use OPs rather than FLOPs for an INT8 model, and how many OPs per MAC?لماذا نستخدم OPs بدلًا من FLOPs لنموذج INT8، وكم OP لكل MAC؟
Slide 29 lists the ten works the lecture draws on. Six were used directly in this lecture's counting and examples; the other four appear here as context for the architectures and normalization layers of lecture 02 and the pruning lectures ahead.
تسرد الشريحة 29 الأعمال العشرة التي تستند إليها المحاضرة. ستة منها استُخدمت مباشرة في العدّ والأمثلة في هذه المحاضرة؛ والأربعة الأخرى تظهر هنا كسياق للبنى المعمارية وطبقات التطبيع (normalization) في المحاضرة 02 ولمحاضرات التقليم القادمة.
Used in this lectureمستخدمة في هذه المحاضرة
- Dumoulin and Visin, Convolution arithmetic (GitHub repository and arXiv 1603.07285): the output-shape arithmetic behind every h_o × w_o in this part.Dumoulin وVisin، Convolution arithmetic (مستودع GitHub وarXiv 1603.07285): حسابات شكل المخرج وراء كل h_o × w_o في هذا الجزء.
- Stanford CS231n, lecture 5, Image Classification with CNNs: parameter sharing, the output-size formula and im2col.Stanford CS231n، المحاضرة 5، Image Classification with CNNs: مشاركة المعاملات، وصيغة حجم المخرج، وim2col.
- Krizhevsky, Sutskever and Hinton, ImageNet Classification with Deep Convolutional Neural Networks, NeurIPS 2012: the AlexNet layers counted on slides 25 and 26.Krizhevsky وSutskever وHinton، ImageNet Classification with Deep Convolutional Neural Networks، NeurIPS 2012: طبقات AlexNet المعدودة في الشريحتين 25 و26.
- Sandler et al., MobileNetV2: Inverted Residuals and Linear Bottlenecks, CVPR 2018: the depthwise design that cuts both parameters and MACs, and the "MAdd" convention.Sandler et al.، MobileNetV2: Inverted Residuals and Linear Bottlenecks، CVPR 2018: التصميم العمقي (depthwise) الذي يخفض المعاملات وMACs معًا، واصطلاح "MAdd".
- Deng, Li, Han, Shi and Xie, Model Compression and Hardware Acceleration for Neural Networks: A Comprehensive Survey, Proceedings of the IEEE 108(4), 2020: the wider map of compression techniques that these metrics evaluate.Deng وLi وHan وShi وXie، Model Compression and Hardware Acceleration for Neural Networks: A Comprehensive Survey، Proceedings of the IEEE 108(4), 2020: الخريطة الأوسع لتقنيات الضغط التي تقيّمها هذه المقاييس.
- Song Han, MIT 6.5940 TinyML and Efficient Deep Learning Computing, lecture 2: the direct source of slides 23 to 28.Song Han، MIT 6.5940 TinyML and Efficient Deep Learning Computing، المحاضرة 2: المصدر المباشر للشرائح من 23 إلى 28.
Context for other lecturesسياق لمحاضرات أخرى
- Ioffe and Szegedy, Batch Normalization, ICML 2015.Ioffe وSzegedy، Batch Normalization، ICML 2015.
- Wu and He, Group Normalization, ECCV 2018.Wu وHe، Group Normalization، ECCV 2018.
- Simonyan and Zisserman, Very Deep Convolutional Networks for Large-Scale Image Recognition, ICLR 2015.Simonyan وZisserman، Very Deep Convolutional Networks for Large-Scale Image Recognition، ICLR 2015.
- He, Zhang, Ren and Sun, Deep Residual Learning for Image Recognition, CVPR 2016.He وZhang وRen وSun، Deep Residual Learning for Image Recognition، CVPR 2016.
Recapالخلاصة
If you remember nothing elseإن لم تتذكر شيئاً آخر فتذكّر هذا
- A MAC is a <- a + b·c. A matrix-vector product costs m·n MACs and a matrix-matrix product m·n·k MACs.عملية MAC هي a <- a + b·c. ضرب مصفوفة في متجه يكلف m·n من MACs، وضرب مصفوفة في مصفوفة يكلف m·n·k من MACs.
- Linear: c_o·c_i. Convolution: c_o·c_i·k_h·k_w·h_o·w_o. Grouped: divide by g. Depthwise: c_o·k_h·k_w·h_o·w_o, with no c_i.الخطية: c_o·c_i. الالتفاف: c_o·c_i·k_h·k_w·h_o·w_o. المجمّع (grouped): اقسم على g. العمقي (depthwise): c_o·k_h·k_w·h_o·w_o، بدون c_i.
- Convolution MACs equal parameters times h_o·w_o. Linear MACs equal parameters.MACs الالتفاف تساوي عدد المعاملات مضروبًا في h_o·w_o. و MACs الطبقة الخطية تساوي عدد معاملاتها.
- AlexNet performs 724,406,816 MACs. Its convolutions hold 3.8 percent of the parameters but perform 92 percent of the MACs; the linear layers are the reverse.ينفّذ AlexNet عدد 724,406,816 من MACs. طبقات الالتفاف فيه تحمل 3.8 بالمئة من المعاملات لكنها تنفّذ 92 بالمئة من MACs، والطبقات الخطية عكس ذلك تمامًا.
- One MAC is two FLOPs, so AlexNet is about 1.45G FLOPs, which the slide rounds to 1.4G.عملية MAC الواحدة تساوي اثنتين من FLOPs، لذا يحتاج AlexNet نحو 1.45G FLOPs، وتقرّبها الشريحة إلى 1.4G.
- FLOPs and OPs are counts that belong to a model. FLOPS and OPS are rates that belong to a processor. T_computation = OPs / OPS.FLOPs و OPs أعداد تخص النموذج. أما FLOPS و OPS فمعدلات تخص المعالج. T_computation = OPs / OPS.
- OPs generalizes FLOPs to quantized integer networks; the count per MAC stays two.تعمّم OPs مفهوم FLOPs على الشبكات المكمّمة التي تعمل بالأعداد الصحيحة، ويبقى العدد لكل MAC اثنين.
- Conventions differ: many papers and tools report MACs under the label FLOPs. Check before comparing numbers.الاصطلاحات تختلف: كثير من الأوراق والأدوات تذكر MACs تحت اسم FLOPs. تحقّق من ذلك قبل مقارنة الأرقام.
Sourcesالمصادر
- MIT 6.5940 Fall 2023, Lecture 2: Basics of Deep LearningVideoMIT HAN Lab, Song HanSlides 77 to 85 are the source of slides 23 to 28: MAC, MV, GEMM, per-layer MACs, AlexNet 724M, FLOP, FLOPS, OP, OPS.الشرائح من 77 إلى 85 هي مصدر الشرائح من 23 إلى 28: MAC، و MV، و GEMM، و MACs لكل طبقة، و AlexNet بعدد 724M، و FLOP، و FLOPS، و OP، و OPS.(opens in a new tab)(يفتح في تبويب جديد)
- ImageNet Classification with Deep Convolutional Neural NetworksPaperNeurIPS 2012, Krizhevsky, Sutskever and HintonAlexNet: five convolution and three linear layers, about 60M parameters.AlexNet: خمس طبقات التفاف وثلاث طبقات خطية، ونحو 60M من المعاملات.(opens in a new tab)(يفتح في تبويب جديد)
- Efficient Processing of Deep Neural Networks: A Tutorial and SurveyPaperProceedings of the IEEE, Sze, Chen, Yang and EmerMAC as the fundamental component; AlexNet at 61M weights and 724M MACs, with FC layers at 58.6M of each.MAC بوصفها المكوّن الأساسي؛ و AlexNet بعدد 61M من الأوزان و 724M من MACs، وتحمل الطبقات المتصلة كليًا (FC) 58.6M من كل منهما.(opens in a new tab)(يفتح في تبويب جديد)
- MobileNets: Efficient Convolutional Neural Networks for Mobile Vision ApplicationsPaperarXiv, Howard et al.Equations 4 and 5 give the depthwise and separable costs; the unnumbered ratio that follows is 1/N + 1/D_K^2, 8 to 9 times less computation; Mult-Adds; GEMM via im2col.المعادلتان 4 و 5 تعطيان كلفة الالتفاف العمقي (depthwise) والمنفصل (separable)؛ والنسبة غير المرقّمة التي تليهما هي 1/N + 1/D_K^2، أي حساب أقل بما بين 8 و 9 مرات؛ و Mult-Adds؛ و GEMM عبر im2col.(opens in a new tab)(يفتح في تبويب جديد)
- MobileNetV2: Inverted Residuals and Linear BottlenecksPaperCVPR 2018, Sandler et al.Operations reported as multiply-adds (MAdd).العمليات مذكورة على شكل عمليات ضرب وجمع (MAdd).(opens in a new tab)(يفتح في تبويب جديد)
- Deep Learning, chapter 9: Convolutional NetworksBookMIT Press, Goodfellow, Bengio and CourvilleSection 9.2: parameter sharing keeps forward runtime O(k x n) while cutting storage to k parameters.القسم 9.2: مشاركة المعاملات تُبقي زمن الانتشار الأمامي O(k x n) بينما تخفض التخزين إلى k من المعاملات.(opens in a new tab)(يفتح في تبويب جديد)
- Matrix Multiplication Background User's GuideDocsNVIDIA Deep Learning Performance documentationGEMM costs 2 * M * N * K FLOPs (the page itself writes FLOPS) because each FMA is two operations, a multiply and an add.كلفة GEMM هي 2 * M * N * K من FLOPs (والصفحة نفسها تكتبها FLOPS) لأن كل FMA عبارة عن عمليتين، ضرب وجمع.(opens in a new tab)(يفتح في تبويب جديد)
- GPU Performance Background User's GuideDocsNVIDIA Deep Learning Performance documentationMath time equals the number of operations divided by the processor's math bandwidth: T_computation = FLOPs / FLOPS when math limited.زمن الحساب يساوي عدد العمليات مقسومًا على عرض النطاق الحسابي للمعالج: T_computation = FLOPs / FLOPS عندما يكون الأداء محدودًا بالحساب.(opens in a new tab)(يفتح في تبويب جديد)
- torch.nn.Conv2dDocsPyTorch documentationOutput-size formula, groups semantics, groups = in_channels as depthwise convolution.صيغة حجم المخرج، ومعنى groups، و groups = in_channels بوصفها التفافًا عمقيًا (depthwise).(opens in a new tab)(يفتح في تبويب جديد)
- CS231n Convolutional Neural Networks for Visual Recognition: course notesDocsStanford UniversityParameter sharing, output-size arithmetic, AlexNet conv1 at 55 x 55 x 96, im2col.مشاركة المعاملات، وحساب حجم المخرج، و conv1 في AlexNet بحجم 55 x 55 x 96، و im2col.(opens in a new tab)(يفتح في تبويب جديد)
- TOP500 List, November 2024DocsTOP500Rmax and Rpeak columns reported in PFlop/s.عمودا Rmax و Rpeak مذكوران بوحدة PFlop/s.(opens in a new tab)(يفتح في تبويب جديد)
- fvcore FlopCountAnalysisDocsDetectron2 documentation, MetaCounts one fused multiply-add as one flop: the opposite convention to this course.تعدّ عملية الضرب والجمع المدمجة الواحدة flop واحدًا: وهو الاصطلاح المعاكس لاصطلاح هذا المقرر.(opens in a new tab)(يفتح في تبويب جديد)
- Multiply-accumulate operationArticleWikipediaDefinition a <- a + (b x c) and the IEEE 754-2008 fused multiply-add. Used only for the definition.التعريف a <- a + (b x c)، وعملية الضرب والجمع المدمجة في IEEE 754-2008. استُخدم للتعريف فقط.(opens in a new tab)(يفتح في تبويب جديد)
- Jetson modulesDocsNVIDIA DeveloperJetson Orin Nano up to 67 TOPS and AGX Orin up to 275 TOPS.Jetson Orin Nano حتى 67 TOPS، و AGX Orin حتى 275 TOPS.(opens in a new tab)(يفتح في تبويب جديد)
- Jetson Orin specificationsDocsNVIDIAThe TOPS figures are sparse INT8; dense INT8 ratings are about half, for example 170 sparse against 85 dense.أرقام TOPS هي قيم متفرقة (sparse) بدقة INT8؛ والقيم الكثيفة (dense) بدقة INT8 تقارب النصف، مثلًا 170 متفرقة مقابل 85 كثيفة.(opens in a new tab)(يفتح في تبويب جديد)
- Model Compression and Hardware Acceleration for Neural Networks: A Comprehensive SurveyPaperProceedings of the IEEE 108(4), Deng, Li, Han, Shi and XieReference 9 on slide 29.المرجع 9 في الشريحة 29.(opens in a new tab)(يفتح في تبويب جديد)
- A guide to convolution arithmetic for deep learningDocsDumoulin and Visin, GitHub and arXiv 1603.07285Reference 1 on slide 29: output-shape arithmetic.المرجع 1 في الشريحة 29: حساب شكل المخرج.(opens in a new tab)(يفتح في تبويب جديد)