Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nicer error message for undefined symbol #1339

Merged
merged 7 commits into from
Jul 4, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions llmfoundry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@

import logging

try:
from flash_attn import flash_attn_func
del flash_attn_func
except ImportError as e:
if 'undefined symbol' in str(e):
raise ImportError(
'The flash_attn package is not installed correctly. Usually this means that your runtime version.'
dakinggg marked this conversation as resolved.
Show resolved Hide resolved
+
' of PyTorch is different from the version that flash_attn was installed with, which can occur when your'
+
' workflow has resulted in PyTorch being reinstalled. This probably happened because you are using an old docker image'
dakinggg marked this conversation as resolved.
Show resolved Hide resolved
+
' with the latest version of LLM Foundry. Check that the PyTorch version in your Docker image matches the PyTorch version'
+
' in LLM Foundry setup.py and update accordingly. The latest Docker image can be found in the README.',
) from e

from llmfoundry.utils.logging_utils import SpecificWarningFilter

# Filter out Hugging Face warning for not using a pinned revision of the model
Expand Down
Loading