قاعدة المعرفة التقنية
مسرد VRAM ونماذج الذكاء الاصطناعي التقني
شروحات مبسطة وعملية لأكثر من 50 مصطلحًا جوهريًا في تشغيل النماذج محليًا، وتقنيات التكميم، ومعماريات الانتباه، وحسابات ذاكرة GPU دون أي تعقيد غير مبرر.
Active Parameters vs. Total Parameters
Memory & AttentionTotal parameters represent all weights stored on disk and loaded into memory; active parameters represent the subset actually executed during compute for a single token.
AWQ (Activation-Aware Weight Quantization)
Quantization & FormatsA 4-bit GPU quantization technique that preserves the top 1% of salient weights based on activation magnitudes, ensuring near-FP16 accuracy with high inference speed.
Bits Per Weight (bpw)
Quantization & FormatsThe effective average number of storage bits allocated to each parameter in a model after quantization and scaling factors are accounted for.
Community License (Llama / Gemma)
Licensing & OpennessA custom open-weights license designed by large tech corporations that grants free access for research and small-to-medium businesses, but restricts mega-scale commercial use.
Context Window / Sequence Length
Memory & AttentionThe maximum total number of tokens (prompt input plus generated output) that a model can comprehend and attend to in a single conversation session.
CUDA Out of Memory (CUDA OOM)
Hardware & OffloadingA fatal runtime exception thrown by NVIDIA CUDA when an allocation request for weights, KV cache, or activations exceeds available physical VRAM.
EXL2 (ExLlamaV2 Quantization)
Quantization & FormatsAn advanced mixed-precision quantization format designed specifically for NVIDIA GPUs by turboderp, offering continuous bitrates and industry-leading generation speed.
FlashAttention (FlashAttention-2 / 3)
Inference EnginesAn exact attention algorithm that reorganizes memory accesses to keep operations inside fast GPU SRAM (cache) rather than repeatedly reading from slower HBM/VRAM.
Gated Model / Gated Repo
Licensing & OpennessA model repository on platforms like Hugging Face that requires users to accept legal terms or request explicit author permission before downloading weights.
GGUF (GPT-Generated Unified Format)
Quantization & FormatsA standardized, extensible single-file binary format developed by Georgi Gerganov and the llama.cpp community designed for fast local CPU/GPU inference and layer offloading.
GQA (Grouped-Query Attention)
Memory & AttentionAn attention architecture where multiple query heads share a single key-value head, reducing KV cache VRAM by 4x to 8x while preserving reasoning capability.
K-Quants (Q4_K_M, Q5_K_M, Q8_0)
Quantization & FormatsAdvanced quantization schemes in llama.cpp that group weights into super-blocks and allocate higher precision to critical attention and feed-forward layers.
KV Cache (Key-Value Cache)
Memory & AttentionA dedicated block of GPU memory that stores previously computed attention key and value tensors for every token in a conversation, preventing redundant recomputations.
Layer Offloading (n-gpu-layers)
Hardware & OffloadingSplitting a model across hardware by loading as many transformer layers as fit into GPU VRAM while leaving the remaining layers in system CPU RAM.
llama.cpp
Inference EnginesThe foundational, highly optimized C/C++ inference engine created by Georgi Gerganov that powers the vast majority of local LLM tools across CPU, CUDA, Metal, and ROCm.
Memory Bandwidth (GB/s)
Hardware & OffloadingThe rate at which a processor can read data from and write data to its memory, measured in gigabytes per second; this directly dictates LLM generation speed.
MHA (Multi-Head Attention)
Memory & AttentionThe classic attention architecture where every single query head possesses its own dedicated key and value head, creating the largest and most VRAM-hungry KV cache.
Mixture of Experts (MoE)
Memory & AttentionA neural network architecture where multiple specialized sub-networks ('experts') exist, but only a small subset is activated for each individual token.
MLA (Multi-Head Latent Attention)
Memory & AttentionDeepSeek's pioneering attention mechanism that compresses key-value vectors into a low-rank latent vector before caching, slashing KV cache memory by over 90%.
MLX (Apple Silicon Framework)
Inference EnginesApple's native machine learning framework designed specifically for Apple Silicon M-series unified architecture, delivering maximum speed and efficiency on macOS.
Ollama
Inference EnginesA user-friendly, CLI-driven application and daemon that packages llama.cpp into a Docker-like model management system with a clean REST API.
Open Source AI (OSI Standard)
Licensing & OpennessAn AI system meeting the Open Source Initiative (OSI) OSAID 1.0 standard, requiring open model weights, full training code, and comprehensive training data information.
Open Weights
Licensing & OpennessA release model where a creator publishes the neural network weights for download and self-hosting, but keeps the underlying dataset, preprocessing scripts, or training pipeline private.
PagedAttention
Inference EnginesAn attention algorithm that stores KV cache tensors in non-contiguous physical memory blocks (pages), eliminating memory fragmentation and enabling near-zero memory waste.
Permissive AI License (Apache 2.0 / MIT)
Licensing & OpennessSoftware and weight licenses (like Apache 2.0 or MIT) that grant full commercial rights, modifications, and redistribution with minimal restrictions.
Perplexity (PPL)
Quantization & FormatsA mathematical metric that measures how well a language model predicts a sample test dataset; lower perplexity indicates higher accuracy and better reasoning.
Quantization
Quantization & FormatsThe process of reducing the numerical precision of a model's weights and activations (e.g., from 16-bit float down to 8-bit, 4-bit, or 2-bit) to drastically reduce memory usage and speed up computation.
Safetensors
Quantization & FormatsA fast, secure, memory-mappable file format created by Hugging Face for storing deep learning tensors without the arbitrary code execution risks of Python pickles.
Sliding Window Attention (SWA)
Memory & AttentionAn attention strategy where tokens only attend to a fixed window of preceding tokens (e.g., the last 4,096 tokens), placing a hard ceiling on KV cache memory growth.
Synthetic Data & Distillation Restrictions
Licensing & OpennessClauses in AI terms of service that prohibit using the model's outputs to train, fine-tune, or evaluate other competing artificial intelligence models.
Tensor Parallelism (TP) vs. Pipeline Parallelism (PP)
Hardware & OffloadingMethods for distributing a large model across multiple GPUs; Tensor Parallelism splits individual weight matrices, while Pipeline Parallelism places different layers on different cards.
Unified Memory (Apple Silicon)
Hardware & OffloadingA shared memory architecture used in Apple M-series chips where CPU, GPU, and Neural Engine access the same high-bandwidth pool of physical memory without bus copies.
vLLM
Inference EnginesA high-throughput, enterprise-grade LLM serving engine developed at UC Berkeley, renowned for PagedAttention, continuous batching, and chunked prefill.
VRAM (Video Random-Access Memory)
Hardware & OffloadingDedicated ultra-high-bandwidth memory physically located on a discrete graphics card (GPU) used for storing model weights, KV cache, and intermediate activations.
Knowledge & Deep Dives
مركز المعرفة حول VRAM والنماذج اللغوية المحلية
أدلة تقنية شاملة، وتحليلات معمارية، وإرشادات لاختيار العتاد لمساعدتك على تشغيل نماذج الذكاء الاصطناعي محليًا بدقة وثقة مطلقة.