2022-08-01 00:47:44 +00:00
|
|
|
import os
|
2022-10-27 11:15:21 +00:00
|
|
|
import pytest
|
2023-07-14 06:58:41 +00:00
|
|
|
import torch
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
# hardcoded test. Not good, but a sanity check for now
|
|
|
|
def test_manual_override():
|
|
|
|
manual_cuda_path = str(Path('/mmfs1/home/dettmers/data/local/cuda-12.2'))
|
|
|
|
|
|
|
|
pytorch_version = torch.version.cuda.replace('.', '')
|
|
|
|
|
|
|
|
assert pytorch_version != 122
|
|
|
|
|
|
|
|
os.environ['CUDA_HOME']='{manual_cuda_path}'
|
|
|
|
os.environ['CUDA_VERSION']='122'
|
|
|
|
assert str(manual_cuda_path) in os.environ['LD_LIBRARY_PATH']
|
|
|
|
import bitsandbytes as bnb
|
|
|
|
loaded_lib = bnb.cuda_setup.main.CUDASetup.get_instance().binary_name
|
|
|
|
assert loaded_lib == 'libbitsandbytes_cuda122.so'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-27 11:15:21 +00:00
|
|
|
|