Skip to content

Add PEFT benchmarking script in thunder/benchmarks #2254

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

Merged
merged 13 commits into from
Jul 7, 2025
Merged

Conversation

riccardofelluga
Copy link
Collaborator

@riccardofelluga riccardofelluga commented Jun 18, 2025

What does this PR do?

This PR picks up and replaces #1978 with some tweaks. It introduces PEFT benchmarks for single gpu and multi-gpu with fsdp2 as deistributed strategy.

PR review

Can be tested by running:

python thunder/benchmarks/benchmark_peft.py --model deepseek-ai/DeepSeek-R1-Distill-Qwen-7B --trust-remote-code --attn-implementation sdpa --max-steps 10 --mbs 1 --seq-length 4096 --compile thunder --fixed-num-hidden-layers 2

Multi-GPU:

torchrun --nproc_per_node=2 thunder/benchmarks/benchmark_peft.py --model deepseek-ai/DeepSeek-R1-Distill-Qwen-7B --trust-remote-code --attn-implementation sdpa --max-steps 10 --mbs 1 --seq-length 4096 --compile thunder --fixed-num-hidden-layers 2

Side notes

I've extended the logging from the original PR and removed the prints. Now this uses the log levels to print more or less information depending on --verbose flag.

@crcrpar in the fsdp2 part I carried it over from the benchmark_litgpt.py file, but I've commented out the litgpt specific layers. I've left it there for now but I am planning to remove them after the review, let me know if you think I should find the equivalent layers in transformers and adapt that code.

cc. @wprazuch

Copy link
Contributor

@KaelanDt KaelanDt left a comment

Choose a reason for hiding this comment

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

Great add! Left some small comments

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 @riccardofelluga @KaelanDt

At some point we might look at splitting out the various requirements here, but not now.

@t-vi t-vi merged commit 9824f81 into main Jul 7, 2025
51 checks passed
@t-vi t-vi deleted the peft-benchmark branch July 7, 2025 09:31
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.

3 participants