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
29a637bc
Unverified
Commit
29a637bc
authored
Jan 30, 2024
by
Aarni Koskela
Committed by
GitHub
Jan 30, 2024
Browse files
Don't crash Python interpreter via assert(false) (#998)
parent
706ec24d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
bitsandbytes/functional.py
bitsandbytes/functional.py
+4
-1
csrc/ops.cu
csrc/ops.cu
+4
-9
No files found.
bitsandbytes/functional.py
View file @
29a637bc
...
@@ -1944,7 +1944,10 @@ def igemmlt(A, B, SA, SB, out=None, Sout=None, dtype=torch.int32):
...
@@ -1944,7 +1944,10 @@ def igemmlt(A, B, SA, SB, out=None, Sout=None, dtype=torch.int32):
ptr
,
m
,
n
,
k
,
ptrA
,
ptrB
,
ptrC
,
ptrRowScale
,
lda
,
ldb
,
ldc
ptr
,
m
,
n
,
k
,
ptrA
,
ptrB
,
ptrC
,
ptrRowScale
,
lda
,
ldb
,
ldc
)
)
if
has_error
==
1
:
if
has_error
==
100
:
# `ERR_NOT_IMPLEMENTED` is defined as 100 in `ops.cu`
raise
NotImplementedError
(
"igemmlt not available (probably built with NO_CUBLASLT)"
)
if
has_error
:
print
(
f
'A:
{
shapeA
}
, B:
{
shapeB
}
, C:
{
Sout
[
0
]
}
; (lda, ldb, ldc):
{
(
lda
,
ldb
,
ldc
)
}
; (m, n, k):
{
(
m
,
n
,
k
)
}
'
)
print
(
f
'A:
{
shapeA
}
, B:
{
shapeB
}
, C:
{
Sout
[
0
]
}
; (lda, ldb, ldc):
{
(
lda
,
ldb
,
ldc
)
}
; (m, n, k):
{
(
m
,
n
,
k
)
}
'
)
raise
Exception
(
'cublasLt ran into an error!'
)
raise
Exception
(
'cublasLt ran into an error!'
)
...
...
csrc/ops.cu
View file @
29a637bc
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
#include <cassert>
#include <cassert>
#include <common.h>
#include <common.h>
#define ERR_NOT_IMPLEMENTED 100
using
namespace
BinSearch
;
using
namespace
BinSearch
;
using
std
::
cout
;
using
std
::
cout
;
...
@@ -421,14 +423,7 @@ template void transform<int32_t, COL32, ROW, false, 32>(cublasLtHandle_t ltHandl
...
@@ -421,14 +423,7 @@ template void transform<int32_t, COL32, ROW, false, 32>(cublasLtHandle_t ltHandl
template
<
int
FORMATB
,
int
DTYPE_OUT
,
int
SCALE_ROWS
>
int
igemmlt
(
cublasLtHandle_t
ltHandle
,
int
m
,
int
n
,
int
k
,
const
int8_t
*
A
,
const
int8_t
*
B
,
void
*
C
,
float
*
row_scale
,
int
lda
,
int
ldb
,
int
ldc
)
template
<
int
FORMATB
,
int
DTYPE_OUT
,
int
SCALE_ROWS
>
int
igemmlt
(
cublasLtHandle_t
ltHandle
,
int
m
,
int
n
,
int
k
,
const
int8_t
*
A
,
const
int8_t
*
B
,
void
*
C
,
float
*
row_scale
,
int
lda
,
int
ldb
,
int
ldc
)
{
{
#ifdef NO_CUBLASLT
#ifdef NO_CUBLASLT
cout
<<
""
<<
endl
;
return
ERR_NOT_IMPLEMENTED
;
cout
<<
"============================================="
<<
endl
;
cout
<<
"ERROR: Your GPU does not support Int8 Matmul!"
<<
endl
;
cout
<<
"============================================="
<<
endl
;
cout
<<
""
<<
endl
;
assert
(
false
);
return
0
;
#else
#else
int
has_error
=
0
;
int
has_error
=
0
;
cublasLtMatmulDesc_t
matmulDesc
=
NULL
;
cublasLtMatmulDesc_t
matmulDesc
=
NULL
;
...
@@ -484,7 +479,7 @@ template <int FORMATB, int DTYPE_OUT, int SCALE_ROWS> int igemmlt(cublasLtHandle
...
@@ -484,7 +479,7 @@ template <int FORMATB, int DTYPE_OUT, int SCALE_ROWS> int igemmlt(cublasLtHandle
printf
(
"error detected"
);
printf
(
"error detected"
);
return
has_error
;
return
has_error
;
#endif
#endif
// NO_CUBLASLT
}
}
int
fill_up_to_nearest_multiple
(
int
value
,
int
multiple
)
int
fill_up_to_nearest_multiple
(
int
value
,
int
multiple
)
...
...
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