Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Mixed Precision Training #2149

@matthew-z

Description

@matthew-z

It seems that currently there is no fp16 support in AllenNLP, but I think it is quite straightforward to do in a clean way with Apex.

Advantages of FP16:

  1. Larger batch size, especially useful for large embedding models like ELMO and BERT
  2. Faster training: the latest GPUs (P100, V100, RTX) can achieve 60-80% speed up
  3. Many experiments have showed that FP16 does not hurt accuracy for CV models.

Challenge:
Some functions in AllenNLP are not FP16 stable, such as masked_softmax

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions