MCPcopy Create free account
hub / github.com/InternLM/InternBootcamp / intersect

Method intersect

verl/verl/utils/profiler/config.py:141–153  ·  view source on GitHub ↗
(self, other: "ProfilerConfig")

Source from the content-addressed store, hash-verified

139 )
140
141 def intersect(self, other: "ProfilerConfig") -> "ProfilerConfig":
142 assert self.tool == other.tool, (
143 f"Cannot intersect ProfilerConfig with different tools: {self.tool} vs {other.tool}"
144 )
145 return ProfilerConfig(
146 tool=self.tool,
147 enable=self.enable and other.enable,
148 all_ranks=self.all_ranks and other.all_ranks,
149 ranks=list(set(self.ranks or []) & set(other.ranks or [])),
150 save_path=self.save_path,
151 tool_config=self.tool_config,
152 global_tool_config=self.global_tool_config if self.global_tool_config else other.global_tool_config,
153 )
154
155 def __post_init__(self) -> None:
156 """config validation logics go here"""

Callers 4

_compute_regionsMethod · 0.80
_compute_regionsMethod · 0.80
_compute_regionsMethod · 0.80

Calls 1

ProfilerConfigClass · 0.85

Tested by 1