| 257 | } |
| 258 | |
| 259 | Allocator<AllocatorType::CUDA> init_cuda_ctx(cudaStream_t& stream, cudaDeviceProp& prop, int rank) |
| 260 | { |
| 261 | int device, device_count; |
| 262 | check_cuda_error(cudaGetDeviceCount(&device_count)); |
| 263 | check_cuda_error(cudaSetDevice(rank % device_count)); |
| 264 | check_cuda_error(cudaGetDevice(&device)); |
| 265 | printf("P%d is running with %d GPU.\n", rank, device); |
| 266 | |
| 267 | check_cuda_error(cudaGetDeviceProperties(&prop, device)); |
| 268 | printf("Device %s\n", prop.name); |
| 269 | ft_nvtx::setDeviceDomain(getDevice()); |
| 270 | |
| 271 | return Allocator<AllocatorType::CUDA>(getDevice()); |
| 272 | } |
| 273 | |
| 274 | void init_nccl(const model_config_t& model_config, NcclParam& tensor_para, NcclParam& pipeline_para) |
| 275 | { |
no test coverage detected