MCPcopy
hub / github.com/InternLM/InternLM / is_using_dp

Method is_using_dp

internlm/core/context/parallel_context.py:240–244  ·  view source on GitHub ↗

Returns a boolean value indicating whether the current device is initilized with ParallelMode.DATA and its world_size is greater than 1.

(self)

Source from the content-addressed store, hash-verified

238 return ranks_in_group[(local_rank - 1) % world_size]
239
240 def is_using_dp(self):
241 """Returns a boolean value indicating whether the current device is initilized with
242 ParallelMode.DATA and its world_size is greater than 1.
243 """
244 return self.is_initialized(ParallelMode.DATA) and self.get_world_size(ParallelMode.DATA) > 1
245
246 def is_using_tp(self):
247 """Returns a boolean value indicating whether the current device is initilized with

Callers

nothing calls this directly

Calls 2

is_initializedMethod · 0.95
get_world_sizeMethod · 0.95

Tested by

no test coverage detected