Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
7a3c9af0
Commit
7a3c9af0
authored
Oct 27, 2022
by
Tom Aarsen
Browse files
Sort imports
Via isort
parent
0b078403
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
28 additions
and
21 deletions
+28
-21
bitsandbytes/__init__.py
bitsandbytes/__init__.py
+1
-1
bitsandbytes/__main__.py
bitsandbytes/__main__.py
+1
-1
bitsandbytes/autograd/_functions.py
bitsandbytes/autograd/_functions.py
+3
-2
bitsandbytes/cextension.py
bitsandbytes/cextension.py
+2
-2
bitsandbytes/cuda_setup/__init__.py
bitsandbytes/cuda_setup/__init__.py
+5
-1
bitsandbytes/cuda_setup/main.py
bitsandbytes/cuda_setup/main.py
+2
-1
bitsandbytes/cuda_setup/paths.py
bitsandbytes/cuda_setup/paths.py
+1
-0
bitsandbytes/functional.py
bitsandbytes/functional.py
+4
-3
bitsandbytes/optim/__init__.py
bitsandbytes/optim/__init__.py
+4
-5
tests/test_autograd.py
tests/test_autograd.py
+1
-1
tests/test_cuda_setup_evaluator.py
tests/test_cuda_setup_evaluator.py
+4
-4
No files found.
bitsandbytes/__init__.py
View file @
7a3c9af0
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
# This source code is licensed under the MIT license found in the
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# LICENSE file in the root directory of this source tree.
from
.
import
cuda_setup
,
utils
from
.autograd._functions
import
(
from
.autograd._functions
import
(
MatmulLtState
,
MatmulLtState
,
bmm_cublas
,
bmm_cublas
,
...
@@ -12,7 +13,6 @@ from .autograd._functions import (
...
@@ -12,7 +13,6 @@ from .autograd._functions import (
)
)
from
.cextension
import
COMPILED_WITH_CUDA
from
.cextension
import
COMPILED_WITH_CUDA
from
.nn
import
modules
from
.nn
import
modules
from
.
import
cuda_setup
,
utils
if
COMPILED_WITH_CUDA
:
if
COMPILED_WITH_CUDA
:
from
.optim
import
adam
from
.optim
import
adam
...
...
bitsandbytes/__main__.py
View file @
7a3c9af0
...
@@ -28,8 +28,8 @@ print()
...
@@ -28,8 +28,8 @@ print()
from
.
import
COMPILED_WITH_CUDA
,
PACKAGE_GITHUB_URL
from
.
import
COMPILED_WITH_CUDA
,
PACKAGE_GITHUB_URL
from
.cuda_setup.main
import
get_compute_capabilities
,
get_cuda_lib_handle
from
.cuda_setup.env_vars
import
to_be_ignored
from
.cuda_setup.env_vars
import
to_be_ignored
from
.cuda_setup.main
import
get_compute_capabilities
,
get_cuda_lib_handle
print_header
(
"POTENTIALLY LIBRARY-PATH-LIKE ENV VARS"
)
print_header
(
"POTENTIALLY LIBRARY-PATH-LIKE ENV VARS"
)
for
k
,
v
in
os
.
environ
.
items
():
for
k
,
v
in
os
.
environ
.
items
():
...
...
bitsandbytes/autograd/_functions.py
View file @
7a3c9af0
import
operator
import
operator
import
warnings
import
warnings
from
dataclasses
import
dataclass
from
functools
import
reduce
# Required in Python 3
import
torch
import
torch
import
bitsandbytes.functional
as
F
import
bitsandbytes.functional
as
F
from
dataclasses
import
dataclass
from
functools
import
reduce
# Required in Python 3
# math.prod not compatible with python < 3.8
# math.prod not compatible with python < 3.8
def
prod
(
iterable
):
def
prod
(
iterable
):
...
...
bitsandbytes/cextension.py
View file @
7a3c9af0
import
ctypes
as
ct
import
ctypes
as
ct
import
torch
from
pathlib
import
Path
from
pathlib
import
Path
from
warnings
import
warn
from
warnings
import
warn
import
torch
class
CUDASetup
:
class
CUDASetup
:
_instance
=
None
_instance
=
None
...
...
bitsandbytes/cuda_setup/__init__.py
View file @
7a3c9af0
from
.paths
import
CUDA_RUNTIME_LIB
,
extract_candidate_paths
,
determine_cuda_runtime_lib_path
from
.main
import
evaluate_cuda_setup
from
.main
import
evaluate_cuda_setup
from
.paths
import
(
CUDA_RUNTIME_LIB
,
determine_cuda_runtime_lib_path
,
extract_candidate_paths
,
)
bitsandbytes/cuda_setup/main.py
View file @
7a3c9af0
...
@@ -18,9 +18,10 @@ evaluation:
...
@@ -18,9 +18,10 @@ evaluation:
import
ctypes
import
ctypes
from
.paths
import
determine_cuda_runtime_lib_path
from
bitsandbytes.cextension
import
CUDASetup
from
bitsandbytes.cextension
import
CUDASetup
from
.paths
import
determine_cuda_runtime_lib_path
def
check_cuda_result
(
cuda
,
result_val
):
def
check_cuda_result
(
cuda
,
result_val
):
# 3. Check for CUDA errors
# 3. Check for CUDA errors
...
...
bitsandbytes/cuda_setup/paths.py
View file @
7a3c9af0
import
errno
import
errno
from
pathlib
import
Path
from
pathlib
import
Path
from
typing
import
Set
,
Union
from
typing
import
Set
,
Union
from
bitsandbytes.cextension
import
CUDASetup
from
bitsandbytes.cextension
import
CUDASetup
from
.env_vars
import
get_potentially_lib_path_containing_env_vars
from
.env_vars
import
get_potentially_lib_path_containing_env_vars
...
...
bitsandbytes/functional.py
View file @
7a3c9af0
...
@@ -5,13 +5,14 @@
...
@@ -5,13 +5,14 @@
import
ctypes
as
ct
import
ctypes
as
ct
import
operator
import
operator
import
random
import
random
import
torch
from
functools
import
reduce
# Required in Python 3
from
typing
import
Tuple
from
typing
import
Tuple
import
torch
from
torch
import
Tensor
from
torch
import
Tensor
from
.cextension
import
COMPILED_WITH_CUDA
,
lib
from
.cextension
import
COMPILED_WITH_CUDA
,
lib
from
functools
import
reduce
# Required in Python 3
# math.prod not compatible with python < 3.8
# math.prod not compatible with python < 3.8
def
prod
(
iterable
):
def
prod
(
iterable
):
...
...
bitsandbytes/optim/__init__.py
View file @
7a3c9af0
...
@@ -5,12 +5,11 @@
...
@@ -5,12 +5,11 @@
from
bitsandbytes.cextension
import
COMPILED_WITH_CUDA
from
bitsandbytes.cextension
import
COMPILED_WITH_CUDA
from
.adagrad
import
Adagrad
,
Adagrad8bit
,
Adagrad32bit
from
.adam
import
Adam
,
Adam8bit
,
Adam32bit
from
.adam
import
Adam
,
Adam8bit
,
Adam32bit
from
.adamw
import
AdamW
,
AdamW8bit
,
AdamW32bit
from
.adamw
import
AdamW
,
AdamW8bit
,
AdamW32bit
from
.sgd
import
SGD
,
SGD8bit
,
SGD32bit
from
.lars
import
LARS
,
LARS8bit
,
LARS32bit
,
PytorchLARS
from
.lamb
import
LAMB
,
LAMB8bit
,
LAMB32bit
from
.lamb
import
LAMB
,
LAMB8bit
,
LAMB32bit
from
.rmsprop
import
RMSprop
,
RMSprop8bit
,
RMSprop32bit
from
.lars
import
LARS
,
LARS8bit
,
LARS32bit
,
PytorchLARS
from
.adagrad
import
Adagrad
,
Adagrad8bit
,
Adagrad32bit
from
.optimizer
import
GlobalOptimManager
from
.optimizer
import
GlobalOptimManager
from
.rmsprop
import
RMSprop
,
RMSprop8bit
,
RMSprop32bit
from
.sgd
import
SGD
,
SGD8bit
,
SGD32bit
tests/test_autograd.py
View file @
7a3c9af0
from
itertools
import
product
,
permutations
from
itertools
import
permutations
,
product
import
pytest
import
pytest
import
torch
import
torch
...
...
tests/test_cuda_setup_evaluator.py
View file @
7a3c9af0
import
os
import
os
import
pytest
import
bitsandbytes
as
bnb
from
typing
import
List
,
NamedTuple
from
typing
import
List
,
NamedTuple
import
pytest
import
bitsandbytes
as
bnb
from
bitsandbytes.cuda_setup
import
(
from
bitsandbytes.cuda_setup
import
(
CUDA_RUNTIME_LIB
,
CUDA_RUNTIME_LIB
,
evaluate_cuda_setup
,
determine_cuda_runtime_lib_path
,
determine_cuda_runtime_lib_path
,
evaluate_cuda_setup
,
extract_candidate_paths
,
extract_candidate_paths
,
)
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment