روی یک لپتاپ با کارت گرافیک ۴ گیگابایتی، همان فایل مدل را 2.0 برابر سریعتر از llama.cpp بهتنهایی اجرا کرد، و در ویرایش کد — که جواب تکرار متنی است که مدل دیده — 3.7 برابر. بدون مدل دوم و بدون کوانت دیگر؛ فقط با جای درست هر تکه.On a laptop with a 4 GB graphics card it ran the same model file 2.0× as fast as llama.cpp on its own, and 3.7× on code edits, where the answer repeats what the model was shown. No second model, no other quantisation: each piece in the right place.
یک فایل مدل، یک کامپیوتر. ارتفاع ستونها در هر سه نمودار با یک مقیاس است: ۱۲ توکن در ثانیه یعنی تمام ستون.One model file, one computer. The columns share one scale on all three charts: 12 tokens a second is a full column.
نیمبوس ۲ ایپکس در سرویس آنلاین روی یک کارت T4 اجرا میشود و کل مدل روی کارت جا میشود؛ آنچه میماند، روش حدس جلوتر است. حدس با مدل کوچک ۰٫۶ میلیاردی بهتنهایی، در بخش استدلال — بیشتر توکنهای ایپکس — مدل را از حالت بدون حدس هم کندتر میکرد: 13.3 در برابر ۳۲٫۶. PML-sRUN 0.3.1 مدل کوچک و حدس n-gram را با هم به کار میبرد: استدلال 38.4 و ویرایش 51.2 توکن در ثانیه.Nimbus 2 Apex runs online on a T4, and the whole model fits on the card; what is left to choose is how tokens are guessed ahead. The 0.6B draft model alone made reasoning -- most of Apex's tokens -- slower than no guessing at all: 13.3 against 32.6. PML-sRUN 0.3.1 uses the draft and n-gram drafts together: reasoning at 38.4 and edits at 51.2 tokens a second.
| حدس جلوترGuessing ahead | استدلالreasoning | کدcode | ویرایشedit | فارسیPersian |
|---|---|---|---|---|
| draft 0.6B (the engine before 0.3.1) | 13.3 | 44.2 | 45.2 | 32.5 |
| no guessing | 32.6 | 32.7 | 32.4 | 32.5 |
| n-gram drafts | 32.5 | 32.4 | 42.2 | 33.3 |
| draft 0.6B + n-gram (PML-sRUN 0.3.1) | 38.4 | 43.4 | 51.2 | 32.0 |
PML-sRUN فایل مدل و کامپیوتر را میخواند و مدل را به همان تکههایی میبُرد که llama.cpp میتواند جابهجا کند: هر لایه، کارشناسهای مدلهای MoE، جاسازیها و خروجی. برای نوشتن هر توکن، هر تکه یک بار خوانده میشود؛ پس زمان، جمع «حجم ÷ سرعت» در جایی است که تکهها نشستهاند: حافظهی کارت بیش از ۱۰۰ گیگابایت در ثانیه، رم حدود ۲۰، دیسک ۰٫۵ تا ۵.PML-sRUN reads the model's file and the computer, and cuts the model into the pieces llama.cpp can place: each layer, a MoE model's experts, the embeddings and the output. Writing one token reads each piece once, so the time is the sum of size ÷ speed where the pieces sit: the card's memory at 100+ GB/s, the computer's at about 20, a disk at 0.5 to 5.
حافظهی آزاد واقعی کارت، منهای حافظهی گفتگو (q8_0) و ۶۰۰ مگابایت برای کار خود کارت؛ بعد لایهها از آخر به اول.The card's real free memory, less the chat's cache (q8_0) and 600 MB for the card's own work; then layers from the last one back.
حدس n-gram توکنهای بعدی را از متن قبلی حدس میزند و مدل همه را یکجا بررسی میکند.n-gram drafts guess the next tokens from the text so far, and the model checks them in one pass.
به تعداد هستههای واقعی؛ کارت از روی نامش، نه گرافیک مجتمع (در مک، گرافیک اپل).As many as the real cores; the card by its name, never an integrated GPU by mistake (on a Mac, Apple's own).
طرح و همسایههایش روی همان کامپیوتر اجرا میشوند و سریعترین کنار مدل نگه داشته میشود.The plan and its neighbours run on the computer itself, and the fastest is kept beside the model.
| کارت گرافیکGraphics card | NVIDIA GeForce GTX 1050 Ti · 3.54 GB free |
| پردازنده و رمProcessor and memory | Core i7-7700HQ · 4 cores · 15.9 GB |
| مدلModel | Qwen2.5-Coder-7B-Instruct · Q3_K_M · 3.6 GB · 28 layers |
| طول گفتگوContext | 16384 tokens |
| موتورEngine | llama.cpp b10991 · Vulkan |
هر چیدمان دو بار، به نوبت با بقیه، اندازه گرفته شد و بهترینِ دو بار ماند؛ طول جواب ثابت است. لپتاپ در همان زمان کارهای دیگری هم میکرد؛ تفاوتهای کمتر از حدود ۱۵٪ را با احتیاط بخوانید.Each arrangement ran twice, in turn with the others, and the better run was kept; answers have a fixed length. The laptop was doing other work meanwhile: read differences under about 15% with care.
توکن در ثانیه؛ «خواندن» سرعت خواندن پیام بلند است و «بار» ثانیههای بالا آمدن.Tokens a second; “read” is how fast the long prompt is read, “load” the seconds to start.
| چیدمانArrangement | کوتاهshort | ویرایشedit | عمیقdeep | خواندنread | بارload | نسبت به llama.cppvs llama.cpp |
|---|---|---|---|---|---|---|
plan در PML-sRUN 0.3in PML-sRUN 0.3طرح PML-sRUN 0.3: ۲۴ لایه روی کارت و حدس n-gramPML-sRUN 0.3's plan: 24 layers on the card, n-gram drafts | 7.42 | 10.18 | 7.46 | 87.2 | 7 | +104% |
layers 24 ۲۴ لایه روی کارت، بدون حدس24 layers on the card, no drafts | 7.42 | 7.40 | 6.55 | 88.1 | 15 | +104% |
layers 24 + spec ngram-simple ۲۴ لایه + حدس n-gram ساده24 layers + simple n-gram drafts | 7.30 | 10.94 | 6.96 | 87.2 | 9 | +101% |
layers 24 + spec ngram-mod ۲۴ لایه + حدس n-gram mod24 layers + n-gram mod drafts | 6.55 | 9.11 | 6.83 | 87.1 | 11 | +80% |
layers 24 + ubatch 256 + poll 0 ۲۴ لایه + دستهی ۲۵۶ + poll 024 layers + ubatch 256 + poll 0 | 6.51 | 6.51 | 5.71 | 82.7 | 11 | +79% |
plan 0.2 طرح PML-sRUN 0.2: ۲۱ لایه، حاشیهی ۹۰۰ مگابایتPML-sRUN 0.2's plan: 21 layers, a 900 MB margin | 6.48 | 4.39 | 4.93 | 83.9 | 19 | +78% |
cache in memory, layers 26 حافظهی گفتگو در رم، ۲۶ لایه روی کارتthe chat's cache in memory, 26 layers on the card | 5.52 | 3.18 | 2.61 | 75.9 | 15 | +52% |
spec ngram-mod ۲۱ لایه + حدس n-gram mod21 layers + n-gram mod drafts | 5.38 | 7.48 | 5.30 | 84.0 | 11 | +48% |
spec ngram-simple ۲۱ لایه + حدس n-gram ساده21 layers + simple n-gram drafts | 5.35 | 9.07 | 5.73 | 84.6 | 11 | +47% |
poll 0 پردازنده در انتظار نمیچرخدthe processor does not spin while waiting | 5.24 | 5.27 | 4.59 | 84.9 | 13 | +44% |
ubatch 256 دستههای کوچکتر در خواندن پیامsmaller batches reading the prompt | 5.18 | 5.27 | 4.25 | 77.3 | 11 | +43% |
cache q4_0, layers 24 حافظهی گفتگوی فشردهتر (q4_0)، ۲۴ لایهa smaller cache (q4_0), 24 layers | 4.98 | 4.92 | 1.46 | 65.9 | 15 | +37% |
ollama Ollama 0.40.5 با همان فایل، روی کارت انویدیاOllama 0.40.5, the same file, on the NVIDIA card | 4.95 | 3.87 | — | 77.0 | 18 | +36% |
threads 3 ۳ رشته بهجای ۴3 threads instead of 4 | 4.77 | 4.42 | 2.88 | 82.6 | 13 | +31% |
spec ngram-cache ۲۱ لایه + حافظهی n-gram21 layers + an n-gram cache | 4.73 | 3.38 | 3.09 | 80.8 | 13 | +30% |
cache f16 حافظهی گفتگو بدون فشردهسازی (f16)an uncompressed cache (f16) | 4.49 | 2.73 | 2.87 | 81.9 | 11 | +24% |
threads 8 ۸ رشته (هایپرتردینگ)8 threads (hyper-threads) | 4.12 | 3.33 | 4.06 | 78.8 | 11 | +13% |
layers 23 ۲۳ لایه روی کارت23 layers on the card | 4.10 | 4.99 | 4.37 | 85.9 | 13 | +13% |
llama.cpp alone llama.cpp بدون تنظیم؛ خودش تصمیم میگیرد چه مقدار روی کارت برودllama.cpp left to itself: it decides how much goes on the card | 3.63 | 2.79 | 2.26 | 78.3 | 15 | +0% |
tensors, cache q4_0 | درایور Vulkan این کارت با تقسیم تنسوری از کار افتادthis card's Vulkan driver lost the device with tensor-level placement |
layers 25 | حافظهی کارت تمام شدthe card ran out of memory |
layers 26 | حافظهی کارت تمام شدthe card ran out of memory |
cache q4_0, layers 26 | حافظهی کارت تمام شدthe card ran out of memory |
cache in memory, layers 28 | حافظهی کارت تمام شدthe card ran out of memory |
flash attention off (cache f16) | بدون Flash Attention در این طول گفتگو جا نشدwithout flash attention it did not fit at this context |
۲۱ لایه 6.48 و ۲۴ لایه 7.42 توکن در ثانیه. ۲۴ لایه با ۶۰۵ مگابایت جای خالی بالا آمد و ۲۵ لایه با ۴۹۹ مگابایت نه؛ حاشیهی ۹۰۰ مگابایتی نسخهی قبل سه لایه را بیدلیل بیرون نگه میداشت.21 layers wrote 6.48 and 24 layers 7.42 tokens a second. 24 started with 605 MB left and 25 did not with 499; the old 900 MB margin kept three layers off the card for nothing.
با همان ۲۴ لایه، ویرایش از 7.40 به 10.18 توکن در ثانیه رسید؛ جوابهای کوتاه تقریباً همان ماند.With the same 24 layers an edit went from 7.40 to 10.18 tokens a second; short answers stayed about the same.
دو لایه بیشتر روی کارت جا میشود، ولی در عمق گفتگوی بلند نوشتن به 2.61 افت کرد.Two more layers fit on the card, but deep in a long chat writing fell to 2.61.
در حالت پیشفرض گرافیک اینتل را انتخاب کرد و از کار افتاد؛ حالت CUDA هنگام شناسایی کارت از کار افتاد. فقط با محدود کردن Vulkan به کارت انویدیا اجرا شد: ۱۵ لایه از ۲۹.By default it chose the Intel GPU and crashed; its CUDA mode crashed finding the card. Only with Vulkan limited to the NVIDIA card did it run: 15 layers of 29.
فرستادن حتی یک تنسور به پردازنده درایور Vulkan این کارت را از کار انداخت؛ PML-sRUN لایههای کامل را جابهجا میکند که همهجا کار میکند.Sending even one tensor to the processor lost this card's Vulkan device; PML-sRUN moves whole layers, which works everywhere.
PML-sRUN با مجوز MIT منتشر شده است: یک پنل ساده در مرورگر، یا خط فرمان. فقط پایتون ۳٫۱۰ لازم است؛ موتور llama.cpp را خودش دریافت میکند.PML-sRUN is out under the MIT license: a simple panel in the browser, or the command line. It needs only Python 3.10; it fetches llama.cpp itself.
git clone https://github.com/mmdop/pml-srun.git cd pml-srun python panel.py