deepspeedai / deepspeedai/DeepSpeed

Discuss about compile config

Open
#6,683 0 comments 0 reactions 1 assignee View on GitHub

@tohtana is already working on this.

Since Oct 29, 2024.

Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

After #5581, torch dynamo can be enabled by engine.compile and there's no longer a config for that, which simplify things a lot.

Internally, we are primarily supporting a few models, specifically LLaMA and its variants. To minimize user effort, we aim to:

  1. Automatically set leaf modules: For example, LlamaDecoderLayer for LLaMA.
  2. Adjust prefetch arguments: Optimize prefetch settings when dynamo is enabled (max_live_parameters and prefetch_bucket_size to be specific)

Previously, in DeepSpeed, we could detect if dynamo was enabled via ds_config, allowing us to apply these adjustments seamlessly. However, with the recent changes, it is now challenging to determine if dynamo is enabled during the ds_init phase.

To solve that, IMO there're several options:

  1. just warn when dynamo is enabled later and the tuning I mentioned is not enabled, ask the user to change their code/config
  2. introduce new args/envs for that
  3. do that in upper layer frameworks e.g. https://github.com/oraluben/transformers/commit/7f18b1cc7b855059c8c0344290ebae96115649df and https://github.com/oraluben/accelerate/commit/113df582b266ffa929cd7ca75241aa0e5caa4212

We're currently migrating from option 2 to option 3, for that's easy to maintain and add less ad-hoc logic in deepspeed. We'd like to know your options here, not limited to if you think this is a good idea overall, what do you think is the best way to implement, would you like to get this upstreamed.

Thanks!

@tohtana @loadams cc @SunMarc @tjruwase

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.