Skip to content

Test BART's memory consumption #6045

@sshleifer

Description

@sshleifer
  • this can run on GPU only and be marked @slow
  • check how much memory bart is using at __init__
  • assert that it doesn't use more than 110% of that.
  • check how much memory bart uses on a single forward pass. (optionally test this in fp16).
  • assert that it doesn't use more than 110% of that.
  • check how much memory bart uses on a single forward and backward pass.
  • assert that it doesn't use more than 110% of that.

Bonus:

  • add similar asserts for timing!
  • let the test run and check memory on CPU (make sure that if pytest is run with -n -8 the test still passes!
  • add a test to test_modeling_common.py to make it easy for all models to test this.
  • add a test to test_modeling_common_tf.py to make it easy for all TF models to test this.

The benchmarking utilities may help.
It may also help to use torch.cuda.max_memory...

@patrickvonplaten may have further thoughts!

Metadata

Metadata

Labels

BenchmarksIssues related to Memory regressions in tests and scriptsHelp wantedExtra attention is needed, help appreciatedTestsRelated to testsWIPLabel your PR/Issue with WIP for some long outstanding Issues/PRs that are work in progress

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions