70 items
Enabling Flash Attention 2
Code QuizWhy Run Models Locally
QuizQuantization Formats: GPTQ, AWQ, GGUF
Slides / VideoStreaming Without a Background Thread
Code Quiz4-bit Loading with BitsAndBytesConfig
Code QuizAutoTokenizer and AutoModel Loading
Code QuizGenerating and Decoding Output
Code QuizDeploying Open Models on Cloud GPUs
Slides / VideoSecuring Self-Hosted Model Servers
Slides / VideoLoading a Model with the Pipeline
Code QuizHalf-Precision Loading with torch_dtype
Code QuizDevice Placement with device_map
Code QuizApplying a Chat Template
Code QuizConfiguring Sampling Parameters
Code QuizStop Sequence with stop_strings
Code QuizWhere trust_remote_code Belongs
Code QuizSlicing Off the Prompt Tokens
Code QuizLocal Embedding and Reranker Models
Slides / VideoBenchmarking Local Inference Speed
Slides / VideoServing LoRA Adapters Locally
Slides / VideoContainerizing Local Model Deployments
Slides / VideoServing Quantized Models: Speed vs Quality
Slides / VideoChat Templates Per Model
Slides / VideoOpenAI-Compatible Local API Endpoints
Slides / VideoCPU Offloading and Mixed Inference
Slides / VideoModel Sharding and Parallelism
Slides / VideoEstimating VRAM for a Model
Slides / VideoPagedAttention and KV Cache Management
Slides / VideoProduction Serving Engines for LLMs
Slides / VideoLocal Inference Runtimes Compared
Slides / VideoModel Weight Formats Explained
Slides / VideoLandscape of Open Models
Slides / VideoAuthenticating for Gated HF Models
Code QuizBatched Generation Padding Side
Code QuizEstimating VRAM from Parameter Count
Code QuizGPU Offloading with n_gpu_layers
Code QuizLoading a Model from a Local Path
Code QuizKV Cache During Generation
Code QuizMerging a LoRA Adapter
Code QuizLocal Embeddings with sentence-transformers
Code QuizMissing pad token for GPT-2
Code Quizmax_new_tokens vs max_length
Code QuizOpenAI client base_url path
Code QuizvLLM model name mismatch
Code QuizDefault context window too small
Code QuizReading an Ollama response
Code QuizLoading a GGUF with llama-cpp
Code QuizOpen Model Licensing and Commercial Use
Slides / VideoOpen-Source vs Open-Weight vs Proprietary
Slides / VideoWhy Run LLMs Locally
Slides / VideoChat Templates per Model
FlashcardContainerizing Model Deployments
FlashcardSecurity of Self-Hosted Inference
FlashcardEdge and On-Device Constraints
FlashcardEvaluating Quantization Quality Loss
FlashcardServing LoRA Adapters Locally
FlashcardCloud GPU Providers for Self-Hosting
FlashcardContext Length and RoPE Scaling
FlashcardGGUF Quantization Formats
FlashcardOpenAI-Compatible Local API
FlashcardMulti-GPU Inference
FlashcardModel Weight Formats
FlashcardOpen-Source Model Landscape
FlashcardVRAM Estimation
FlashcardHugging Face Hub Downloading
FlashcardMemory Offloading
FlashcardGPU vs CPU vs Apple Silicon
FlashcardOpen Weights vs Open Source
FlashcardLocal Inference Runtimes
FlashcardPagedAttention and vLLM
FlashcardEnabling Flash Attention 2
Spot why requesting flash_attention_2 fails when loading a model in full precision.
from transformers import AutoModelForCausalLM
import torch
model = AutoModelForCausalLM.from_pretrained(
"mistralai/Mistral-7B-v0.1",
torch_dtype=torch.float32,
attn_implementation="flash_attention_2",
)What is the bug that prevents this model from loading with Flash Attention 2?