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
TransformerEngine
Commits
8fda607c
Commit
8fda607c
authored
Apr 29, 2025
by
yuguo
Browse files
[DCU] Fix WS leak when init+destroy ub more than 1
parent
9da3621b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
transformer_engine/pytorch/module/base.py
transformer_engine/pytorch/module/base.py
+8
-2
No files found.
transformer_engine/pytorch/module/base.py
View file @
8fda607c
...
...
@@ -225,9 +225,15 @@ def initialize_ub(
flush
=
True
,
)
#
Increase the workspace by the number of maximum concurrent stream
s
#
Allocate cuBLAS workspace with expanded size for chunking in overlapping GEMM call
s
global
_cublas_workspace
_cublas_workspace
=
get_workspace
().
repeat
(
_NUM_MAX_UB_STREAMS
)
if
_cublas_workspace
is
None
:
_cublas_workspace
=
get_workspace
().
repeat
(
_NUM_MAX_UB_STREAMS
)
elif
_cublas_workspace
.
numel
()
!=
get_cublas_workspace_size_bytes
()
*
_NUM_MAX_UB_STREAMS
:
# This ensures we don't do `.repeat()` on an already expanded workspace
_cublas_workspace
=
torch
.
empty
(
get_cublas_workspace_size_bytes
(),
dtype
=
torch
.
uint8
,
device
=
"cuda"
).
repeat
(
_NUM_MAX_UB_STREAMS
)
# Default buffer precision: AllGather buffers use fp8 when using fp8 recipe
layers_all_gather_overlap
=
[
...
...
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