MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / init_cuda_ctx

Function init_cuda_ctx

examples/cpp/multi_gpu_gpt/gpt_example_utils.cc:259–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259Allocator<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
274void init_nccl(const model_config_t& model_config, NcclParam& tensor_para, NcclParam& pipeline_para)
275{

Callers 1

multi_gpu_gpt_exampleFunction · 0.85

Calls 2

setDeviceDomainFunction · 0.85
getDeviceFunction · 0.85

Tested by

no test coverage detected