Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve memory usage for stablecode-completion-alpha-3b #1019

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

IvanYashchuk
Copy link
Collaborator

@IvanYashchuk IvanYashchuk commented Aug 22, 2024

Running this model on DGX-H100 with FSDP was giving an OOM error. With the proposed change peak memory usage is now 67.79GB.

This works by fusing RoPE and GELU into one fusion region and allowing the rematerialization pass to recompute GELU in the backward fusion region.

More details in #246 (comment).

The following command was used to check the OOM error.

torchrun --nproc_per_node=8 thunder/benchmarks/benchmark_litgpt.py --model_name stablecode-completion-alpha-3b --compile=thunder --distributed_mode=fsdp

cc @apaz-cli

Running this model on DGX-H100 with FSDP was giving OOM error.
With the proposed change peak memory usage is now 67.79GB.

This works by fusing RoPE and GELU into one fusion region and this
allows rematerialization pass to recompute GELU in backward fusion
region.

More details in #246 (comment)
Copy link
Collaborator

@t-vi t-vi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @IvanYashchuk

@t-vi t-vi merged commit 2caf5df into main Aug 22, 2024
39 checks passed
@t-vi t-vi deleted the improve-stablecode-memory-use branch August 22, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants