composer icon indicating copy to clipboard operation
composer copied to clipboard

Optionally use flash-attn's CE loss for metrics

Open snarayan21 opened this issue 1 year ago • 1 comments

What does this PR do?

Resubmission of https://github.com/mosaicml/composer/pull/3394 -- using FA's CE Loss results in lower peak reserved memory usage and higher throughput. We are not adding flash attention as an optional dependency to composer since this makes installs and correct builds messy & take a lot longer.

Manual tests:

Run started on dev (13b-dense-fsdp-fullshard-hsdp-adam-shardedckpt-start-5PtEdK), resumed with this branch (13b-dense-fsdp-fullshard-hsdp-adam-shardedckpt-resume-E5SieL) Run started on this branch (13b-dense-fsdp-fullshard-hsdp-adam-shardedckpt-start-0g8uD4), resumed with dev branch (13b-dense-fsdp-fullshard-hsdp-adam-shardedckpt-resume-TSGoUC) 4th time's the charm :0

Run with torch CE loss (green): tiny-sp-dtms1-32h-wCFWfa Run with FA CE loss (tan): tiny-sp-dtms1-32h-jOfIPL

What issue(s) does this change relate to?

Before submitting

  • [ ] Have you read the contributor guidelines?
  • [ ] Is this change a documentation change or typo fix? If so, skip the rest of this checklist.
  • [ ] Was this change discussed/approved in a GitHub issue first? It is much more likely to be merged if so.
  • [ ] Did you update any related docs and document your change?
  • [ ] Did you update any related tests and add any new tests related to your change? (see testing)
  • [ ] Did you run the tests locally to make sure they pass?
  • [ ] Did you run pre-commit on your change? (see the pre-commit section of prerequisites)

snarayan21 avatar Jul 31 '24 15:07 snarayan21

gloo change is in https://github.com/mosaicml/composer/pull/3509

snarayan21 avatar Aug 05 '24 20:08 snarayan21