[Bug] Fix tests/distributed/test_elastic_ep.py - assert False (#43813)
Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
+6
-2
@@ -117,8 +117,12 @@ class CpuGpuBuffer:
|
|||||||
pin_memory: bool,
|
pin_memory: bool,
|
||||||
with_numpy: bool = True,
|
with_numpy: bool = True,
|
||||||
) -> None:
|
) -> None:
|
||||||
self.cpu = torch.zeros(*size, dtype=dtype, device="cpu", pin_memory=pin_memory)
|
# these buffers are mutable runtime state, so allocate them as normal
|
||||||
self.gpu = torch.zeros_like(self.cpu, device=device)
|
with torch.inference_mode(False):
|
||||||
|
self.cpu = torch.zeros(
|
||||||
|
*size, dtype=dtype, device="cpu", pin_memory=pin_memory
|
||||||
|
)
|
||||||
|
self.gpu = torch.zeros_like(self.cpu, device=device)
|
||||||
self.np: np.ndarray
|
self.np: np.ndarray
|
||||||
# To keep type hints simple (avoiding generics and subclasses), we
|
# To keep type hints simple (avoiding generics and subclasses), we
|
||||||
# only conditionally create the numpy array attribute. This can cause
|
# only conditionally create the numpy array attribute. This can cause
|
||||||
|
|||||||
Reference in New Issue
Block a user