Xformers fix
This commit is contained in:
parent
907264d077
commit
66e07ede3b
2 changed files with 18 additions and 4 deletions
|
|
@ -285,10 +285,16 @@ cu130onlytorch290 = [
|
|||
"xformers @ https://download.pytorch.org/whl/cu130/xformers-0.0.33.post1-cp39-abi3-win_amd64.whl ; (sys_platform == 'win32')",
|
||||
]
|
||||
cu126onlytorch291 = [
|
||||
"xformers @ https://download.pytorch.org/whl/cu126/xformers-0.0.33.post2-cp39-abi3-manylinux_2_28_x86_64.whl ; ('linux' in sys_platform)",
|
||||
"xformers @ https://download.pytorch.org/whl/cu126/xformers-0.0.33.post2-cp39-abi3-win_amd64.whl ; (sys_platform == 'win32')",
|
||||
]
|
||||
cu128onlytorch291 = [
|
||||
"xformers @ https://download.pytorch.org/whl/cu128/xformers-0.0.33.post2-cp39-abi3-manylinux_2_28_x86_64.whl ; ('linux' in sys_platform)",
|
||||
"xformers @ https://download.pytorch.org/whl/cu128/xformers-0.0.33.post2-cp39-abi3-win_amd64.whl ; (sys_platform == 'win32')",
|
||||
]
|
||||
cu130onlytorch291 = [
|
||||
"xformers @ https://download.pytorch.org/whl/cu130/xformers-0.0.33.post2-cp39-abi3-manylinux_2_28_x86_64.whl ; ('linux' in sys_platform)",
|
||||
"xformers @ https://download.pytorch.org/whl/cu130/xformers-0.0.33.post2-cp39-abi3-win_amd64.whl ; (sys_platform == 'win32')",
|
||||
]
|
||||
cu118 = [
|
||||
"unsloth[huggingface]",
|
||||
|
|
|
|||
|
|
@ -761,6 +761,13 @@ elif DEVICE_TYPE == "xpu":
|
|||
|
||||
# =============================================
|
||||
# Get Xformers
|
||||
# Silence xformers CUDA mismatch warnings before import
|
||||
try:
|
||||
_xformers_logger = logging.getLogger("xformers")
|
||||
_xformers_logger.setLevel(_logging.ERROR)
|
||||
del _xformers_logger
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
from xformers import __version__ as xformers_version
|
||||
|
||||
|
|
@ -835,10 +842,11 @@ except ModuleNotFoundError:
|
|||
xformers_attention = None
|
||||
xformers_version = None
|
||||
except Exception as e:
|
||||
print(
|
||||
"========\nSwitching to PyTorch attention since your Xformers is broken.\n========\n"
|
||||
)
|
||||
print(str(e))
|
||||
if os.environ.get("UNSLOTH_ENABLE_LOGGING", "0") != "0":
|
||||
print(
|
||||
"========\nSwitching to PyTorch attention since your Xformers is broken.\n========\n"
|
||||
)
|
||||
print(str(e))
|
||||
xformers = None
|
||||
xformers_attention = None
|
||||
xformers_version = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue