Files
2026-10-20 22:20:35 +03:30

513 lines
19 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>مستند فنی راه‌اندازی و بهینه‌سازی مدل Qwen3.5-9B (نسخه چندوجهی)</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');
:root {
--primary: #1a365d;
--primary-light: #2c5282;
--accent: #c9a961;
--accent-dark: #a8893f;
--bg: #faf9f6;
--card-bg: #ffffff;
--text: #1a202c;
--text-muted: #4a5568;
--border: #e2e8f0;
--success: #38a169;
--danger: #e53e3e;
--warning: #dd6b20;
--shadow: 0 4px 6px rgba(0,0,0,0.05), 0 10px 30px rgba(26,54,93,0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Vazirmatn', Tahoma, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.9;
font-size: 15px;
padding: 30px 15px;
}
.document-container {
max-width: 950px;
margin: 0 auto;
background: var(--card-bg);
box-shadow: var(--shadow);
border-radius: 12px;
overflow: hidden;
}
.document-header {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
color: white;
padding: 50px 40px 40px;
position: relative;
border-bottom: 4px solid var(--accent);
}
.document-header::before {
content: '';
position: absolute;
top: 0; right: 0;
width: 200px; height: 200px;
background: radial-gradient(circle, rgba(201,169,97,0.15) 0%, transparent 70%);
border-radius: 50%;
transform: translate(50%, -50%);
}
.header-top {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
position: relative;
z-index: 1;
}
.company-badge {
display: flex;
align-items: center;
gap: 12px;
}
.company-logo {
width: 60px; height: 60px;
background: var(--accent);
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: 800;
font-size: 10px;
text-align: center;
line-height: 1.2;
}
.doc-meta {
text-align: left;
font-size: 12px;
opacity: 0.9;
}
.doc-meta div { margin-bottom: 3px; }
.document-title {
text-align: center;
position: relative;
z-index: 1;
padding: 20px 0;
}
.document-title .label {
display: inline-block;
background: rgba(201,169,97,0.2);
color: var(--accent);
padding: 4px 16px;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
margin-bottom: 15px;
border: 1px solid rgba(201,169,97,0.4);
}
.document-title h1 {
font-size: 26px;
font-weight: 800;
margin-bottom: 10px;
letter-spacing: -0.5px;
}
.document-title h2 {
font-size: 15px;
font-weight: 400;
opacity: 0.9;
}
.document-body {
padding: 40px;
}
.intro-text {
background: linear-gradient(to left, #f7fafc, #edf2f7);
border-right: 4px solid var(--accent);
padding: 20px 25px;
border-radius: 8px;
margin-bottom: 35px;
font-size: 14px;
color: var(--text-muted);
}
.section {
margin-bottom: 40px;
page-break-inside: avoid;
}
.section-header {
display: flex;
align-items: center;
gap: 15px;
padding-bottom: 12px;
border-bottom: 2px solid var(--border);
margin-bottom: 20px;
}
.section-number {
width: 50px; height: 50px;
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: white;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
font-weight: 800;
font-size: 20px;
flex-shrink: 0;
box-shadow: 0 4px 10px rgba(26,54,93,0.2);
}
.section-title { flex: 1; }
.section-title h3 {
font-size: 19px;
font-weight: 700;
color: var(--primary);
margin-bottom: 2px;
}
.section-title .subtitle {
font-size: 12px;
color: var(--text-muted);
}
.section-content {
padding-right: 10px;
}
.section-content p {
margin-bottom: 12px;
text-align: justify;
text-indent: 20px;
}
.section-content p.no-indent { text-indent: 0; }
.highlight-box {
background: linear-gradient(to left, #fffaf0, #fef5e7);
border: 1px solid #f6e05e;
border-right: 4px solid var(--accent);
padding: 18px 22px;
border-radius: 8px;
margin: 20px 0;
font-size: 14px;
}
.highlight-box strong {
color: var(--accent-dark);
}
.info-box {
background: linear-gradient(to left, #ebf8ff, #e6f6ff);
border: 1px solid #90cdf4;
border-right: 4px solid var(--primary-light);
padding: 18px 22px;
border-radius: 8px;
margin: 20px 0;
font-size: 14px;
}
.success-box {
background: linear-gradient(to left, #f0fff4, #e6fffa);
border: 1px solid #9ae6b4;
border-right: 4px solid var(--success);
padding: 18px 22px;
border-radius: 8px;
margin: 20px 0;
font-size: 14px;
}
.warning-box {
background: linear-gradient(to left, #fffaf0, #fef5e7);
border: 1px solid #fbd38d;
border-right: 4px solid var(--warning);
padding: 18px 22px;
border-radius: 8px;
margin: 20px 0;
font-size: 14px;
}
.styled-table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
background: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.styled-table thead {
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: white;
}
.styled-table th {
padding: 14px 16px;
text-align: right;
font-weight: 600;
font-size: 13px;
}
.styled-table td {
padding: 13px 16px;
border-bottom: 1px solid var(--border);
font-size: 13px;
}
.styled-table tbody tr:last-child td { border-bottom: none; }
.styled-table tbody tr:nth-child(even) { background: #f8fafc; }
.styled-table .highlight-row {
background: #fffaf0 !important;
font-weight: 600;
}
pre {
background-color: #1a202c;
color: #e2e8f0;
padding: 20px;
border-radius: 8px;
overflow-x: auto;
direction: ltr;
text-align: left;
margin: 15px 0;
font-family: 'Courier New', Courier, monospace;
font-size: 13px;
line-height: 1.6;
border-right: 4px solid var(--accent);
}
code {
font-family: 'Courier New', Courier, monospace;
background-color: #edf2f7;
color: var(--danger);
padding: 2px 6px;
border-radius: 4px;
font-size: 13px;
direction: ltr;
display: inline-block;
}
pre code {
background-color: transparent;
color: inherit;
padding: 0;
}
.conclusion-box {
background: linear-gradient(135deg, var(--primary), var(--primary-light));
color: white;
padding: 30px;
border-radius: 12px;
margin: 30px 0;
text-align: center;
box-shadow: 0 8px 20px rgba(26,54,93,0.3);
}
.conclusion-box h3 {
font-size: 22px;
font-weight: 800;
margin-bottom: 15px;
color: var(--accent);
}
.conclusion-box p {
font-size: 14px;
line-height: 1.8;
text-indent: 0 !important;
margin-bottom: 15px;
}
.conclusion-box .highlight {
background: rgba(201,169,97,0.2);
padding: 15px 20px;
border-radius: 8px;
margin-top: 20px;
border: 1px solid rgba(201,169,97,0.4);
}
.document-footer {
background: var(--primary);
color: white;
padding: 25px 40px;
text-align: center;
font-size: 12px;
margin-top: 40px;
}
.document-footer .footer-brand {
font-weight: 700;
color: var(--accent);
margin-bottom: 5px;
font-size: 14px;
}
.footer-divider {
width: 60px;
height: 2px;
background: var(--accent);
margin: 10px auto;
}
.page-info {
text-align: center;
padding: 15px;
font-size: 11px;
color: var(--text-muted);
border-top: 1px solid var(--border);
margin-top: 30px;
}
@media print {
body { background: white; padding: 0; }
.document-container { box-shadow: none; border-radius: 0; }
.section { page-break-inside: avoid; }
}
@media (max-width: 768px) {
.document-body { padding: 25px 20px; }
.document-header { padding: 30px 20px; }
.header-top { flex-direction: column; gap: 15px; }
.doc-meta { text-align: center; }
}
</style>
</head>
<body>
<div class="document-container">
<header class="document-header">
<div class="header-top">
<div class="company-badge">
<div class="company-logo">فن آوران<br>ساحر علم</div>
</div>
<div class="doc-meta">
<div>شماره مستند: TECH-1405-003</div>
<div>نسخه: ۱.۰</div>
<div>تاریخ تهیه: ۲۸ مهر ۱۴۰۵</div>
<div>طبقه‌بندی: داخلی / فنی</div>
</div>
</div>
<div class="document-title">
<span class="label">DEPLOYMENT & OPTIMIZATION GUIDE</span>
<h1>مستند فنی راه‌اندازی و بهینه‌سازی مدل Qwen3.5-9B</h1>
<h2>پیاده‌سازی نسخه Uncensored-Heretic با قابلیت چندوجهی (Multimodal) بر روی سخت‌افزار با ۶۴ گیگابایت رم و ۴ گیگابایت VRAM</h2>
</div>
</header>
<div class="document-body">
<div class="intro-text">
<strong>همکاران و ذینفعان محترم،</strong><br>
این مستند، راهنمای جامع و گام‌به‌گام استقرار مدل <strong>Qwen3.5-9B-The-Defiant-Fable-Uncensored-Heretic-NEO-IMATRIX-MAX-MTP-GGUF</strong> را ارائه می‌دهد. با توجه به محدودیت حافظه گرافیکی (۴ گیگابایت) و وفور حافظه سیستم (۶۴ گیگابایت)، استراتژی اصلی این سند بر پایه <strong>تخصیص هیبریدی منابع (Hybrid Resource Allocation)</strong> و <strong>بارگذاری لایه‌ای (GPU Offloading)</strong> طراحی شده است تا بهترین تعادل بین سرعت و پایداری حاصل شود.
</div>
<div class="section">
<div class="section-header">
<div class="section-number">۱</div>
<div class="section-title">
<h3>تحلیل مدل و قابلیت‌های کلیدی</h3>
<div class="subtitle">Model Analysis & Key Capabilities</div>
</div>
</div>
<div class="section-content">
<p>این مدل ۹ میلیارد پارامتری، حاصل تنظیم دقیق (Fine-tune) و ادغام چندمرحله‌ای است که عملکردی فراتر از مدل‌های ۲۷ میلیارد پارامتری پایه در بنچمارک‌های کلیدی (مانند ARC-C) ارائه می‌دهد [[1]]. ویژگی‌های برجسته آن عبارتند از:</p>
<ul>
<li><strong>پشتیبانی از چندوجهی (Multimodal):</strong> قابلیت درک و تحلیل تصاویر با استفاده از فایل مکمل <code>mmproj</code> [[2]].</li>
<li><strong>پیش‌بینی چند توکنی (MTP):</strong> معماری بهینه‌شده برای افزایش سرعت استنتاج تا ۳ برابر در کوانتیزاسیون‌های خاص [[1]].</li>
<li><strong>کوانتیزاسیون IMATRIX:</strong> دقت ۲ تا ۴ درصد بالاتر نسبت به فایل‌های GGUF معمولی، به‌ویژه در پنجره‌های متنی طولانی [[1]].</li>
<li><strong>حالت‌های استدلال و دستور (Reasoning/Instruct):</strong> پشتیبانی از ۵ حالت مختلف (مانند Spoon و Einstein) که به صورت پویا در حین چت قابل تغییر هستند [[1]].</li>
</ul>
</div>
</div>
<div class="section">
<div class="section-header">
<div class="section-number">۲</div>
<div class="section-title">
<h3>استراتژی تخصیص منابع سخت‌افزاری</h3>
<div class="subtitle">Hardware Resource Allocation Strategy</div>
</div>
</div>
<div class="section-content">
<p>با توجه به مشخصات سیستم هدف (۶۴ گیگابایت RAM و ۴ گیگابایت VRAM)، استراتژی زیر برای جلوگیری از خطای کمبود حافظه (OOM) و حفظ سرعت مناسب تدوین شده است:</p>
<div class="info-box">
<strong>تحلیل حجم مدل:</strong><br>
• نسخه پیشنهادی: <code>Q4_K_M</code> یا <code>Q5_K_M</code> (حجم تقریبی: ۶.۸ تا ۷.۸ گیگابایت).<br>
• فایل پردازشگر بینایی (<code>mmproj-F16.gguf</code>): حجم تقریبی ۰.۵ تا ۱ گیگابایت.<br>
• <strong>مجموع مورد نیاز:</strong> حدود ۸ گیگابایت فضای حافظه.
</div>
<div class="success-box">
<strong>✅ راهکار بهینه:</strong><br>
از آنجا که ۶۴ گیگابایت رم سیستم به‌راحتی کل مدل را در خود جای می‌دهد، مدل به‌صورت کامل در RAM بارگذاری می‌شود. سپس، با استفاده از تکنیک <strong>GPU Offloading</strong>، حدود ۱۵ تا ۲۰ لایه از مدل به‌همراه کل فایل <code>mmproj</code> به ۴ گیگابایت VRAM منتقل می‌شود. این کار سرعت پردازش توکن‌ها را به‌شدت افزایش می‌دهد بدون آنکه باعث سرریز حافظه گرافیکی شود.
</div>
</div>
</div>
<div class="section">
<div class="section-header">
<div class="section-number">۳</div>
<div class="section-title">
<h3>راهنمای گام‌به‌گام راه‌اندازی (با LM Studio)</h3>
<div class="subtitle">Step-by-Step Setup Guide (LM Studio)</div>
</div>
</div>
<div class="section-content">
<p>نرم‌افزار <strong>LM Studio</strong> به دلیل رابط کاربری بصری و مدیریت هوشمند تخصیص حافظه، بهترین گزینه برای این پیکربندی سخت‌افزاری است.</p>
<div class="step-box" style="background: #f8fafc; border: 1px solid #e2e8f0; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
<strong>گام ۱: دانلود فایل‌های ضروری</strong>
<p class="no-indent" style="margin-top: 10px;">به صفحه Hugging Face مدل مراجعه کرده و دو فایل زیر را دانلود کنید:</p>
<ol style="margin-right: 20px; margin-top: 10px;">
<li>فایل اصلی مدل: <code>Qwen3.5-9B-The-Defiant-Fable...-Q4_K_M.gguf</code> (یا Q5_K_M)</li>
<li>فایل پردازشگر بینایی: <code>mmproj-F16.gguf</code> یا <code>mmproj-BF16.gguf</code> از همان مخزن [[2]].</li>
</ol>
</div>
<div class="step-box" style="background: #f8fafc; border: 1px solid #e2e8f0; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
<strong>گام ۲: بارگذاری مدل در LM Studio</strong>
<p class="no-indent" style="margin-top: 10px;">نرم‌افزار را باز کرده و از بخش <strong>AI Chat</strong>، فایل <code>.gguf</code> دانلودشده را انتخاب کنید. مطمئن شوید که فایل <code>mmproj</code> در همان پوشه قرار دارد تا نرم‌افزار به‌صورت خودکار آن را شناسایی کند.</p>
</div>
<div class="step-box" style="background: #f8fafc; border: 1px solid #e2e8f0; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
<strong>گام ۳: تنظیم بهینه GPU Offloading (حیاتی)</strong>
<p class="no-indent" style="margin-top: 10px;">در پنل سمت راست (Hardware Settings):</p>
<ul style="margin-right: 20px; margin-top: 10px;">
<li>گزینه <strong>GPU Offload</strong> را فعال کنید.</li>
<li>اسلایدر را روی عددی بین <strong>۱۵ تا ۲۰ لایه</strong> تنظیم کنید. (این مقدار حدود ۳ تا ۳.۵ گیگابایت از VRAM شما را اشغال می‌کند و فضای باقی‌مانده را برای فایل <code>mmproj</code> و بافرهای سیستمی حفظ می‌نماید).</li>
<li>گزینه <strong>Use Partial Offload</strong> باید فعال باشد.</li>
</ul>
</div>
<div class="step-box" style="background: #f8fafc; border: 1px solid #e2e8f0; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
<strong>گام ۴: پیکربندی پارامترهای تولید (Generation Parameters)</strong>
<p class="no-indent" style="margin-top: 10px;">برای دستیابی به بهترین عملکرد بر اساس توصیه‌های توسعه‌دهنده، مقادیر زیر را تنظیم کنید [[1]]:</p>
<ul style="margin-right: 20px; margin-top: 10px;">
<li><strong>Context Length:</strong> 8192 تا 16384 (بیشتر از این مقدار در حالت چندوجهی ممکن است باعث کندی شود).</li>
<li><strong>Temperature:</strong> 0.7 (برای حالت Instruct) یا 1.0 (برای حالت Reasoning/Thinking).</li>
<li><strong>Top_P:</strong> 0.80 تا 0.95</li>
<li><strong>Repetition Penalty:</strong> 1.0 (بسیار مهم: افزایش این مقدار عملکرد مدل‌های MTP را مختل می‌کند) [[1]].</li>
<li><strong>Min_P:</strong> 0.0</li>
</ul>
</div>
</div>
</div>
<div class="section">
<div class="section-header">
<div class="section-number">۴</div>
<div class="section-title">
<h3>فعال‌سازی و تست قابلیت چندوجهی (Vision)</h3>
<div class="subtitle">Multimodal (Vision) Activation & Testing</div>
</div>
</div>
<div class="section-content">
<p>پس از اطمینان از بارگذاری صحیح فایل <code>mmproj</code>، آیکون گیره کاغذ (📎) یا آپلود تصویر در رابط کاربری فعال خواهد شد.</p>
<div class="warning-box">
<strong>نکته فنی مهم:</strong> پردازش تصویر به‌صورت پیش‌فرض تمام لایه‌های <code>mmproj</code> را به GPU منتقل می‌کند. اگر با خطای <code>Out of Memory (OOM)</code> مواجه شدید، تعداد لایه‌های مدل اصلی (GPU Offload) را ۲ تا ۳ واحد کاهش دهید تا فضای کافی برای پردازشگر بینایی در VRAM آزاد شود.
</div>
<p><strong>دستور تست پیشنهادی:</strong><br>
یک تصویر حاوی متن یا نمودار آپلود کرده و بپرسید: <br>
<code>"این تصویر را با جزئیات کامل تحلیل کن و داده‌های کلیدی آن را به صورت جدول استخراج کن."</code></p>
</div>
</div>
<div class="section">
<div class="section-header">
<div class="section-number">۵</div>
<div class="section-title">
<h3>جمع‌بندی و توصیه‌های نهایی</h3>
<div class="subtitle">Conclusion & Final Recommendations</div>
</div>
</div>
<div class="section-content">
<div class="conclusion-box">
<h3>🎯 ارزیابی نهایی معماری</h3>
<p>با پیکربندی پیشنهادی (بارگذاری کامل در RAM + انتقال ۱۵-۲۰ لایه به GPU)، این سیستم قادر است مدل ۹ میلیارد پارامتری چندوجهی را با سرعتی معقول (حدود ۸ تا ۱۵ توکن در ثانیه بسته به CPU) و پایداری کامل اجرا کند.</p>
<div class="highlight">
<strong>💡 توصیه‌های کلیدی برای حفظ پایداری:</strong><br>
۱. از کوانتیزاسیون‌های بالاتر از <code>Q5_K_M</code> خودداری کنید، زیرا فشار غیرضروری به رم سیستم وارد می‌کند.<br>
۲. در صورت استفاده از حالت <strong>MTP</strong> (فایل‌هایی که پسوند MTP دارند)، دمای مدل (Temperature) را حتماً زیر ۱.۰ نگه دارید تا از افت کیفیت جلوگیری شود [[1]].<br>
۳. برای کارهای برنامه‌نویسی دقیق، دما را به ۰.۶ کاهش دهید [[1]].
</div>
</div>
</div>
</div>
<div class="page-info">
این مستند محرمانه بوده و صرفاً جهت استفاده داخلی در شرکت فن آوران ساحر علم تهیه شده است. هرگونه کپی‌برداری یا افشا بدون اجازه کتبی ممنوع است.
</div>
</div>
<footer class="document-footer">
<div class="footer-brand">طراحی و تدوین: هادی خزاعی اصل | متخصص علم داده و مهندس هوش مصنوعی</div>
<div class="footer-divider"></div>
<div>شرکت: فن آوران ساحر علم &nbsp;|&nbsp; تاریخ تهیه: ۲۸ مهر ۱۴۰۵ &nbsp;|&nbsp; نسخه: ۱.۰ &nbsp;|&nbsp; طبقه‌بندی: داخلی / فنی</div>
</footer>
</div>
</body>
</html>