[Core][Bugfix]Refactor block manager for better testability (#3492)
This commit is contained in:
@@ -227,6 +227,16 @@ def set_cuda_visible_devices(device_ids: List[int]) -> None:
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = ",".join(map(str, device_ids))
|
||||
|
||||
|
||||
def chunk_list(lst, chunk_size):
|
||||
"""Yield successive chunk_size chunks from lst."""
|
||||
return [lst[i:i + chunk_size] for i in range(0, len(lst), chunk_size)]
|
||||
|
||||
|
||||
def cdiv(a: int, b: int) -> int:
|
||||
"""Ceiling division."""
|
||||
return -(a // -b)
|
||||
|
||||
|
||||
@lru_cache(maxsize=None)
|
||||
def get_nvcc_cuda_version() -> Optional[Version]:
|
||||
cuda_home = os.environ.get('CUDA_HOME')
|
||||
|
||||
Reference in New Issue
Block a user