flash-attn Python Version Compatibility

Check which Python versions work with flash-attn. Python 3.11 and 3.12 are recommended for the best wheel availability. Python 3.13 is supported in flash-attn 2.8.3+.

Quick Answer: Python Version Support

  • Python 3.13: Supported in flash-attn 2.8.3+ (requires PyTorch 2.6+)
  • Python 3.12: Fully supported, recommended
  • Python 3.11: Fully supported, best wheel availability
  • Python 3.10: Fully supported
  • Python 3.9: Use flash-attn 2.6.3 or older
  • Python 3.8: Use flash-attn 2.5.9 or older

Detailed Python Compatibility

Python 3.13

supported

flash-attn versions

2.8.3+

Recommendation

Use for new projects that need latest Python features.

Added in flash-attn 2.8.3. Requires PyTorch 2.6+ which has Python 3.13 wheels.

Python 3.12

recommended

flash-attn versions

2.6.3+

Recommendation

Recommended for most users. Excellent wheel coverage.

Fully supported with wide wheel availability. Best balance of compatibility and features.

Python 3.11

recommended

flash-attn versions

2.4.0+

Recommendation

Best choice for production deployments.

Mature support with the widest wheel availability. Best for production use.

Python 3.10

supported

flash-attn versions

2.0.0+

Recommendation

Good for compatibility with older libraries.

Long-term support. All flash-attn versions have Python 3.10 wheels.

Python 3.9

legacy

flash-attn versions

2.0.0 - 2.6.3

Recommendation

Consider upgrading to Python 3.10+.

Support ended in flash-attn 2.7.0. Use older flash-attn versions.

Python 3.8

legacy

flash-attn versions

2.0.0 - 2.5.9

Recommendation

Upgrade to Python 3.10+ for security and features.

Support ended in flash-attn 2.6.0. Use flash-attn 2.5.9 or older.

Check Your Python Version

Run this command to see your Python version:

python --version

If you're using a virtual environment, make sure it's activated before checking. The wheel filename includes the Python version tag (e.g., cp312 for Python 3.12).

Find Your Wheel

Select your Python version in the wheel finder:

Open Wheel Finder →

PyTorch Compatibility

Check PyTorch version requirements:

PyTorch Compatibility →