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
xuwx1
LightX2V
Commits
bcb74974
Unverified
Commit
bcb74974
authored
Nov 28, 2025
by
Gu Shiqiao
Committed by
GitHub
Nov 28, 2025
Browse files
fix cuda stream (#532)
parent
5be4fe5a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
lightx2v/common/offload/manager.py
lightx2v/common/offload/manager.py
+8
-2
No files found.
lightx2v/common/offload/manager.py
View file @
bcb74974
...
...
@@ -6,14 +6,20 @@ from collections import OrderedDict
import
torch
from
loguru
import
logger
from
packaging.version
import
parse
class
WeightAsyncStreamManager
(
object
):
def
__init__
(
self
,
offload_granularity
):
self
.
offload_granularity
=
offload_granularity
self
.
init_stream
=
torch
.
cuda
.
Stream
(
priority
=
0
)
self
.
cuda_load_stream
=
torch
.
cuda
.
Stream
(
priority
=
1
)
self
.
compute_stream
=
torch
.
cuda
.
Stream
(
priority
=
1
)
torch_version
=
parse
(
torch
.
__version__
.
split
(
"+"
)[
0
])
if
version
>=
parse
(
"2.7"
):
self
.
cuda_load_stream
=
torch
.
cuda
.
Stream
(
priority
=
1
)
self
.
compute_stream
=
torch
.
cuda
.
Stream
(
priority
=
1
)
else
:
self
.
cuda_load_stream
=
torch
.
cuda
.
Stream
(
priority
=
0
)
self
.
compute_stream
=
torch
.
cuda
.
Stream
(
priority
=-
1
)
def
init_cuda_buffer
(
self
,
blocks_cuda_buffer
=
None
,
phases_cuda_buffer
=
None
):
if
self
.
offload_granularity
==
"block"
:
...
...
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