summaryrefslogtreecommitdiff
path: root/bitsandbytes/functional.py
diff options
context:
space:
mode:
authorTim Dettmers <tim.dettmers@gmail.com>2022-09-05 16:23:03 -0700
committerTim Dettmers <tim.dettmers@gmail.com>2022-09-05 16:23:03 -0700
commiteab4d8232d558f2e6bd7f7cc3d00e2e6e94f4e80 (patch)
tree1a70991e0d9d5632a20388bf87e4c56dfb06d64e /bitsandbytes/functional.py
parent5d9bc7a301618d6642a70951ac46637d4889c82b (diff)
parent8e7053a988f7bf6c0b2605a3d0ec461f5d9b05e4 (diff)
Merge branch 'bugfix_cpu_and_cc' into main
Diffstat (limited to 'bitsandbytes/functional.py')
-rw-r--r--bitsandbytes/functional.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/bitsandbytes/functional.py b/bitsandbytes/functional.py
index 6637554..75d083b 100644
--- a/bitsandbytes/functional.py
+++ b/bitsandbytes/functional.py
@@ -185,14 +185,9 @@ def create_dynamic_map(signed=True, n=7):
def get_special_format_str():
+ if not torch.cuda.is_available(): return 'col_turing'
major, minor = torch.cuda.get_device_capability()
- if major < 7:
- print(
- f"Device with CUDA capability of {major} not supported for 8-bit matmul. Device has no tensor cores!"
- )
- assert major >= 7
-
- if major == 7:
+ if major <= 7:
return "col_turing"
elif major == 8:
return "col_ampere"
@@ -1685,21 +1680,6 @@ def double_quant(
return out_row, out_col, row_stats, col_stats, coo_tensor
-def get_special_format_str():
- major, minor = torch.cuda.get_device_capability()
- if major < 7:
- print(
- f"Device with CUDA capability of {major} not supported for 8-bit matmul. Device has no tensor cores!"
- )
- assert major >= 7
-
- if major == 7: return 'col_turing'
- elif major == 8: return 'col_ampere'
- else: return 'col_turing'
-
-
-
-
def transform(A, to_order, from_order='row', out=None, transpose=False, state=None, ld=None):
prev_device = pre_call(A.device)
if state is None: state = (A.shape, from_order)