Update Optional[x] -> x | None and Union[x, y] to x | y (#26633)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
Harry Mellor
2025-10-12 09:51:31 -07:00
committed by GitHub
parent 9bb38130cb
commit 8fcaaf6a16
944 changed files with 9490 additions and 10121 deletions
+3 -3
View File
@@ -4,7 +4,7 @@
import os
import time
from collections import defaultdict
from typing import TYPE_CHECKING, Optional, Union
from typing import TYPE_CHECKING, Union
import msgspec
@@ -72,7 +72,7 @@ try:
def execute_model_spmd(
self,
req_or_tuple: Union[bytes, tuple[bytes, Optional[IntermediateTensors]]],
req_or_tuple: bytes | tuple[bytes, IntermediateTensors | None],
) -> bytes:
"""Execute model in SPMD fashion: used only when SPMD worker and
compiled DAG are both enabled.
@@ -300,7 +300,7 @@ def _wait_until_pg_removed(current_placement_group: "PlacementGroup"):
def initialize_ray_cluster(
parallel_config: ParallelConfig,
ray_address: Optional[str] = None,
ray_address: str | None = None,
):
"""Initialize the distributed cluster with Ray.