[Hardware][Neuron] Refactor neuron support (#3471)

This commit is contained in:
Zhuohan Li
2024-03-22 01:22:17 +00:00
committed by GitHub
parent ea5f14e6ff
commit e90fc21f2e
33 changed files with 615 additions and 549 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ class Worker:
self.cache_engine = None
self.gpu_cache = None
def init_model(self, cupy_port: Optional[int] = None) -> None:
def init_device(self, cupy_port: Optional[int] = None) -> None:
if self.device_config.device.type == "cuda":
# torch.distributed.all_reduce does not free the input tensor until
# the synchronization point. This causes the memory usage to grow
@@ -91,7 +91,7 @@ class Worker:
# Initialize the distributed environment.
init_distributed_environment(self.parallel_config, self.rank,
cupy_port, self.distributed_init_method)
# Initialize the model.
# Set random seed.
set_random_seed(self.model_config.seed)
def load_model(self):