File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import os
1516from datetime import timedelta
1617
1718import torch
@@ -37,8 +38,14 @@ def allow_tf32(flag=True):
3738
3839allow_tf32 ()
3940
41+ IS_CPU = bool (int (os .environ .get ("ACCMT_CPU" , 0 )))
42+ IS_GPU = not IS_CPU
43+
4044_init_kwargs = InitProcessGroupKwargs (timeout = timedelta (seconds = 86400 ))
4145_dataloader_config = DataLoaderConfiguration (use_seedable_sampler = True )
4246accelerator = Accelerator (
43- kwargs_handlers = [_init_kwargs ], dataloader_config = _dataloader_config , step_scheduler_with_optimizer = False
47+ kwargs_handlers = [_init_kwargs ],
48+ dataloader_config = _dataloader_config ,
49+ step_scheduler_with_optimizer = False ,
50+ cpu = IS_CPU ,
4451)
You can’t perform that action at this time.
0 commit comments