Skip to content

Commit 622c634

Browse files
committed
fix queue type hints using simplequeue
1 parent deb7378 commit 622c634

File tree

1 file changed

+3
-2
lines changed
  • src/lightning/fabric/strategies/launchers

1 file changed

+3
-2
lines changed

src/lightning/fabric/strategies/launchers/xla.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from typing import TYPE_CHECKING, Any, Union
1818

1919
import torch.multiprocessing as mp
20+
from torch.multiprocessing.queue import SimpleQueue
2021
from typing_extensions import override
2122

2223
from lightning.fabric.accelerators.xla import _XLA_AVAILABLE
@@ -69,7 +70,7 @@ def launch(self, function: Callable, *args: Any, **kwargs: Any) -> Any:
6970
**kwargs: Optional keyword arguments to be passed to the given function.
7071
7172
"""
72-
return_queue: queue.Queue | mp.SimpleQueue
73+
return_queue: queue.Queue | SimpleQueue
7374
return_queue = mp.Manager().Queue()
7475

7576
import torch_xla.distributed.xla_multiprocessing as xmp
@@ -97,7 +98,7 @@ def _wrapping_function(
9798
function: Callable,
9899
args: Any,
99100
kwargs: Any,
100-
return_queue: mp.SimpleQueue | queue.Queue,
101+
return_queue: queue.Queue | SimpleQueue,
101102
global_states: _GlobalStateSnapshot | None = None,
102103
) -> None:
103104
import torch_xla.core.xla_model as xm

0 commit comments

Comments
 (0)