deepspeedai / deepspeedai/DeepSpeed
[REQUEST] torch.compile + DeepSpeed
Open
@tohtana is already working on this.
Since Nov 16, 2023.
enhancement
- Dominant language
- Python
- Stars
- 43.1k
- Forks
- 5k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 112
Description
I am looking into running DeepSpeed with torch.compile and facing multiple issues with respect to tracing the hooks.
DeepSpeed Stage 2 backward hook tracing with Compiled Autograd
- Accessing param.grad directly fails while tracing the model with AOTAutograd as the param.grad is not filled while tracing. This is not a recommended way of accessing the grad field with compiled autograd.
- Multiple parts of the implementation themselves lead to graph breaks like calling id(param)
With DeepSpeed Stage3 torch.compile itself fails while tracing the forward hook.
Similar issue is present with tracing model parallelism.
There is an effort from Pytorch to make FSDP traceable. Is it possible to share if there is any effort to enable DeepSpeed with torch.compile or the list of features which are supported currently with torch.compile?
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.