File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 33import os
44from typing import Tuple
55
6+ from tpu_inference import envs
7+
68PREFILL_SLICES = 'PREFILL_SLICES'
79DECODE_SLICES = 'DECODE_SLICES'
810
@@ -11,7 +13,7 @@ def is_disagg_enabled() -> bool:
1113 # We triggrer our code path as long as prefill slices are set. This
1214 # allows us to test interleave mode effectively with the code path
1315 # for comparison purposes.
14- return PREFILL_SLICES in os . environ
16+ return bool ( envs . PREFILL_SLICES )
1517
1618
1719def _parse_slices (slices_str : str ) -> Tuple [int , ...]:
@@ -40,12 +42,12 @@ def _parse_slices(slices_str: str) -> Tuple[int, ...]:
4042
4143
4244def get_prefill_slices () -> Tuple [int , ...]:
43- if PREFILL_SLICES not in os . environ :
45+ if not envs . PREFILL_SLICES :
4446 return ()
45- return _parse_slices (os . environ [ PREFILL_SLICES ] )
47+ return _parse_slices (envs . PREFILL_SLICES )
4648
4749
4850def get_decode_slices () -> Tuple [int , ...]:
49- if DECODE_SLICES not in os . environ :
51+ if not envs . DECODE_SLICES :
5052 return ()
51- return _parse_slices (os . environ [ DECODE_SLICES ] )
53+ return _parse_slices (envs . DECODE_SLICES )
You can’t perform that action at this time.
0 commit comments