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
deepspeed
Commits
24e07399
Unverified
Commit
24e07399
authored
Jan 04, 2021
by
Jeff Rasley
Committed by
GitHub
Jan 04, 2021
Browse files
update SA comp check to fix torch-cpu issue (#631)
parent
81aeea36
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
op_builder/sparse_attn.py
op_builder/sparse_attn.py
+14
-1
No files found.
op_builder/sparse_attn.py
View file @
24e07399
...
...
@@ -25,6 +25,18 @@ class SparseAttnBuilder(OpBuilder):
command_status
=
list
(
map
(
self
.
command_exists
,
required_commands
))
deps_compatible
=
all
(
command_status
)
# torch-cpu will not have a cuda version
if
torch
.
version
.
cuda
is
None
:
cuda_compatible
=
False
self
.
warning
(
f
"
{
self
.
NAME
}
cuda is not available from torch"
)
else
:
major
,
minor
=
torch
.
version
.
cuda
.
split
(
'.'
)[:
2
]
cuda_compatible
=
int
(
major
)
==
10
and
int
(
minor
)
>=
1
if
not
cuda_compatible
:
self
.
warning
(
f
"
{
self
.
NAME
}
requires CUDA version 10.1+, does not currently support >=11 or <10.1"
)
TORCH_MAJOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
0
])
TORCH_MINOR
=
int
(
torch
.
__version__
.
split
(
'.'
)[
1
])
torch_compatible
=
TORCH_MAJOR
==
1
and
TORCH_MINOR
>=
5
...
...
@@ -33,4 +45,5 @@ class SparseAttnBuilder(OpBuilder):
f
'
{
self
.
NAME
}
requires a torch version >= 1.5 but detected
{
TORCH_MAJOR
}
.
{
TORCH_MINOR
}
'
)
return
super
().
is_compatible
()
and
deps_compatible
and
torch_compatible
return
super
().
is_compatible
(
)
and
deps_compatible
and
torch_compatible
and
cuda_compatible
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