COE 592Lecture 5.1المحاضرة 5.1Glossaryالمصطلحات
Glossaryالمصطلحات
Every term in Quantization (I), defined once and used the same way in every part. Each entry links to the slides where the idea appears.كل مصطلح في محاضرة «التكميم (Quantization) الجزء الأول»، معرّف مرة واحدة ومستخدم بالمعنى نفسه في كل الأجزاء. كل مدخل يربطك بالشرائح التي تظهر فيها الفكرة.
- Termsالمصطلحات
- 49
- Lettersالحروف
- 19
B
- BF16 (Brain Float)
Google's 16-bit float: 1 sign, 8 exponent, 7 fraction bits, bias 127. Same range as FP32 with less precision.صيغة Google العائمة بـ 16 بت: بت للإشارة، و8 بتات للأس، و7 بتات للكسر، والـ bias يساوي 127. لها نفس مدى FP32 لكن بدقة أقل.
- Binary and ternary quantization
Extreme quantization to 1-bit or 3-level weights, listed as the third approach and covered in a later lecture.quantization متطرف إلى أوزان بـ 1 بت أو بثلاثة مستويات، مذكور كالنهج الثالث وسيُشرح في محاضرة لاحقة.
- Bit-width
Number of bits used to store one value. Fewer bits mean cheaper arithmetic, less memory traffic and smaller models.عدد البتات المستخدمة لتخزين قيمة واحدة. كلما قلّت البتات صارت العمليات الحسابية أرخص، وقلّ نقل البيانات من الذاكرة (memory traffic)، وصغر حجم النموذج.
- Bits per effective weight
Width of the cluster index stored for each weight that survives pruning, giving 2^bits shared values. AlexNet keeps its accuracy down to 4 bits in conv layers and 2 bits in FC layers; 32 effective weights means a 5-bit index.عرض رقم العنقود (cluster index) المخزن لكل وزن يبقى بعد الـ pruning، ويعطي 2^bits من القيم المشتركة. يحافظ AlexNet على دقته حتى 4 بتات في طبقات conv و2 بت في طبقات FC؛ ووجود 32 وزنًا فعّالًا يعني index بطول 5 بتات.
C
- Centroid
The representative value (cluster mean) of one K-means cluster, stored in the codebook.القيمة الممثِّلة (متوسط العنقود cluster mean) لعنقود واحد في K-means، وتُخزَّن في الـ codebook.
- Centroid fine-tuning
Retraining quantized weights by grouping the weight gradients by cluster index, summing each group and updating centroid_k <- centroid_k - lr x sum, with indexes kept fixed.إعادة تدريب الأوزان المكمَّمة بتجميع gradients الأوزان حسب رقم العنقود، وجمع كل مجموعة، ثم تحديث centroid_k <- centroid_k - lr x sum، مع إبقاء الـ indexes ثابتة.
- Cluster index
The N-bit integer stored per weight that points to its centroid in the codebook (2-bit in the 4-cluster example).عدد صحيح من N بت يُخزَّن لكل وزن ويشير إلى الـ centroid الخاص به في الـ codebook (بطول 2 بت في مثال العناقيد الأربعة).
- Codebook
Lookup table of 2^N floating-point centroids indexed by the N-bit cluster index; costs 32 x 2^N bits.جدول بحث (lookup table) فيه 2^N من الـ centroids بصيغة floating-point، ويُفهرس برقم العنقود المكون من N بت؛ وكلفته 32 x 2^N بت.
- Compression ratio
Original size divided by compressed size, e.g. 64 B / 20 B = 3.2x in the example, approaching 32/N for N-bit K-means quantization when M >> 2^N.الحجم الأصلي مقسومًا على الحجم بعد الضغط، فمثلًا 64 B / 20 B = 3.2x في المثال، ويقترب من 32/N في K-means quantization بـ N بت عندما يكون M >> 2^N.
D
- Decode (lookup) at inference
At runtime the stored uint indexes are turned back into float weights through the codebook before the floating-point convolution.أثناء التشغيل تُحوَّل الـ uint indexes المخزنة إلى أوزان float مرة أخرى عبر الـ codebook قبل تنفيذ الـ convolution بالـ floating-point.
- Deep Compression
Han et al., ICLR 2016: pruning (9x to 13x), then K-means quantization (27x to 31x), then Huffman coding (35x to 49x), all with no accuracy loss.بحث Han et al. في ICLR 2016: أولًا pruning (من 9x إلى 13x)، ثم K-means quantization (من 27x إلى 31x)، ثم Huffman coding (من 35x إلى 49x)، وكل ذلك بدون أي خسارة في الدقة.
E
- Exponent bias
Constant subtracted from the stored exponent so it can represent negative powers: 2^(e-1) - 1, i.e. 127 for FP32 and BF16, 15 for FP16 and E5M2, 7 for E4M3.ثابت يُطرح من قيمة الأس المخزنة حتى يمكن تمثيل القوى السالبة، وقيمته 2^(e-1) - 1، أي 127 في FP32 و BF16، و15 في FP16 و E5M2، و7 في E4M3.
F
- Fire module
SqueezeNet building block: a 1x1 squeeze conv (64 to 16 channels) feeding parallel 1x1 and 3x3 expand convs (64 each) concatenated to 128 channels.وحدة البناء الأساسية في SqueezeNet: طبقة squeeze conv بحجم 1x1 (من 64 إلى 16 قناة) تغذي طبقتي expand conv متوازيتين بحجم 1x1 و3x3 (64 قناة لكل منهما)، ثم تُدمجان (concatenate) إلى 128 قناة.
- Fixed-point number
A number with a fixed binary point between integer and fraction bits, equivalent to an integer times a fixed power-of-two scale, e.g. 0011.0001 = 49 x 2^-4 = 3.0625.عدد فيه فاصلة ثنائية (binary point) ثابتة بين بتات الجزء الصحيح وبتات الكسر، وهو يكافئ عددًا صحيحًا مضروبًا في مقياس ثابت هو قوة للعدد 2، مثل 0011.0001 = 49 x 2^-4 = 3.0625.
- Floating-point number
A number stored as sign, exponent and fraction: (-1)^sign x (1 + Fraction) x 2^(Exponent - bias) for normal values.عدد يُخزَّن على شكل إشارة (sign) وأُس (exponent) وكسر (fraction): قيمته (-1)^sign x (1 + Fraction) x 2^(Exponent - bias) في حالة القيم العادية (normal).
- FP16
IEEE half precision: 1 sign, 5 exponent, 10 fraction bits, bias 15, largest normal 65504.نصف الدقة في IEEE: بت للإشارة، و5 بتات للأس، و10 بتات للكسر، والـ bias يساوي 15، وأكبر عدد normal هو 65504.
- FP32
IEEE 754 single precision: 1 sign bit, 8 exponent bits, 23 fraction bits, bias 127.الدقة الأحادية في IEEE 754: بت واحد للإشارة، و8 بتات للأس، و23 بتًا للكسر، والـ bias يساوي 127.
- FP4 (E1M2, E2M1, E3M0)
4-bit float variants trading mantissa for exponent bits. Positive values: E1M2 0 to 3.5 in steps of 0.5; E2M1 0, 0.5, 1, 1.5, 2, 3, 4, 6; E3M0 0, 0.25, 0.5, 1, 2, 4, 8, 16. None has INF or NaN.صيغ عائمة بـ 4 بتات تتبادل بتات الـ mantissa مع بتات الأس. القيم الموجبة: E1M2 من 0 إلى 3.5 بخطوات 0.5؛ و E2M1 هي 0, 0.5, 1, 1.5, 2, 3, 4, 6؛ و E3M0 هي 0, 0.25, 0.5, 1, 2, 4, 8, 16. لا تحتوي أي منها على INF أو NaN.
- FP8 E4M3
8-bit float with 4 exponent and 3 mantissa bits, bias 7, no infinity, S.1111.111 is NaN, largest normal 448. Used for forward weights and activations.عدد عائم بـ 8 بتات فيه 4 بتات للأس و3 بتات للـ mantissa، والـ bias يساوي 7، ولا يحتوي على infinity، والنمط S.1111.111 يمثل NaN، وأكبر عدد normal هو 448. يُستخدم للأوزان والـ activations في التمرير الأمامي (forward).
- FP8 E5M2
8-bit float with 5 exponent and 2 mantissa bits, bias 15, has INF and NaN, largest normal 57344. Used for gradients in the backward pass.عدد عائم بـ 8 بتات فيه 5 بتات للأس و2 بت للـ mantissa، والـ bias يساوي 15، ويحتوي على INF و NaN، وأكبر عدد normal هو 57344. يُستخدم للـ gradients في التمرير الخلفي (backward pass).
- Fraction (mantissa, significand)
The bits after the binary point of the significand. Its width sets the precision of the format.البتات الواقعة بعد الفاصلة الثنائية في الـ significand. عرضها هو الذي يحدد دقة (precision) الصيغة.
H
- Huffman coding
Lossless variable-length coding: frequent symbols get short codes, infrequent ones long codes. Used on both quantized weights and sparse indexes.ترميز بدون فقد (lossless) بطول متغير: الرموز المتكررة تأخذ رموزًا قصيرة، والنادرة تأخذ رموزًا طويلة. يُطبَّق على الأوزان المكمَّمة وعلى الـ sparse indexes معًا.
I
- IEEE 754
The standard defining binary floating-point formats such as FP32 (single precision) and FP16 (half precision).المعيار الذي يعرّف صيغ الفاصلة العائمة الثنائية مثل FP32 (الدقة الأحادية single precision) و FP16 (نصف الدقة half precision).
- Infinity and NaN
Exponent field all ones: fraction 0 means plus or minus infinity, fraction nonzero means NaN (not a number).حقل الأس كله آحاد: إذا كان الكسر 0 فالقيمة موجب أو سالب ما لا نهاية (infinity)، وإذا كان الكسر غير صفري فالقيمة NaN (ليست عددًا).
- INT4
4-bit two's complement integer with evenly spaced values -8 to 7.عدد صحيح بـ 4 بتات بنظام two's complement، قيمه متباعدة بالتساوي من -8 إلى 7.
K
- K-means clustering (Lloyd's algorithm)
Partitions values into k clusters by repeating two steps until nothing changes: assign each value to its nearest centroid, then move each centroid to the mean of its members. It is the "Cluster the Weights" step of K-means weight quantization.يقسم القيم إلى k عناقيد بتكرار خطوتين حتى لا يتغير شيء: يُسند كل قيمة إلى أقرب centroid، ثم ينقل كل centroid إلى متوسط أعضائه. وهي خطوة "Cluster the Weights" في K-means weight quantization.
- K-means-based weight quantization
Cluster the weights with K-means, store each weight as the index of its cluster plus a floating-point codebook of centroids. Saves storage but computation stays floating point.نجمّع الأوزان باستخدام K-means، ثم نخزن كل وزن على شكل رقم (index) العنقود الذي ينتمي إليه، بالإضافة إلى codebook بقيم floating-point للـ centroids. يوفّر في التخزين لكن الحساب يبقى floating point.
L
- Largest subnormal (FP32)
(1 - 2^-23) x 2^-126 = 2^-126 - 2^-149, just below the smallest normal 2^-126.يساوي (1 - 2^-23) x 2^-126 = 2^-126 - 2^-149، أي أقل بقليل من أصغر عدد normal وهو 2^-126.
- Learning rate (lr)
Step size that scales the summed cluster gradient before it is subtracted from the centroid. Slide 29 writes only "x lr"; its numbers (2.00 - 0.04 = 1.96) correspond to lr = 1.حجم الخطوة الذي يُضرب في مجموع gradients العنقود قبل طرحه من الـ centroid. الشريحة 29 تكتب فقط "x lr"، لكن أرقامها (2.00 - 0.04 = 1.96) توافق lr = 1.
- Linear quantization
Affine mapping of integers to reals r = S(q - Z) with scale S and zero point Z; stores integer weights and allows integer arithmetic. Previewed with S = 1.07, Z = -1.تحويل affine من الأعداد الصحيحة إلى الأعداد الحقيقية r = S(q - Z) باستخدام scale S و zero point Z؛ يخزن أوزانًا صحيحة ويسمح بالحساب بالأعداد الصحيحة (integer arithmetic). عُرض كمعاينة بـ S = 1.07 و Z = -1.
M
- Model size ratio after compression
Compressed model size as a percentage of the original, the x-axis of the accuracy versus compression plots for AlexNet on ImageNet. Its reciprocal is the compression ratio, e.g. 3.7% is about 27x.حجم النموذج المضغوط كنسبة مئوية من الحجم الأصلي، وهو المحور x في رسومات الدقة مقابل الضغط لـ AlexNet على ImageNet. مقلوبه هو نسبة الضغط (compression ratio)، فمثلًا 3.7% تعادل نحو 27x.
N
- Normal number
Float with exponent field not 0 and not all ones, value (-1)^sign x (1 + Fraction) x 2^(Exponent - bias), with an implicit leading 1.عدد عائم حقل الأس فيه ليس 0 وليس كله آحادًا، وقيمته (-1)^sign x (1 + Fraction) x 2^(Exponent - bias) مع 1 ضمني (implicit) في البداية.
O
- Off-chip memory (DRAM) access
Reading data from off-chip DRAM. Slide 3 puts one DRAM access at 200x or more the energy of an arithmetic operation (about 640 pJ per 32-bit read in the 45 nm figures against 3.7 pJ for a 32-bit float multiply), so fewer bits per weight cut memory traffic as well as arithmetic cost.قراءة البيانات من ذاكرة DRAM الموجودة خارج الشريحة (off-chip). تضع الشريحة 3 كلفة الوصول الواحد إلى DRAM عند 200 ضعف أو أكثر من طاقة عملية حسابية واحدة (نحو 640 pJ لقراءة 32-bit في أرقام تقنية 45 nm مقابل 3.7 pJ لعملية ضرب float بـ 32-bit)، لذلك فإن تقليل البتات لكل وزن يخفض نقل البيانات من الذاكرة وكلفة الحساب معًا.
P
- Palettization
Representing an image with a small palette of colours (e.g. 16), the image analogue of K-means weight quantization with a codebook.تمثيل الصورة بلوحة ألوان صغيرة (palette)، مثل 16 لونًا، وهي النظير الصوري لـ K-means weight quantization باستخدام codebook.
- Pruning
Removing weights or connections to reduce the number of parameters; complementary to quantization, which reduces bits per weight.حذف أوزان أو وصلات لتقليل عدد المعاملات (parameters)؛ وهو مكمِّل للـ quantization الذي يقلل عدد البتات لكل وزن.
Q
- Quantization
Constraining an input from a continuous or otherwise large set of values to a discrete set, for example mapping FP32 weights onto a few shared values or integers.تقييد المدخل من مجموعة قيم متصلة أو كبيرة جدًا إلى مجموعة منفصلة (discrete)، مثل تحويل أوزان FP32 إلى عدد قليل من القيم المشتركة أو إلى أعداد صحيحة.
- Quantization error
The difference between an input value and its quantized value, e.g. 2.09 quantized to 2.00 has error 0.09.الفرق بين القيمة الأصلية للمدخل وقيمتها بعد الـ quantization، فمثلًا 2.09 تُكمَّم إلى 2.00 فيكون الخطأ 0.09.
R
- Range vs precision
Exponent width determines the range of representable magnitudes; fraction width determines the precision (spacing) of values.عرض الأس يحدد مدى (range) المقادير التي يمكن تمثيلها، وعرض الكسر يحدد الدقة (precision)، أي المسافة بين القيم المتجاورة.
- Reconstructed weights
The 32-bit float weights rebuilt by replacing each cluster index with its centroid, e.g. 2.09 becomes 2.00. Quantization error is the original weight minus the reconstructed weight (2.09 - 2.00 = 0.09).أوزان float بـ 32 بت يُعاد بناؤها باستبدال كل رقم عنقود (cluster index) بالـ centroid الخاص به، فمثلًا 2.09 تصبح 2.00. وخطأ الـ quantization هو الوزن الأصلي ناقص الوزن المعاد بناؤه (2.09 - 2.00 = 0.09).
S
- Scale and zero point
The two parameters of linear quantization r = (q - Z) x S: the scale S is the real step between adjacent integer levels and the zero point Z is the integer that maps to real 0. Slide 43 uses S = 1.07 and Z = -1, so q = 1 decodes to (1 - (-1)) x 1.07 = 2.14.معاملا الـ linear quantization في r = (q - Z) x S: الـ scale S هو الخطوة الحقيقية بين مستويين صحيحين متجاورين، والـ zero point Z هو العدد الصحيح الذي يقابل القيمة الحقيقية 0. الشريحة 43 تستخدم S = 1.07 و Z = -1، لذلك q = 1 تُفك إلى (1 - (-1)) x 1.07 = 2.14.
- Sign-magnitude
Signed integer where the top bit is the sign and the rest the magnitude. Range [-(2^(n-1) - 1), 2^(n-1) - 1], with two encodings of zero.عدد صحيح بإشارة يكون فيه البت الأعلى هو الإشارة (sign) وبقية البتات هي المقدار (magnitude). مداه [-(2^(n-1) - 1), 2^(n-1) - 1]، وللصفر فيه ترميزان.
- Smallest positive subnormal (FP32)
2^-23 x 2^-126 = 2^-149, encoded with exponent 0 and only the last fraction bit set.يساوي 2^-23 x 2^-126 = 2^-149، ويُرمَّز بأس يساوي 0 مع تفعيل آخر بت في الكسر فقط.
- Sparse index
After pruning, the positions of the surviving weights. Deep Compression stores them as relative offsets between nonzero weights and Huffman codes them (the "Encode Index" step).مواقع الأوزان المتبقية بعد الـ pruning. يخزنها Deep Compression على شكل إزاحات نسبية (relative offsets) بين الأوزان غير الصفرية، ثم يرمزها بـ Huffman (خطوة "Encode Index").
- SqueezeNet
Compact CNN with AlexNet-level accuracy and 50x fewer parameters (4.8 MB); with Deep Compression it reaches 0.47 MB, 510x smaller than AlexNet.شبكة CNN مدمجة بدقة مماثلة لـ AlexNet وبعدد معاملات أقل بـ 50 مرة (4.8 MB)؛ ومع Deep Compression تصل إلى 0.47 MB، أي أصغر من AlexNet بـ 510 مرات.
- Subnormal number
Float with exponent field 0: value (-1)^sign x Fraction x 2^(1 - bias), no implicit 1. Fills the gap between 0 and the smallest normal and allows zero to be encoded.عدد عائم حقل الأس فيه يساوي 0: قيمته (-1)^sign x Fraction x 2^(1 - bias) بدون الـ 1 الضمني. يملأ الفجوة بين 0 وأصغر عدد normal، ويسمح بترميز الصفر.
T
- Top-1 and top-5 accuracy
Share of test images whose true label is the model's single highest-scoring class (top-1) or among its five highest-scoring classes (top-5). Both are plotted against bits per weight on slide 36.نسبة صور الاختبار التي يكون تصنيفها الصحيح هو الصنف الأعلى درجة عند النموذج (top-1)، أو ضمن أعلى خمسة أصناف (top-5). كلاهما مرسوم مقابل عدد البتات لكل وزن في الشريحة 36.
- Two's complement
Signed integer where the top bit has weight -2^(n-1). Range [-2^(n-1), 2^(n-1) - 1], a single zero; -49 in 8 bits is 11001111.عدد صحيح بإشارة يكون وزن البت الأعلى فيه -2^(n-1). مداه [-2^(n-1), 2^(n-1) - 1] وله صفر واحد فقط؛ فمثلًا -49 في 8 بتات هو 11001111.
U
- Unsigned integer
n-bit integer with range [0, 2^n - 1], e.g. 0 to 255 for 8 bits.عدد صحيح بلا إشارة بطول n بت، ومداه [0, 2^n - 1]، فمثلًا من 0 إلى 255 في حالة 8 بتات.
W
- Weight sharing
Several weights that are close in value are replaced by one shared value, e.g. 2.09, 2.12, 1.92 and 1.87 all become 2.0.استبدال عدة أوزان متقاربة القيمة بقيمة واحدة مشتركة، فمثلًا 2.09 و2.12 و1.92 و1.87 تصبح كلها 2.0.