التاليالدليل التالي
الذكاء الاصطناعي للجرعات الدقيقة والحركية الدوائية
التقنية
الدليل الفني
Mixed precision uses lower-precision arithmetic for selected operations while retaining precision where needed.
استمع إلى هذا الدليلرواه الذكاء الاصطناعي · ~2 min
It can reduce memory use and improve throughput on supported hardware, but gains and numerical effects depend on the model, workload, hardware and training recipe.
Traditional training stores weights and runs math in 32-bit floating point (FP32). Mixed precision uses lower-precision FP16 or bfloat16 for eligible operations while retaining FP32 where needed. Some FP16 recipes maintain a separate FP32 master copy to accumulate small weight updates; autocast workflows may instead keep model parameters in FP32 while casting selected operation inputs. Using 16-bit tensors can reduce memory used by eligible operations. Supported accelerators may execute some low-precision operations faster, but end-to-end throughput depends on hardware, workload and which operations autocast selects. FP16 has a narrower range, so tiny gradients can underflow. Loss scaling multiplies the loss before backpropagation and reverses that scale before the optimizer update; tools such as torch.amp.GradScaler can manage this process. Bfloat16 has a wider exponent range than FP16 and often does not need the same loss-scaling strategy, though model and hardware behavior still need testing.
يقوم Torch.cuda.amp.autocast الخاص بـ PyTorch بتغليف حلقة تدريب لخفض الذاكرة إلى النصف تقريبًا ومضاعفة الإنتاجية على وحدة معالجة الرسومات واحدة
تدريب نماذج لغوية كبيرة مثل محولات نمط GPT في bfloat16 على وحدات TPU لتجنب ضبط حجم الخسارة
تركيب حجم دفعة أكبر على وحدة معالجة الرسومات RTX للمستهلك عن طريق تحويل التدريب على صور ResNet من FP32 إلى FP16
دقة FP8 المختلطة على وحدات معالجة الرسوميات NVIDIA H100 لخفض تكلفة التدريب المسبق للنماذج الحدودية
الدقة تستمر في الانخفاض. أصبح تدريب FP8، المدعوم على وحدات معالجة الرسوميات NVIDIA Hopper وBlackwell، معيارًا قياسيًا للنماذج الحدودية، ويدفع البحث في FP4 وتنسيقات القياس الدقيق (MXFP) إلى أبعد من ذلك. توقع أن تقوم الأطر بتحديد الدقة تلقائيًا لكل طبقة، وأجهزة للتعامل بشكل أصلي مع التنسيقات الأضيق من أي وقت مضى، والتدريب المدرك للكمية لطمس الخط الفاصل بين التدريب منخفض الدقة والاستدلال، مما يقلل من تكلفة تدريب نماذج تريليون معلمة.
رسالة إخبارية مجانية
ثلاث قصص تم التحقق منها بواسطة الذكاء الاصطناعي كل صباح من أيام الأسبوع، مكتوبة باللغة الإنجليزية البسيطة. مجاني للأبد، بدون إعلانات.
بريد إلكتروني واحد كل يوم من أيام الأسبوع. إلغاء الاشتراك بنقرة واحدة. نحن لا نبيع أو نشارك عنوانك أبدًا.
اختبر نفسك
تعليقات فورية على كل إجابة، وشهادة قابلة للمشاركة مع معرف يمكن التحقق منه بمجرد اجتياز الدورة التدريبية.
دعم تعليم الذكاء الاصطناعي المجاني. AI Understanding هي منظمة 501(c)(3) غير ربحية - لا إعلانات ولا نظام حظر الاشتراك غير المدفوع على الإطلاق. قم بالتبرع
Mixed precision uses lower-precision arithmetic for selected operations while retaining precision where needed. It can reduce memory use and improve throughput on supported hardware, but gains and numerical effects depend on the model, workload, hardware and training recipe.
Some FP16 recipes keep an FP32 master weight so small optimizer updates are not lost to low-precision rounding; not every mixed-precision recipe uses a separate copy.
يتمتع FP16 بنطاق ديناميكي محدود، لذا يمكن تقريب التدرجات الصغيرة إلى الصفر؛ مضاعفة الخسارة قبل الدعامة الخلفية يبقيها قابلة للتمثيل.
يحتفظ Bfloat16 بـ 8 بتات أسية مثل FP32، لذا فإن نطاقه الديناميكي كبير والتدفق السفلي المتدرج نادر.
Many common Tensor Core operations accumulate in FP32 to reduce rounding error; this does not make the computation exact.
Lower precision can reduce memory and speed supported operations, but total results depend on the model, hardware, and kernels used.
استمر في التعلم
تم اختيار المزيد من الأدلة لهذا الموضوع
التاليالدليل التالي
الذكاء الاصطناعي للجرعات الدقيقة والحركية الدوائية
التقنية