deepspeedai / deepspeedai/DeepSpeed
Discuss about compile config
@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:
- Automatically set leaf modules: For example,
LlamaDecoderLayerfor LLaMA. - Adjust prefetch arguments: Optimize prefetch settings when dynamo is enabled (
max_live_parametersandprefetch_bucket_sizeto 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:
- just warn when dynamo is enabled later and the tuning I mentioned is not enabled, ask the user to change their code/config
- introduce new args/envs for that
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.