-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for warning as default stream was used in enqueueV3 #3191
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
from tempfile import tempdir | ||
from typing import Any, Dict, List, Optional, Sequence, Tuple | ||
|
||
import tensorrt as trt | ||
import torch | ||
import torch_tensorrt | ||
from torch.nn import Module | ||
|
@@ -19,8 +20,6 @@ | |
multi_gpu_device_check, | ||
) | ||
|
||
import tensorrt as trt | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
|
@@ -372,8 +371,6 @@ def forward(self, *inputs: torch.Tensor) -> torch.Tensor | Tuple[torch.Tensor, . | |
or self._engine_stream is None | ||
): | ||
self._engine_stream = torch.cuda.Stream() | ||
else: | ||
self._engine_stream = self._caller_stream | ||
|
||
self._engine_stream.wait_stream(self._caller_stream) | ||
|
||
|
@@ -464,7 +461,8 @@ def cudagraphs_validate_shapes(self, inputs: Sequence[torch.Tensor]) -> bool: | |
if new_shape_key != self.shape_key: | ||
logger.debug(f"Resetting Cudagraph on new shape key {new_shape_key}") | ||
self.shape_key = new_shape_key | ||
self.cudagraph.reset() # type: ignore | ||
if self.cudagraph: | ||
self.cudagraph.reset() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. self.cudagraph can be None when torch_compile backend is used. self.cudagraph is initialized when cudagraphs mode is enabled. But this init was called at compile() |
||
return False | ||
|
||
return True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was reverted to fix below assert() from torch. We don't share memory across captures, I think we can use internally created pool.
https://pytorch.org/docs/stable/notes/cuda.html#graph-memory-management