تعمل نماذج اللغة الكبيرة (LLMs) على تغيير التطبيقات المختلفة بسرعة، لكن متطلباتها الحسابية الكبيرة تمثل تحديًا لنشرها على الأجهزة الطرفية ذات الموارد المحدودة مثل الهواتف الذكية والروبوتات. تسلط هذه المدونة من أبحاث Microsoft الضوء على التطورات في تقنيات التكميم منخفضة البت التي تعالج هذه المشكلة، مما يتيح التشغيل الفعال لـ LLM على الأجهزة الطرفية. يقدم الباحثون مناهج مبتكرة لضرب المصفوفات الدقيقة المختلطة (mpGEMM) وهياكل الأجهزة، مما يمهد الطريق لعصر جديد من إمكانية الوصول إلى الذكاء الاصطناعي.
تحدي نماذج اللغة الكبيرة على الأجهزة الطرفية
يكمن العائق الرئيسي في نشر نماذج اللغة الكبيرة على الأجهزة الطرفية في حجمها الهائل وما ينتج عن ذلك من طلب على ذاكرة كبيرة وقدرة حسابية. يوفر التكميم منخفض البت حلاً عن طريق ضغط النماذج وتقليل مساحة الذاكرة، لكن قيود الأجهزة التقليدية تعيق التحقيق الكامل في حسابات الدقة المختلطة.
- تتطلب نماذج اللغة الكبيرة مئات الملايين من المعلمات، مما يؤدي إلى ارتفاع الطلب على الذاكرة والحساب.
- تفتقر الأجهزة الطرفية غالبًا إلى الموارد اللازمة لتشغيل هذه النماذج بكفاءة.
- تدعم معظم الأجهزة الحسابات المتماثلة فقط، مما يعيق استخدام mpGEMM.
Ladder: سد فجوة أنواع البيانات
Ladder هو مترجم لأنواع البيانات مصمم لسد الفجوة بين تنسيقات البيانات المخصصة وقيود الأجهزة. من خلال تمكين فصل تخزين البيانات عن الحساب، يسمح Ladder بدعم أوسع لأنواع البيانات المخصصة دون الحاجة إلى تعديلات في الأجهزة.
- يقوم Ladder بتحويل أنواع البيانات غير المدعومة إلى أنواع متوافقة مع الأجهزة دون فقدان البيانات.
- إنه يحسن الأداء عن طريق ترجمة البيانات منخفضة البت إلى أكثر التنسيقات كفاءة للأجهزة المستهدفة.
- تظهر التقييمات على وحدات معالجة الرسوميات NVIDIA وAMD تسريعًا يصل إلى 14.6 مرة مقارنة بمترجمات DNN الحالية.
T-MAC: mpGEMM خالٍ من الضرب
T-MAC (بحث جدول لـ mpGEMM) هو نهج جديد يلغي الحاجة إلى إلغاء التكميم والضرب، مما يتيح mpGEMM فعالاً على الأجهزة الطرفية ذات الموارد المحدودة. إنه يستبدل عمليات الضرب التقليدية بعمليات بحث جدولية على مستوى البت، مما يقلل من الحمل الحسابي.
- يستبدل T-MAC الضرب بعمليات بحث جدولية على مستوى البت، مما يقلل من الطلب الحسابي.
- إنه يحقق مكاسب كبيرة في الأداء على الأجهزة الطرفية مثل Surface Laptop 7 و Raspberry Pi 5.
- أظهر الاختبار 48 رمزًا في الثانية لنموذج 3B BitNet-b1.58 على Surface Laptop 7.
LUT Tensor Core: أجهزة لـ mpGEMM فعال
LUT Tensor Core هو تصميم مشترك للبرامج والأجهزة مصمم خصيصًا لاستنتاج LLM منخفض البت. يعالج الحمل المرتبط بطرق LUT التقليدية ويدعم مستويات دقة مختلفة في mpGEMM. هذا يسمح بسرعة وكفاءة أكبر في تطبيقات الأجهزة الطرفية.
- إنه يحسن حساب الجدول المسبق والتخزين من خلال تقنيات مثل تحويل DFG القائم على البرامج ودمج المشغل.
- يتميز تصميم الأجهزة بشكل تجانب مطول لتعزيز إعادة استخدام الجدول وتصميم تسلسلي للبت لمجموعات دقة مختلفة.
- تُظهر الاختبارات أن LUT Tensor Core يحقق 6.93 ضعف سرعة الاستدلال باستخدام 38.3٪ فقط من مساحة Tensor Core التقليدي.
مستقبل الذكاء الاصطناعي المجسد
إن التطورات في التكميم منخفض البت لا تحسن الكفاءة فحسب، بل تتيح أيضًا توسيع نطاق النموذج، مما يعزز قدرات النموذج والتعبير. تمهد هذه التقنيات الطريق لأنظمة الذكاء الاصطناعي المجسدة، مثل الروبوتات، القادرة على الإدراك الديناميكي والتفاعل البيئي في الوقت الفعلي.
- يقلل التكميم منخفض البت من الطلب على الذاكرة والحساب، مما يجعل نماذج اللغة الكبيرة أكثر سهولة.
- تدعم تقنيات مثل T-MAC و Ladder و LUT Tensor Core التشغيل الفعال على الأجهزة الطرفية.
- يمكن لأنظمة الذكاء الاصطناعي المجسدة الاستفادة من هذه التطورات للإدراك الديناميكي والتفاعل في الوقت الفعلي.
في الختام، تمثل ابتكارات أبحاث Microsoft في التكميم منخفض البت خطوة مهمة نحو تمكين نماذج اللغة الكبيرة على الأجهزة الطرفية. من خلال التغلب على قيود الأجهزة وتطوير طرق حساب فعالة، تفتح هذه التطورات إمكانيات جديدة لتطبيقات الذكاء الاصطناعي عبر مجموعة واسعة من السيناريوهات، من الهواتف الذكية إلى الروبوتات. إن توافر T-MAC و Ladder مفتوح المصدر يشجع أيضًا على الاستكشاف والابتكار في هذا المجال سريع التطور.
المصدر: Microsoft Research
Large language models (LLMs) are rapidly transforming various applications, but their substantial computational requirements pose a challenge for deployment on resource-constrained edge devices like smartphones and robots. This blog post from Microsoft Research highlights advancements in low-bit quantization techniques that address this issue, enabling efficient LLM operation on edge devices. The researchers introduce innovative approaches to mixed-precision matrix multiplication (mpGEMM) and hardware architectures, paving the way for a new era of AI accessibility.
The Challenge of LLMs on Edge Devices
The primary hurdle in deploying LLMs on edge devices lies in their massive size and the resulting demand for significant memory and computational power. Low-bit quantization offers a solution by compressing models and reducing memory footprint, but traditional hardware limitations impede the full realization of mixed-precision calculations.
- LLMs require hundreds of millions of parameters, leading to high memory and computational demands.
- Edge devices often lack the necessary resources to efficiently run these models.
- Most hardware supports only symmetric computations, hindering the use of mpGEMM.
Ladder: Bridging the Data Type Gap
Ladder is a data type compiler designed to bridge the gap between custom data formats and hardware limitations. By enabling data storage to be separated from computation, Ladder allows for broader support of custom data types without requiring hardware modifications.
- Ladder converts unsupported data types into hardware-compatible ones without data loss.
- It optimizes performance by translating low-bit data into the most efficient formats for the target hardware.
- Evaluations on NVIDIA and AMD GPUs demonstrate speedups of up to 14.6 times compared to existing DNN compilers.
T-MAC: Multiplication-Free mpGEMM
T-MAC (Table-lookup for mpGEMM) is a novel approach that eliminates the need for dequantization and multiplication, enabling efficient mpGEMM on resource-constrained edge devices. It replaces traditional multiplication operations with bit-wise table lookups, reducing computational overhead.
- T-MAC replaces multiplication with bit-wise table lookups, reducing computational demands.
- It achieves significant performance gains on edge devices like the Surface Laptop 7 and Raspberry Pi 5.
- Testing demonstrated 48 tokens per second for the 3B BitNet-b1.58 model on a Surface Laptop 7.
LUT Tensor Core: Hardware for Efficient mpGEMM
LUT Tensor Core is a software-hardware co-design tailored for low-bit LLM inference. It addresses the overhead associated with traditional LUT-based methods and supports various precision levels in mpGEMM. This allows for greater speed and efficiency in edge device applications.
- It optimizes table precomputation and storage through techniques like software-based DFG transformation and operator fusion.
- The hardware design features an elongated tiling shape to promote table reuse and a bit-serial design for various precision combinations.
- Testing shows that LUT Tensor Core achieves 6.93 times the inference speed using only 38.3% of the area of a traditional Tensor Core.
The Future of Embodied AI
The advancements in low-bit quantization not only improve efficiency but also enable model scaling, which enhances model capabilities and expressiveness. These technologies pave the way for embodied AI systems, such as robots, capable of dynamic perception and real-time environmental interaction.
- Low-bit quantization reduces memory and computational demands, making LLMs more accessible.
- Technologies like T-MAC, Ladder, and LUT Tensor Core support efficient operation on edge devices.
- Embodied AI systems could leverage these advancements for dynamic perception and real-time interaction.
In conclusion, Microsoft Research’s innovations in low-bit quantization represent a significant step toward enabling LLMs on edge devices. By overcoming hardware limitations and developing efficient computation methods, these advancements unlock new possibilities for AI applications across a wide range of scenarios, from smartphones to robots. The open-source availability of T-MAC and Ladder further encourages exploration and innovation in this rapidly evolving field.
Source: Microsoft Research
جاري تحميل التعليقات...