From e7871a29a151bd28794583c401837522b7a10bbd Mon Sep 17 00:00:00 2001 From: Mohamad Fazeli Date: Thu, 13 Aug 2026 17:12:50 +0330 Subject: [PATCH] Cut the throughput notes to measurements State the numbers and the cu126 requirement; drop the narration around them. --- README.fa.md | 11 +++++------ README.md | 11 +++++------ docs/MODELS.md | 11 ++++------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/README.fa.md b/README.fa.md index fb241d8..3243f7f 100644 --- a/README.fa.md +++ b/README.fa.md @@ -67,12 +67,11 @@ print(doc.ents) # (محمدرضا شجریان, مشهد) | `lg` | ۴٬۷۱۵ | ۹٬۲۱۵ | | | `trf` | ۱۸۷ | ۱٬۱۵۸ | ۸٬۳۲۰ | -ردهٔ `trf` روی یک پردازنده حدود ۲۹ برابر کندتر از `sm` است، و روی T4 نسبت به پردازندهٔ همان -ماشین (۳۳۶ واژه بر ثانیه) ۲۵ برابر سریع‌تر، پس کارت گرافیک برای آن یک نیاز است نه بهینه‌سازی. -حتی کارت ۲ گیگابایتی 940MX هم ۶٫۲ برابر سریع‌تر از پردازندهٔ همان دستگاه است و دستهٔ ۳۲ را بدون -کمبود حافظه اجرا می‌کند، اما به نسخهٔ `cu126` از torch نیاز دارد، چون هستهٔ sm_50 از نسخه‌های -`cu128`/`cu129` در ۲٫۸ حذف شده است. فاصلهٔ رده‌های پردازنده‌ای کمتر از ۱۵ درصد است، یعنی گلوگاه -جست‌وجوی tok2vec نیست بلکه تجزیه‌گر و واژه‌یاب است. پراکندگی اجراها روی لپ‌تاپ حدود ۱۰± درصد است. +ردهٔ `trf` روی یک پردازنده ۲۹ برابر کندتر از `sm` است. عددهای T4 و Xeon از یک ماشین Colab +می‌آیند، یعنی شتاب ۲۵ برابری. روی 940MX دستهٔ ۳۲ در ۲ گیگابایت جا می‌شود و torch باید نسخهٔ +`cu126` باشد، چون هستهٔ sm_50 از نسخه‌های `cu128`/`cu129` در torch 2.8 حذف شده است. فاصلهٔ +رده‌های پردازنده‌ای کمتر از ۱۵ درصد است، پس گلوگاه تجزیه‌گر و واژه‌یاب است نه جست‌وجوی tok2vec. +پراکندگی اجراها روی لپ‌تاپ حدود ۱۰± درصد است. گام‌های تبدیل پیکره، آموزش، ارزیابی و بسته‌بندی در [`project.yml`](project.yml) تعریف شده‌اند. توضیح بیشتر دربارهٔ گزینش پیکره و پروانه‌ها در [`docs/MODELS.md`](docs/MODELS.md) و شرح انگلیسی diff --git a/README.md b/README.md index d5eda7f..f3fa4ec 100644 --- a/README.md +++ b/README.md @@ -95,12 +95,11 @@ timing the pipe only, warmup discarded. Reproduce with | `lg` | 4,715 | 9,215 | | | `trf` | 187 | 1,158 | 8,320 | -`trf` runs 29x slower than `sm` on the same CPU, and 25x faster on a T4 than on that VM's own -Xeon (336 words/s), so a GPU is a requirement rather than an optimization. Even a 2 GB 940MX -gives 6.2x over its host CPU and fits batch 32 without running out of memory, though it needs -a `cu126` torch build: sm_50 kernels were dropped from the 2.8 `cu128`/`cu129` wheels. The CPU -tiers sit within 15% of each other, so the tok2vec lookup is not the bottleneck; the parser and -lemmatizer are. Laptop spread is about 10% with thermal state. +`trf` is 29x slower than `sm` on the same CPU. The T4 and Xeon figures come from one Colab VM, +a 25x GPU speedup. On the 940MX batch 32 fits in 2 GB, and torch must be a `cu126` build: +sm_50 kernels were dropped from the `cu128`/`cu129` wheels at torch 2.8. The CPU tiers sit +within 15% of each other, so the bottleneck is the parser and lemmatizer, not the tok2vec +lookup. Laptop spread is about 10% with thermal state. ## Named entity recognition diff --git a/docs/MODELS.md b/docs/MODELS.md index 8d35a55..fd68fe0 100644 --- a/docs/MODELS.md +++ b/docs/MODELS.md @@ -518,10 +518,7 @@ every number, so treat small differences as noise. `trf` is 29x slower than `sm` on the same CPU. The T4 and Xeon columns come from the same Colab VM, giving a clean 25x GPU speedup for the transformer. -The 940MX runs `trf` at 1,158 words/s, 6.2x its host CPU, and fits batch 32 inside 2 GB without -running out of memory, so the GPU note in §3.4 that dismissed this card for transformer work -holds only for training, not inference. It does need a `cu126` build of torch: Maxwell sm_50 -kernels were dropped from the `cu128` and `cu129` wheels starting torch 2.8, and `pip install -torch` now resolves to one of those. `.venv-trf-gpu` pins `torch==2.7.1+cu126` for this reason, -and is kept separate from `.venv` because torch's pinned `nvidia-*` wheels would downgrade the -CUDA libraries cupy runs on there from 12.9 to 12.6. +`trf` on the 940MX needs a `cu126` torch build. sm_50 kernels were dropped from the `cu128` and +`cu129` wheels at torch 2.8, which is what `pip install torch` resolves to. `.venv-trf-gpu` pins +`torch==2.7.1+cu126`, separate from `.venv` because torch's pinned `nvidia-*` wheels downgrade +the CUDA libraries cupy uses there from 12.9 to 12.6. Batch 32 fits in 2 GB.