Cut the throughput notes to measurements

State the numbers and the cu126 requirement; drop the narration around them.
This commit is contained in:
Mohamad Fazeli 2026-08-13 17:12:50 +03:30
parent 4135142e72
commit e7871a29a1
Signed by: fazel
GPG Key ID: 05E227BF4D6736DE
3 changed files with 14 additions and 19 deletions

View File

@ -67,12 +67,11 @@ print(doc.ents) # (محمدرضا شجریان, مشهد)
| `lg` | ۴٬۷۱۵ | ۹٬۲۱۵ | | | `lg` | ۴٬۷۱۵ | ۹٬۲۱۵ | |
| `trf` | ۱۸۷ | ۱٬۱۵۸ | ۸٬۳۲۰ | | `trf` | ۱۸۷ | ۱٬۱۵۸ | ۸٬۳۲۰ |
ردهٔ `trf` روی یک پردازنده حدود ۲۹ برابر کندتر از `sm` است، و روی T4 نسبت به پردازندهٔ همان ردهٔ `trf` روی یک پردازنده ۲۹ برابر کندتر از `sm` است. عددهای T4 و Xeon از یک ماشین Colab
ماشین (۳۳۶ واژه بر ثانیه) ۲۵ برابر سریع‌تر، پس کارت گرافیک برای آن یک نیاز است نه بهینه‌سازی. می‌آیند، یعنی شتاب ۲۵ برابری. روی 940MX دستهٔ ۳۲ در ۲ گیگابایت جا می‌شود و torch باید نسخهٔ
حتی کارت ۲ گیگابایتی 940MX هم ۶٫۲ برابر سریع‌تر از پردازندهٔ همان دستگاه است و دستهٔ ۳۲ را بدون `cu126` باشد، چون هستهٔ sm_50 از نسخه‌های `cu128`/`cu129` در torch 2.8 حذف شده است. فاصلهٔ
کمبود حافظه اجرا می‌کند، اما به نسخهٔ `cu126` از torch نیاز دارد، چون هستهٔ sm_50 از نسخه‌های رده‌های پردازنده‌ای کمتر از ۱۵ درصد است، پس گلوگاه تجزیه‌گر و واژه‌یاب است نه جست‌وجوی tok2vec.
`cu128`/`cu129` در ۲٫۸ حذف شده است. فاصلهٔ رده‌های پردازنده‌ای کمتر از ۱۵ درصد است، یعنی گلوگاه پراکندگی اجراها روی لپ‌تاپ حدود ۱۰± درصد است.
جست‌وجوی tok2vec نیست بلکه تجزیه‌گر و واژه‌یاب است. پراکندگی اجراها روی لپ‌تاپ حدود ۱۰± درصد است.
گام‌های تبدیل پیکره، آموزش، ارزیابی و بسته‌بندی در [`project.yml`](project.yml) تعریف شده‌اند. گام‌های تبدیل پیکره، آموزش، ارزیابی و بسته‌بندی در [`project.yml`](project.yml) تعریف شده‌اند.
توضیح بیشتر دربارهٔ گزینش پیکره و پروانه‌ها در [`docs/MODELS.md`](docs/MODELS.md) و شرح انگلیسی توضیح بیشتر دربارهٔ گزینش پیکره و پروانه‌ها در [`docs/MODELS.md`](docs/MODELS.md) و شرح انگلیسی

View File

@ -95,12 +95,11 @@ timing the pipe only, warmup discarded. Reproduce with
| `lg` | 4,715 | 9,215 | | | `lg` | 4,715 | 9,215 | |
| `trf` | 187 | 1,158 | 8,320 | | `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 `trf` is 29x slower than `sm` on the same CPU. The T4 and Xeon figures come from one Colab VM,
Xeon (336 words/s), so a GPU is a requirement rather than an optimization. Even a 2 GB 940MX a 25x GPU speedup. On the 940MX batch 32 fits in 2 GB, and torch must be a `cu126` build:
gives 6.2x over its host CPU and fits batch 32 without running out of memory, though it needs sm_50 kernels were dropped from the `cu128`/`cu129` wheels at torch 2.8. The CPU tiers sit
a `cu126` torch build: sm_50 kernels were dropped from the 2.8 `cu128`/`cu129` wheels. The CPU within 15% of each other, so the bottleneck is the parser and lemmatizer, not the tok2vec
tiers sit within 15% of each other, so the tok2vec lookup is not the bottleneck; the parser and lookup. Laptop spread is about 10% with thermal state.
lemmatizer are. Laptop spread is about 10% with thermal state.
## Named entity recognition ## Named entity recognition

View File

@ -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 `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. 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 `trf` on the 940MX needs a `cu126` torch build. sm_50 kernels were dropped from the `cu128` and
running out of memory, so the GPU note in §3.4 that dismissed this card for transformer work `cu129` wheels at torch 2.8, which is what `pip install torch` resolves to. `.venv-trf-gpu` pins
holds only for training, not inference. It does need a `cu126` build of torch: Maxwell sm_50 `torch==2.7.1+cu126`, separate from `.venv` because torch's pinned `nvidia-*` wheels downgrade
kernels were dropped from the `cu128` and `cu129` wheels starting torch 2.8, and `pip install the CUDA libraries cupy uses there from 12.9 to 12.6. Batch 32 fits in 2 GB.
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.