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
92a33630
Commit
92a33630
authored
Aug 24, 2022
by
Max Ryabinin
Browse files
Replace print_stderr with warnings.warn
parent
9fc0ab41
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
11 deletions
+4
-11
bitsandbytes/__main__.py
bitsandbytes/__main__.py
+3
-4
bitsandbytes/cuda_setup/paths.py
bitsandbytes/cuda_setup/paths.py
+1
-2
bitsandbytes/utils.py
bitsandbytes/utils.py
+0
-5
No files found.
bitsandbytes/__main__.py
View file @
92a33630
...
...
@@ -3,8 +3,9 @@
# cli()
import
os
import
sys
import
torch
from
warnings
import
warn
import
torch
HEADER_WIDTH
=
60
...
...
@@ -32,8 +33,6 @@ print()
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
.utils
import
print_stderr
print_header
(
"POTENTIALLY LIBRARY-PATH-LIKE ENV VARS"
)
for
k
,
v
in
os
.
environ
.
items
():
...
...
@@ -84,7 +83,7 @@ try:
except
ImportError
:
print
()
print_stderr
(
warn
(
f
"WARNING:
{
__package__
}
is currently running as CPU-only!
\n
"
"Therefore, 8-bit optimizers and GPU quantization are unavailable.
\n\n
"
f
"If you think that this is so erroneously,
\n
please report an issue!"
...
...
bitsandbytes/cuda_setup/paths.py
View file @
92a33630
...
...
@@ -2,7 +2,6 @@ from pathlib import Path
from
typing
import
Set
,
Union
from
warnings
import
warn
from
..utils
import
print_stderr
from
.env_vars
import
get_potentially_lib_path_containing_env_vars
CUDA_RUNTIME_LIB
:
str
=
"libcudart.so"
...
...
@@ -18,7 +17,7 @@ def remove_non_existent_dirs(candidate_paths: Set[Path]) -> Set[Path]:
}
if
non_existent_directories
:
print_stderr
(
warn
(
"WARNING: The following directories listed in your path were found to "
f
"be non-existent:
{
non_existent_directories
}
"
)
...
...
bitsandbytes/utils.py
View file @
92a33630
import
shlex
import
subprocess
import
sys
from
typing
import
Tuple
...
...
@@ -22,7 +21,3 @@ def execute_and_return(command_string: str) -> Tuple[str, str]:
std_out
,
std_err
=
execute_and_return_decoded_std_streams
(
command_string
)
return
std_out
,
std_err
def
print_stderr
(
s
:
str
)
->
None
:
print
(
s
,
file
=
sys
.
stderr
)
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