".github/vscode:/vscode.git/clone" did not exist on "98c58158d1bc09e6fab31d3bf1af36e8d1752a89"
test_cuda_setup_evaluator.py 714 Bytes
Newer Older
1
import os
Tom Aarsen's avatar
Tom Aarsen committed
2
import pytest
3
4
5
6
import torch
from pathlib import Path

# hardcoded test. Not good, but a sanity check for now
7
# TODO: improve this
8
def test_manual_override(requires_cuda):
9
10
11
12
    manual_cuda_path = str(Path('/mmfs1/home/dettmers/data/local/cuda-12.2'))

    pytorch_version = torch.version.cuda.replace('.', '')

13
    assert pytorch_version != 122  # TODO: this will never be true...
14
15

    os.environ['CUDA_HOME']='{manual_cuda_path}'
16
17
    os.environ['BNB_CUDA_VERSION']='122'
    #assert str(manual_cuda_path) in os.environ['LD_LIBRARY_PATH']
18
19
    import bitsandbytes as bnb
    loaded_lib = bnb.cuda_setup.main.CUDASetup.get_instance().binary_name
20
    #assert loaded_lib == 'libbitsandbytes_cuda122.so'
21
22
23
24
25
26
27







Tom Aarsen's avatar
Tom Aarsen committed
28