File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -205,14 +205,14 @@ def init_device(self):
205205 assert self .local_rank < torch .cuda .device_count (), (
206206 f"DP adjusted local rank { self .local_rank } is out of bounds. "
207207 )
208- visible_device_count = (
209- torch .cuda .device_count () if torch .cuda .is_available () else 0
210- )
211- assert self .parallel_config .local_world_size <= visible_device_count , (
212- f"local_world_size ({ self .parallel_config .local_world_size } ) must be "
213- f" less than or equal to the number of visible devices "
214- f"({ visible_device_count } )."
215- )
208+ visible_device_count = (
209+ torch .cuda .device_count () if torch .cuda .is_available () else 0
210+ )
211+ assert self .parallel_config .local_world_size <= visible_device_count , (
212+ f"local_world_size ({ self .parallel_config .local_world_size } ) must "
213+ f"be less than or equal to the number of visible devices "
214+ f"({ visible_device_count } )."
215+ )
216216 self .device = torch .device (f"cuda:{ self .local_rank } " )
217217 current_platform .set_device (self .device )
218218
You can’t perform that action at this time.
0 commit comments