Skip to content

upgrade to flash-attn 2.8.0.post2#2828

Merged
winglian merged 6 commits into
mainfrom
fa280p2
Jun 30, 2025
Merged

upgrade to flash-attn 2.8.0.post2#2828
winglian merged 6 commits into
mainfrom
fa280p2

Conversation

@winglian
Copy link
Copy Markdown
Collaborator

@winglian winglian commented Jun 24, 2025

Summary by CodeRabbit

  • Chores

    • Updated the CUDA version used in workflows and test matrices from 12.4.1 to 12.6.3.
    • Removed a line setting is_latest: true in workflow configuration.
    • Changed test job configurations to set axolotl_extras to an empty list.
    • Removed conditional installation of the flash-attn package in Dockerfiles.
  • New Features

    • Updated the flash-attn package version in optional dependencies to 2.8.0.post2.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 24, 2025

"""

Walkthrough

This update removes the conditional installation of flash-attn==2.7.4.post1 for PyTorch 2.7.1 from Dockerfiles, upgrades the flash-attn dependency to version 2.8.0.post2 in setup.py, and updates all GitHub Actions workflow matrices to use CUDA 12.6.3 instead of 12.4.1.

Changes

File(s) Change Summary
docker/Dockerfile-base, docker/Dockerfile-uv-base Removed conditional installation of flash-attn==2.7.4.post1 for PyTorch 2.7.1.
setup.py Upgraded flash-attn and related extras from 2.7.4.post1 to 2.8.0.post2.
.github/workflows/tests.yml, .github/workflows/main.yml, .github/workflows/multi-gpu-e2e.yml Updated CUDA versions in workflow matrices from 12.4.1/12.4 to 12.6.3/12.6; minor matrix adjustments.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Dockerfile
    participant Python Env

    GitHub Actions->>Dockerfile: Build with CUDA 12.6.3
    Dockerfile->>Python Env: Install dependencies
    Python Env->>Python Env: Install flash-attn==2.8.0.post2 (always, no conditional)
Loading

Possibly related PRs

Suggested labels

ready to merge

Suggested reviewers

  • djsaunde
  • NanoCode012

Poem

In Docker’s warren, code did hop,
Old flash-attn rules we now drop.
CUDA’s version takes a leap,
Dependencies no longer creep.
Workflows fresh with every run,
The upgrade’s here—our job is done!
🐇✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ab6c34 and c0a250b.

📒 Files selected for processing (2)
  • .github/workflows/multi-gpu-e2e.yml (1 hunks)
  • .github/workflows/tests.yml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/multi-gpu-e2e.yml
  • .github/workflows/tests.yml
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: PyTest from Source Dist (3.11, 2.6.0)
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.1)
  • GitHub Check: PyTest (3.11, 2.7.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.5.1)
  • GitHub Check: PyTest (3.11, 2.5.1)
  • GitHub Check: PyTest (3.11, 2.6.0)
  • GitHub Check: test-axolotl-multigpu (126, 12.6.3, 3.11, 2.6.0, 2, true)
  • GitHub Check: test-axolotl-multigpu (126, 12.6.3, 3.11, 2.7.1, 2, true)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
setup.py (1)

113-120: Deduplicate the flash-attn version string to prevent future drift

The literal "2.8.0.post2" is now repeated in two places. If a future upgrade is made but one location is forgotten, the extras will diverge and install conflicting wheels. Store the version in a single constant and interpolate it to keep the spec dry.

- extras_require = {
-     "flash-attn": ["flash-attn==2.8.0.post2"],
-     "ring-flash-attn": [
-         "flash-attn==2.8.0.post2",
+FLASH_ATTN_VERSION = "2.8.0.post2"
+
+extras_require = {
+    "flash-attn": [f"flash-attn=={FLASH_ATTN_VERSION}"],
+    "ring-flash-attn": [
+        f"flash-attn=={FLASH_ATTN_VERSION}",

An alternative is to loosen the pin (>=2.8.0.post2,<2.9) to pick up future micro-patches automatically while avoiding breaking changes.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4667549 and 24d68e8.

📒 Files selected for processing (3)
  • docker/Dockerfile-base (0 hunks)
  • docker/Dockerfile-uv-base (0 hunks)
  • setup.py (1 hunks)
💤 Files with no reviewable changes (2)
  • docker/Dockerfile-uv-base
  • docker/Dockerfile-base
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: PyTest (3.11, 2.5.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.6.0)
  • GitHub Check: PyTest (3.11, 2.6.0)
  • GitHub Check: PyTest (3.11, 2.7.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.5.1)
  • GitHub Check: test-axolotl-multigpu (124, 12.4.1, 3.11, 2.6.0, vllm, 2, true)
  • GitHub Check: test-axolotl-multigpu (124, 12.4.1, 3.11, 2.5.1, 2, true)

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@NanoCode012 NanoCode012 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 76a30a7 and cb74ada.

📒 Files selected for processing (5)
  • .github/workflows/tests.yml (2 hunks)
  • docker/Dockerfile-base (0 hunks)
  • docker/Dockerfile-uv-base (0 hunks)
  • setup.py (1 hunks)
  • src/axolotl/train.py (1 hunks)
💤 Files with no reviewable changes (2)
  • docker/Dockerfile-uv-base
  • docker/Dockerfile-base
🚧 Files skipped from review as they are similar to previous changes (2)
  • setup.py
  • .github/workflows/tests.yml
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: test-axolotl-multigpu (126, 12.6.3, 3.11, 2.7.1, 2, true)
  • GitHub Check: test-axolotl-multigpu (124, 12.4.1, 3.11, 2.6.0, vllm, 2, true)
  • GitHub Check: test-axolotl-multigpu (124, 12.4.1, 3.11, 2.5.1, 2, true)
  • GitHub Check: PyTest from Source Dist (3.11, 2.6.0)
  • GitHub Check: PyTest from Source Dist (3.11, 2.5.1)
  • GitHub Check: PyTest from Source Dist (3.11, 2.7.1)
  • GitHub Check: PyTest (3.11, 2.6.0)
  • GitHub Check: PyTest (3.11, 2.5.1)
  • GitHub Check: PyTest (3.11, 2.7.1)
  • GitHub Check: pre-commit

Comment thread src/axolotl/train.py
Comment on lines +226 to +228
# TODO: disabling for now as not compatible with FSDP2 + torchao low bit optimizers
# if cfg.bf16:
# torch.set_default_dtype(torch.bfloat16)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Add user notification and formal tracking for this behavior change.

This change disables automatic dtype setting when cfg.bf16=True, which could significantly impact training behavior and performance. Users may not be aware their training configuration has changed.

Consider:

  1. Adding a warning log message when cfg.bf16=True to inform users the default dtype is not being set
  2. Creating a formal issue to track re-enabling this functionality when FSDP2/torchao compatibility is resolved

Add a warning message to inform users about this behavior change:

 LOG.info("Starting trainer...")
 # TODO: disabling for now as not compatible with FSDP2 + torchao low bit optimizers
+if cfg.bf16:
+    LOG.warning("bf16 is enabled but torch.set_default_dtype(torch.bfloat16) is disabled due to FSDP2/torchao compatibility issues")
 # if cfg.bf16:
 #     torch.set_default_dtype(torch.bfloat16)
 trainer.train(resume_from_checkpoint=resume_from_checkpoint)

Verify this change doesn't break existing training workflows:


🏁 Script executed:

#!/bin/bash
# Search for tests or examples that rely on bf16 default dtype behavior
rg -A 5 -B 5 "bf16.*True|bf16.*=.*True" --type py

Length of output: 31026


🏁 Script executed:

#!/bin/bash
sed -n '200,260p' src/axolotl/train.py

Length of output: 2198


Add warning log and formally track bf16 dtype workaround

To ensure users are aware that cfg.bf16=True no longer sets the default dtype—and to make the TODO actionable—you should:

• In src/axolotl/train.py (at the LOG.info("Starting trainer...") block, lines 226–228):

 LOG.info("Starting trainer...")
 # TODO: disabling for now as not compatible with FSDP2 + torchao low bit optimizers
+# Warn users when bf16 is requested but default dtype override is disabled
+if cfg.bf16:
+    LOG.warning(
+        "bf16 is enabled but torch.set_default_dtype(torch.bfloat16) "
+        "has been disabled due to FSDP2/torchao compatibility issues."
+    )
 # if cfg.bf16:
 #     torch.set_default_dtype(torch.bfloat16)
 trainer.train(resume_from_checkpoint=resume_from_checkpoint)

• Create a tracking issue (e.g. “Re-enable torch.set_default_dtype(bfloat16) when FSDP2/torchao compatibility is resolved”) in your project’s issue tracker and reference it in the TODO comment.

• Manually verify that training runs with cfg.bf16=True still execute without silent dtype mismatches, especially for workflows depending on default bfloat16 tensors.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# TODO: disabling for now as not compatible with FSDP2 + torchao low bit optimizers
# if cfg.bf16:
# torch.set_default_dtype(torch.bfloat16)
LOG.info("Starting trainer...")
# TODO: disabling for now as not compatible with FSDP2 + torchao low bit optimizers
# Warn users when bf16 is requested but default dtype override is disabled
if cfg.bf16:
LOG.warning(
"bf16 is enabled but torch.set_default_dtype(torch.bfloat16) "
"has been disabled due to FSDP2/torchao compatibility issues."
)
# if cfg.bf16:
# torch.set_default_dtype(torch.bfloat16)
trainer.train(resume_from_checkpoint=resume_from_checkpoint)
🤖 Prompt for AI Agents
In src/axolotl/train.py around lines 226 to 228, add a warning log message near
the LOG.info("Starting trainer...") call to inform users that setting
cfg.bf16=True currently does not change the default dtype due to incompatibility
with FSDP2 and torchao low bit optimizers. Update the TODO comment to reference
a newly created tracking issue in the project’s issue tracker titled something
like “Re-enable torch.set_default_dtype(bfloat16) when FSDP2/torchao
compatibility is resolved.” Finally, manually test training runs with
cfg.bf16=True to confirm no silent dtype mismatches occur.

@winglian winglian merged commit cb811f8 into main Jun 30, 2025
19 of 20 checks passed
@winglian winglian deleted the fa280p2 branch June 30, 2025 02:11
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.

2 participants