pytorch/ignite

enable automatic mixed precision for xla

开放

#1,931 创建于 2021年4月12日

 (9 条评论) (1 个反应) (0 位负责人)Python (602 个派生)batch import
enhancementhelp wanted

仓库指标

星标
 (4,313 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Feature

Automatic mixed precision for xla has landed in pytorch 1.8.1 and torch/xla nightly. We should enable it in create_supervised_* helper functions.

Suggested solution

Remove xla and amp checks in _check_arg().

  • For create_supervised_trainer, update supervised_training_step_tpu() function to accept scaler argument just like supervised_training_step_amp().
  • For create_supervised_evaluator, just removing xla and amp checks in _check_arg() should work.
  • For tests, we could remove xla checks and only run with pytorch 1.8.1.

Additional context

This feature should not be included in ignite release until the next torch and xla comes out.

贡献者指南