HeadlinesBriefing favicon HeadlinesBriefing.com

vLLM speculative decoding

Hacker News •
×

TL; DR: speculative decoding বাড়ি vLLM একে target-model passে multiple drafted tokens verify করতে সক্ষম করে। আমাদের পরীক্ষায়, এর output-token throughput drafting methods এবং proposal lengths অনুযায়ী পরিবর্তিত হয়েছে, এবং model family, draft checkpoint, workload, এবং acceptance behavior অনুযায়ী নির্ভরশীল হয়েছে।

পরিচয়: Large language models বড় সীমাবদ্ধতায় বিভিন্ন অ্যাপ্লিকেশন সমর্থন করে, কিন্তু স্কেলে সার্ভicing করার জন্য careful optimization প্রয়োজন। Standard autoregressive decoding বয়ে meisten LLM serving systems দ্বারা ব্যবহৃত বেসলাইন। মডেল এক Tokens জেনেয়ে, সে sequence-তে অ্যাপেন্ড করে, তারপর আপডেটেড sequence ব্যবহার করে পরবর্তী Tokens জেনেয়ে। এই প্রক্রিয়া সহজ ও নির্ভরযোগ্য, কিন্তু serving loop এখনও একক committed token অগ্রসর করছে কারণ output tokens strict left-to-right orderে প্রroduce করতে হয়।

Speculative decoding [1] এই baseline-তে draft-and-verify mechanism যোগ করে। একটি lightweight draft component candidate future tokens propose করে, এবং target model unhe verify করে আগে unhe commit না করা হয়। একাধিক draft tokens accepted হলে, system একে single target-model verification step থেকে multiple output tokens commit করতে পারে target model output behavior preserve রেখে।

এই পোস্টে আমরা explore করি vLLM-তে speculative decoding কীভাবে কাজ করে এবং আমাদের test environment থেকে measurements। আমরা প্রথমে autoregressive decoding baseline এবং draft-and-verify process রিভিউ করব। তারপরে আমরা পাঁচ speculative-drafting approaches: native MTP, Gemma 4 MTP, EAGLE-3, DFlash, এবং DSpark পরীক্ষা করব। এই methods target model থেকে draft component কীভাবে তথ্য পায় এবং candidate tokens কীভাবে sequential, autoregressive, parallel, বা hybrid approach থেকে generate হয়, এতে পার্থক্য করে। শেষে, আমরা আমাদের environment-তে methods কীভাবে enable করব, আমাদের experiment থেকে measurements riport করব AMD Instinct↓ MI300X এবং MI355X GPU-তে ROCm↓ open software platform ব্যবহার করে, এবং practical tuning এবং observability considerations আলোচনা করব।

autoregressive decoding baseline: Standard autoregressive decoding-তে, decode step-তে একটি নতুন token produce ও commit করে। উদাহরণস্বরূপ, চার output Tokens জেনেয়ে নেয়ার জন্য চার সিকোয়েনশাল decode steps প্রয়োজন: Step 1:context→model→T1 Step 2:context + T1→model→T2 Step 3:context + T1 T2→model→T3 Step 4:context + T1 T2 T3→model→T4 প্রতিটি stepsের পর, generated token sequence-তে অ্যাপেন্ড হয় এবং পরবর্তী step-তে input বান হয়। এই decoding loop সহজ, কিন্তু প্রতিটি output token জন্য model decode step জরুরি। দীর্ঘ generations-তে, এই token-by-token loop latencity dominate করতে পারে এবং serving throughput_limit করতে পারে।

Key question behind speculative decoding-তে, kya hum original model output behavior preserve করতে পারি, sirf ek token baar mein generation advance করার frequency কম করতে পারি? Speculative decoding ye address করে proposal এবং verification আলাদা করে। একে draft component pehle candidate future tokens propose করে। Original model, target model বানিয়ে, এর পর unhe verify করে আগে unhe commit না করা হয়।

Speculative decoding ka core idea: Speculative decoding original model replace না করে। বরং, original model target model রেখে care করে final output-র জন্য, এবং faster proposal stage add করে। Is process-তে দুটি parts হয়: Draft: candidate future tokens propose. Verify: target model candidate check করে।

Har ek speculative decoding round-তে, Figure 1-তে যেমন, lightweight draft component future tokens propose করে। Ye tokens sirf candidates, unhe immediately commit না করা হয়। Target model phir ek verification pass-তে candidate token sequence evaluate করে। Verification left to right proceed করে। Har draft token use target model ke corresponding position-তে result-se check করে। Accepted tokens output sequence-তে commit কiye জায়। jab koi draft token reject হয়, baad ke candidates...