COE 592Lecture 5.3المحاضرة 5.3Glossaryالمصطلحات
Glossaryالمصطلحات
Every term in Quantization (III): PTQ granularity, range clipping, rounding, QAT, binary/ternary and mixed precision, defined once and used the same way in every part. Each entry links to the slides where the idea appears.كل مصطلح في محاضرة «التكميم (Quantization) الجزء الثالث: دقة PTQ، وقص المدى، والتقريب، وQAT، والثنائي والثلاثي، والدقة المختلطة»، معرّف مرة واحدة ومستخدم بالمعنى نفسه في كل الأجزاء. كل مدخل يربطك بالشرائح التي تظهر فيها الفكرة.
- Termsالمصطلحات
- 46
- Lettersالحروف
- 20
A
- Actor-critic agent
The reinforcement-learning pair in HAQ: the actor outputs a bit-width action per layer from the layer state, and the critic scores it using the reward.الثنائي الخاص بالتعلّم المعزّز في HAQ: الـ actor يُخرج قرارًا (action) بعرض البتات لكل طبقة انطلاقًا من حالة الطبقة (state)، والـ critic يقيّم هذا القرار باستخدام المكافأة (reward).
- AdaRound
Adaptive rounding that learns, per weight, whether to take floor or ceil by minimizing ||Wx - W_tilde x||_F^2 + lambda f_reg(V).تقريب تكيّفي يتعلّم لكل وزن هل يأخذ floor أم ceil عن طريق تقليل ||Wx - W_tilde x||_F^2 + lambda f_reg(V).
- Asymmetric quantization
Linear quantization with a nonzero zero point, so the integer range covers [r_min, r_max] even when it is not centered on 0; the slide 37 recipe uses it for activations.تكميم خطي بـ zero point غير صفري، بحيث يغطي النطاق الصحيح المجال [r_min, r_max] حتى لو لم يكن متمركزًا حول 0؛ وتستخدمه وصفة الشريحة 37 للـ activations.
B
- Binarization
Quantizing values to +1 or -1 (1 bit), so multiplications become additions and subtractions or bit operations.تكميم القيم إلى +1 أو -1 (بت واحد)، فتتحول عمليات الضرب إلى جمع وطرح أو إلى عمليات على البتات (bit operations).
- Binarized Neural Network (BNN)
Binary weights and activations without scale factors; loses about 28.7% top-1 on AlexNet.أوزان و activations ثنائية بدون معاملات scale؛ وتخسر نحو 28.7% من دقة top-1 على AlexNet.
- Binary Weight Network (BWN)
Binarized weights with a per-tensor scale alpha = (1/n)||W||_1, nearly matching full-precision accuracy on AlexNet.أوزان ثنائية (binarized) مع scale لكل tensor قيمته alpha = (1/n)||W||_1، وتقترب دقتها كثيرًا من دقة النموذج كامل الدقة (full-precision) على AlexNet.
C
- Calibration batches
A few batches of samples run through the trained FP32 model to collect activation statistics for choosing the range.بضع دفعات (batches) من العينات تُمرَّر عبر نموذج FP32 المدرّب لجمع إحصائيات الـ activations من أجل اختيار النطاق.
D
- Depthwise convolution
A convolution that filters each input channel separately; it holds few weights but large feature maps, so it is memory bound and gets fewer bits on the edge.التفاف (convolution) يرشّح كل قناة إدخال على حدة؛ يحتوي أوزانًا قليلة لكن خرائط سمات (feature maps) كبيرة، لذا فهو memory bound ويحصل على بتات أقل على الـ edge.
- Deterministic binarization
q = sign(r): +1 if r >= 0, otherwise -1.q = sign(r): القيمة +1 إذا كان r >= 0، وإلا -1.
- Direct hardware feedback
Measuring latency and energy on the actual accelerator (BISMO, BitFusion) rather than using proxies like FLOPs.قياس زمن الاستجابة (latency) والطاقة على المسرّع الفعلي (BISMO، BitFusion) بدلًا من استخدام مؤشرات تقريبية (proxies) مثل FLOPs.
- Dynamic range clipping
Choosing a clipping range narrower than the observed min/max so quantization levels are spent on dense values instead of rare outliers.اختيار نطاق قص (clipping) أضيق من الحد الأدنى والأعلى المرصودين (min/max) حتى تُصرف مستويات التكميم على القيم الكثيفة بدلًا من القيم الشاذة النادرة (outliers).
E
- Effective bit width
Element bits plus the amortized scale bits, for example 4 + 4/16 = 4.25 for INT4 with a 4-bit scale per 16 elements.عدد بتات العنصر مضافًا إليه بتات الـ scale موزعة على العناصر، مثلًا 4 + 4/16 = 4.25 لـ INT4 مع scale من 4 بت لكل 16 عنصرًا.
- Exponential moving average (EMA)
Smoothing observed activation min/max during training: r_hat(t) = alpha * r(t) + (1 - alpha) * r_hat(t-1).تنعيم الحد الأدنى والأعلى (min/max) المرصودين للـ activations أثناء التدريب: r_hat(t) = alpha * r(t) + (1 - alpha) * r_hat(t-1).
F
- Full-precision weight copy
The FP weights kept during QAT so tiny gradient updates accumulate without being lost to rounding.أوزان FP التي يُحتفظ بها أثناء QAT حتى تتراكم تحديثات الـ gradient الصغيرة جدًا دون أن تضيع بسبب التقريب.
G
- Group quantization
Assigning scales to small groups of elements (finer than a channel) to balance accuracy against scale storage and hardware cost.إسناد قيم scale لمجموعات صغيرة من العناصر (أدق من القناة) لتحقيق التوازن بين الدقة من جهة وتكلفة تخزين الـ scale وتكلفة العتاد (hardware) من جهة أخرى.
H
- HAQ (Hardware-Aware Automated Quantization)
An actor-critic RL agent that picks per-layer bit widths using direct latency or energy feedback from the target accelerator.وكيل تعلّم معزّز (RL) من نوع actor-critic يختار عرض البتات لكل طبقة بالاعتماد على تغذية راجعة مباشرة عن زمن الاستجابة (latency) أو الطاقة من المسرّع (accelerator) المستهدف.
K
- K-means-based quantization
Weights are clustered and stored as integer cluster indices plus a floating-point codebook of centroids; computation stays floating point. QAT fine-tunes the centroids by summing gradients per cluster.تُجمَّع الأوزان في عناقيد (clusters) وتُخزَّن كفهارس عناقيد صحيحة مع codebook من المراكز (centroids) بأعداد عشرية؛ وتبقى الحسابات بأعداد عشرية. ويضبط QAT المراكز بجمع الـ gradients لكل عنقود.
- KL divergence
D_KL(P||Q) = sum P(x_i) log(P(x_i)/Q(x_i)); the information lost when the quantized distribution Q approximates P, minimized to choose the threshold (TensorRT).D_KL(P||Q) = sum P(x_i) log(P(x_i)/Q(x_i))؛ وهو مقدار المعلومات المفقودة عندما يقرّب التوزيع المكمَّم Q التوزيع P، ونقلله لاختيار العتبة (threshold) كما في TensorRT.
L
- Laplace optimal clipping
For Laplace(0, b) inputs, the MSE-optimal clip is 2.83b, 3.89b, 5.03b for 2, 3, 4 bits.للمدخلات التي تتبع توزيع Laplace(0, b)، يكون حد القص الأمثل حسب MSE هو 2.83b و 3.89b و 5.03b لـ 2 و 3 و 4 بت على الترتيب.
- Linear quantization
An affine map r = S(q - Z) from integer codes q to real values r, so weights are stored as integers and computation can use integer arithmetic.تحويل خطي (affine) r = S(q - Z) من الرموز الصحيحة q إلى القيم الحقيقية r، فتُخزَّن الأوزان كأعداد صحيحة ويمكن أن تتم الحسابات بعمليات حسابية على الأعداد الصحيحة (integer arithmetic).
M
- Memory bound vs compute bound
Depthwise convolution is limited by memory traffic, pointwise convolution by arithmetic, which drives different bit allocations on edge and cloud.الـ depthwise convolution محدودة بحركة البيانات من الذاكرة (memory bound)، والـ pointwise convolution محدودة بالحسابات (compute bound)، وهذا ما يؤدي إلى توزيع مختلف للبتات على الـ edge وعلى الـ cloud.
- Mixed-precision design space
With 8 x 8 = 64 weight/activation bit choices per layer, n layers give 64^n configurations.مع وجود 8 x 8 = 64 خيارًا لعدد بتات الأوزان والـ activations في كل طبقة، تعطي n طبقة عدد 64^n من التكوينات (configurations).
- Mixed-precision quantization
Choosing different weight and activation bit widths per layer instead of one uniform width.اختيار عرض بتات (bit width) مختلف للأوزان والـ activations في كل طبقة بدلًا من عرض واحد موحّد.
- MSE-optimal clipping
Choosing the clip |r|_max that minimizes the mean-square error between the input and its quantized version, trading clipping error against rounding error.اختيار حد القص |r|_max الذي يقلل متوسط مربع الخطأ (MSE) بين المدخل ونسخته المكمّمة، مع الموازنة بين خطأ القص (clipping error) وخطأ التقريب (rounding error).
- Multi-level scaling
Writing r = (q - z) * s_l0 * s_l1 * ... with cheap scales at fine levels and expensive scales at coarse levels.كتابة r = (q - z) * s_l0 * s_l1 * ... بحيث تكون قيم الـ scale رخيصة في المستويات الدقيقة (fine) ومكلفة في المستويات الخشنة (coarse).
O
- OCTAV
Optimal clipping via Newton-Raphson: since MSE is convex in the clipping scalar, it finds the MSE-optimal clip on the fly.قص أمثل باستخدام طريقة Newton-Raphson: بما أن الـ MSE دالة محدبة (convex) في قيمة القص، فإن OCTAV يجد حد القص الأمثل حسب MSE أثناء التشغيل (on the fly).
P
- Per-channel quantization
Each output channel gets its own scale S_i = |r|_max,i / q_max, lowering error when channels have very different ranges.كل قناة إخراج تحصل على scale خاص بها S_i = |r|_max,i / q_max، مما يقلل الخطأ عندما تكون نطاقات القنوات مختلفة جدًا.
- Per-tensor quantization
A single scale S for the entire weight tensor; works for large models but fails when channel ranges differ by more than about 100x.قيمة scale واحدة S لكامل tensor الأوزان؛ تنجح مع النماذج الكبيرة لكنها تفشل عندما تختلف نطاقات القنوات بأكثر من نحو 100x.
- Pointwise (1x1) convolution
A 1x1 convolution that mixes channels; it holds most of the weights and arithmetic, so it is compute bound and gets fewer bits on the cloud.التفاف 1x1 يمزج القنوات؛ يحتوي معظم الأوزان والعمليات الحسابية، لذا فهو compute bound ويحصل على بتات أقل على الـ cloud.
- Popcount
A bit operation that returns the number of 1 bits in a word.عملية على البتات تُرجع عدد البتات التي قيمتها 1 في الكلمة (word).
- Post-training quantization (PTQ)
Quantizing an already trained floating-point model by choosing scale and zero point without retraining, at most with short calibration or tuning.تكميم نموذج مدرّب مسبقًا بأعداد عشرية (floating-point) عن طريق اختيار الـ scale والـ zero point دون إعادة تدريب، وفي أقصى الأحوال مع معايرة (calibration) أو ضبط قصير.
Q
- Quantization granularity
How many elements share one scale factor: the whole tensor, one output channel, or a small group of elements.عدد العناصر التي تشترك في معامل scale واحد: إما الـ tensor كله، أو قناة إخراج (output channel) واحدة، أو مجموعة صغيرة من العناصر.
- Quantization-aware training (QAT)
Training or fine-tuning with quantization simulated in the forward pass so the network adapts and recovers accuracy.تدريب أو ضبط دقيق (fine-tuning) مع محاكاة التكميم في المرور الأمامي (forward pass) حتى تتكيّف الشبكة وتستعيد دقتها.
R
- Rectified sigmoid h(V)
The function in AdaRound mapping the learnable V into [0, 1] (the slide writes (0, 1)) to form the rounding offset, pushed to 0 or 1 by f_reg.الدالة في AdaRound التي تحوّل المتغير القابل للتعلّم V إلى المجال [0, 1] (تكتبه الشريحة (0, 1)) لتكوين إزاحة التقريب (rounding offset)، ويدفعها f_reg نحو 0 أو 1.
- Rounding to nearest
Rounding each weight independently to the closest level; not optimal because weights are correlated in the layer output.تقريب كل وزن بشكل مستقل إلى أقرب مستوى؛ وهذا ليس أمثل لأن الأوزان مترابطة في مخرج الطبقة (layer output).
S
- Shared micro-exponent (MX) data type
Formats such as MX4, MX6, MX9 where tiny exponents are shared by pairs of elements and an 8-bit exponent by groups of 16.صيغ مثل MX4 و MX6 و MX9 يتشارك فيها كل زوج من العناصر أُسًّا (exponent) صغيرًا جدًا، وتتشارك كل مجموعة من 16 عنصرًا أُسًّا من 8 بت.
- Simulated (fake) quantization
Quantizing then dequantizing values in floating point, W -> S_W q_W = Q(W), so the forward pass sees discrete values while ops run in full precision.تكميم القيم ثم إلغاء تكميمها (dequantize) بالأعداد العشرية، W -> S_W q_W = Q(W)، بحيث يرى المرور الأمامي قيمًا متقطعة (discrete) بينما تُنفَّذ العمليات بدقة كاملة (full precision).
- Stochastic binarization
q = +1 with probability sigma(r) = min(max((r+1)/2, 0), 1) (hard sigmoid), else -1; needs random bits in hardware.q = +1 باحتمال sigma(r) = min(max((r+1)/2, 0), 1) (وهي hard sigmoid)، وإلا -1؛ ويتطلب ذلك بتات عشوائية في العتاد (hardware).
- Straight-through estimator (STE)
Treating quantization as identity in the backward pass: g_W = dL/dW = dL/dQ(W), since the true derivative of rounding is zero almost everywhere.معاملة التكميم على أنه دالة هوية (identity) في المرور الخلفي (backward pass): g_W = dL/dW = dL/dQ(W)، لأن المشتقة الحقيقية للتقريب تساوي صفرًا في كل مكان تقريبًا.
- Symmetric quantization
Linear quantization with zero point Z = 0 and S = |r|_max / q_max where q_max = 2^(N-1) - 1.تكميم خطي يكون فيه الـ zero point هو Z = 0 و S = |r|_max / q_max حيث q_max = 2^(N-1) - 1.
T
- Ternary Weight Networks (TWN)
Weights in {-r_t, 0, r_t} with threshold Delta = 0.7 E(|r|) and r_t = mean of |r| above Delta.أوزان تنتمي إلى {-r_t, 0, r_t} مع عتبة Delta = 0.7 E(|r|)، و r_t هي متوسط |r| للقيم التي تتجاوز Delta.
- Trained Ternary Quantization (TTQ)
Ternary weights with two trainable scales, w_p for positive and w_n for negative values.أوزان ثلاثية (ternary) مع معاملي scale قابلين للتدريب: w_p للقيم الموجبة و w_n للقيم السالبة.
V
- VS-Quant (per-vector scaled quantization)
Two-level scaling r = gamma * S_q (q - Z) with a floating-point coarse scale gamma and an integer per-vector scale S_q.تحجيم على مستويين r = gamma * S_q (q - Z)، حيث gamma معامل scale خشن بأعداد عشرية (floating-point) و S_q معامل scale صحيح لكل متجه (per-vector).
X
- XNOR and popcount
With -1 encoded as 0, y = -n + 2 * popcount(W xnor x), computed as -n + (popcount << 1).عند ترميز -1 على أنه 0، يكون y = -n + 2 * popcount(W xnor x)، ويُحسب على شكل -n + (popcount << 1).
- XNOR-Net
Binarizes both weights and activations with scale factors and computes dot products with XNOR and popcount.يحوّل كلًا من الأوزان والـ activations إلى قيم ثنائية مع معاملات scale، ويحسب حاصل الضرب النقطي (dot product) باستخدام XNOR و popcount.
Z
- Zero point Z
The integer code that represents real 0 in r = S(q - Z); Z = 0 for symmetric quantization and nonzero for asymmetric quantization.الرمز الصحيح الذي يمثّل الصفر الحقيقي في r = S(q - Z)؛ تكون Z = 0 في التكميم المتماثل (symmetric)، وغير صفرية في التكميم غير المتماثل (asymmetric).