Skip to content

[CI] Fix slow grpo CI #3693

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 4 commits into from
Jul 4, 2025
Merged

[CI] Fix slow grpo CI #3693

merged 4 commits into from
Jul 4, 2025

Conversation

kashif
Copy link
Collaborator

@kashif kashif commented Jul 4, 2025

What does this PR do?

We now check if flash_attn is installed and if not use the sdpa_paged in the transformers paged attention slow test

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a GitHub issue? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@kashif
Copy link
Collaborator Author

kashif commented Jul 4, 2025

@ArthurZucker the paged attention CI was failing since it didnt find flash_attn, so i replaced the check with is_flash_attn_2_available do you think that is reasonable?

@kashif kashif requested a review from Copilot July 4, 2025 14:04
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances CI for the GRPO trainer by preferring FlashAttention v2 when available, updates a comment for consistency in the vLLM serve script, and fixes a markdown warning in the SFT trainer docs.

  • Import and use is_flash_attn_2_available instead of solely relying on torch.cuda.is_available
  • Update a misaligned example comment in vllm_serve.py to match actual dtype usage
  • Wrap the {% generation %} tag in a raw block in the SFT trainer docs warning

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
trl/trainer/grpo_trainer.py Added import of is_flash_attn_2_available and replaced the CUDA check for attention
trl/scripts/vllm_serve.py Corrected comment to show "torch.float32" as a string in collective_rpc example
docs/source/sft_trainer.md Changed warning block to use a raw tag around {% generation %}

@kashif kashif self-assigned this Jul 4, 2025
@kashif kashif merged commit db19d79 into main Jul 4, 2025
11 checks passed
@kashif kashif deleted the fix-ci-slow-grpo branch July 4, 2025 17:46
@ArthurZucker
Copy link
Contributor

Yes completely! Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants