MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / ParallelId4MachineDeviceId

Method ParallelId4MachineDeviceId

oneflow/core/job/parallel_desc.cpp:146–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146Maybe<int64_t> ParallelDesc::ParallelId4MachineDeviceId(int64_t machine_id,
147 int64_t device_id) const {
148 const auto& machine_iter = machine_id2device_id2parallel_id_.find(machine_id);
149 CHECK_OR_RETURN(machine_iter != machine_id2device_id2parallel_id_.end());
150 const auto& device_iter = machine_iter->second.find(device_id);
151 CHECK_OR_RETURN(device_iter != machine_iter->second.end());
152 return device_iter->second;
153}
154
155Maybe<Symbol<Device>> ParallelDesc::GetTensorDevice4CurrentProcessCtx(
156 Optional<int64_t>* parallel_id) const {

Callers 8

ComputeMethod · 0.80
InitMethod · 0.80
InitMethod · 0.80
CallMethod · 0.80
GetMappedParallelIdFunction · 0.80
InferOutBlobDescsMethod · 0.80
FOR_RANGEMethod · 0.80

Calls 2

findMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected