Skip to main content
This guide covers common issues you may encounter when working with Qwen models and their solutions.

Installation Issues

Flash Attention Installation Fails

Symptoms:
  • Compilation errors when installing flash-attention
  • CUDA version mismatch errors
  • Missing CUDA development files
Solutions:
1

Verify GPU compatibility

Flash Attention only works on:
  • Turing architecture: T4, RTX 2080, etc.
  • Ampere architecture: A100, RTX 3090, etc.
  • Ada architecture: RTX 4090, etc.
  • Hopper architecture: H100, etc.
Check your GPU:
2

Verify CUDA version

Flash Attention requires CUDA 11.4+:
3

Install from source

4

Alternative: Skip Flash Attention

Flash Attention is optional. If installation continues to fail, proceed without it:

Package Dependency Conflicts

Error: Version conflicts between transformers, peft, optimum, auto-gptq Recommended versions:

Git LFS Files Not Downloaded

Symptoms:
  • qwen.tiktoken is only a few bytes (text pointer)
  • Model files are text pointers instead of actual binaries
  • “File not found” errors for model checkpoints
Solution:

Model Loading Issues

Model Won’t Load Locally

Checklist:

Out of Memory (OOM) When Loading

Symptoms:
  • RuntimeError: CUDA out of memory
  • System freezes when loading model
  • Model loads but crashes during inference
Solutions:
1

Use quantized models

2

Enable device_map='auto'

3

Use CPU offloading

4

Switch to smaller model

If none of the above work, use a smaller model size:
  • Qwen-7B → Qwen-1.8B
  • Qwen-14B → Qwen-7B
  • Qwen-72B → Qwen-14B or Qwen-7B

Inference Issues

Gibberish or Garbled Output

Problem 1: Using base model instead of chat model
Problem 2: Incomplete UTF-8 sequences in streaming
Problem 3: Wrong decoding parameters

Model Not Following Instructions

Check 1: Using correct model type
Check 2: Using correct prompt format For Qwen-Chat, use the chat() method:
Check 3: System prompt (for Qwen-72B-Chat and Qwen-1.8B-Chat)

Slow Inference Speed

Diagnosis:
Solutions:
vLLM provides optimized inference:

Poor Performance on Long Context

Enable NTK and LogN attention:
If false, manually enable:

Fine-tuning Issues

OOM During Training

Solutions in order of effectiveness:
1

Use Q-LoRA instead of LoRA

Saves ~40-50% memory compared to LoRA.
2

Reduce batch size, increase gradient accumulation

3

Enable gradient checkpointing

4

Use DeepSpeed ZeRO

5

Reduce sequence length

Training Loss Not Decreasing

Checklist:

Quantized Model Finetuning Issues

Problem: Can’t load LoRA adapter after Q-LoRA training
Problem: Missing .cpp and .cu files after saving Manually copy these files from the original model directory:
  • cache_autogptq_cuda_256.cpp
  • cache_autogptq_cuda_kernel_256.cu
  • Other .cpp and .cu files

Quantization Issues

AutoGPTQ Installation Fails

Check PyTorch and CUDA compatibility:
Install matching auto-gptq wheel:
See AutoGPTQ repo for more wheels.

Quantized Model Slower Than Expected

Note: Loading with AutoModelForCausalLM.from_pretrained() is ~20% slower than the autogptq library directly. This is a known issue reported to HuggingFace team. Workaround: Use the autogptq library directly for maximum speed.

Tool Usage and ReAct Issues

Plugin Not Being Called

Check prompt format:

HuggingFace Agent Issues

Verify Qwen-Chat is being used:

Docker Issues

Container Fails to Start

Check GPU availability:
Verify sufficient resources:

Slow Image Download

Use a Docker registry mirror (especially for users in China):
Add:
Restart Docker:

Platform-Specific Issues

Windows

Long path issues:
WSL2 recommended for better compatibility:

macOS

Metal/MPS not officially supported. Use CPU or cloud deployment.

Getting Help

If issues persist after trying these solutions:
  1. Search existing issues: GitHub Issues
  2. Check the FAQ: FAQ
  3. Open a new issue with:
    • Full error traceback
    • Environment details (python --version, pip list, nvidia-smi)
    • Minimal reproducible code
    • Steps already tried
  4. Join the community:
When reporting issues, please provide as much context as possible and use English when possible to help more people understand and assist.