Skip to content

Silence Apex Aiter RoPE warning unless logging is enabled#4058

Merged
danielhanchen merged 2 commits into
mainfrom
fix/silence-apex-aiter-warning
Feb 15, 2026
Merged

Silence Apex Aiter RoPE warning unless logging is enabled#4058
danielhanchen merged 2 commits into
mainfrom
fix/silence-apex-aiter-warning

Conversation

@danielhanchen
Copy link
Copy Markdown
Member

Summary

This PR silences the Apex ROCm fused RoPE Aiter precision warning by default and keeps it visible when UNSLOTH_ENABLE_LOGGING is enabled.

Changes

  • unsloth/import_fixes.py
    • Switched the suppression gate from a strict string check to the parsed boolean:
      • from if os.environ.get("UNSLOTH_ENABLE_LOGGING", "0") != "1":
      • to if not UNSLOTH_ENABLE_LOGGING:
    • Added a targeted warning filter under the non-logging path:
      • message prefix: Aiter backend is selected for fused RoPE.
      • category: UserWarning
      • module: apex.transformer.functional.fused_rope

Why

  • Users on ROCm see this warning frequently even when they run with normal non-verbose defaults.
  • The warning is still available when verbose logging is explicitly enabled.
  • The module and category scoped filter avoids over-suppressing unrelated warnings.

Validation

  • python -m py_compile unsloth/import_fixes.py
  • Local-source smoke checks:
    • UNSLOTH_ENABLE_LOGGING=0 -> warning suppressed
    • UNSLOTH_ENABLE_LOGGING=1 -> warning shown

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @danielhanchen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request aims to improve the user experience by reducing unnecessary warning messages, specifically the Apex ROCm fused RoPE Aiter precision warning, which frequently appeared for ROCm users. By default, this warning is now suppressed, but it can be re-enabled through a logging environment variable, ensuring that critical information is still available when verbose logging is desired. The changes ensure that only the intended warning is affected, maintaining the integrity of other system warnings.

Highlights

  • Warning Suppression: The Apex ROCm fused RoPE Aiter precision warning is now silenced by default to reduce noise for users, especially those on ROCm.
  • Conditional Logging: The warning remains visible when UNSLOTH_ENABLE_LOGGING is explicitly enabled, allowing for verbose debugging when needed.
  • Targeted Filtering: A specific warnings.filterwarnings rule was added to target only the 'Aiter backend is selected for fused RoPE' message from the apex.transformer.functional.fused_rope module, preventing over-suppression of other warnings.
  • Code Logic Update: The condition for applying warning filters in unsloth/import_fixes.py was updated from a string comparison to a direct boolean check of UNSLOTH_ENABLE_LOGGING.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • unsloth/import_fixes.py
    • Modified the conditional check for applying warning filters from os.environ.get("UNSLOTH_ENABLE_LOGGING", "0") != "1" to not UNSLOTH_ENABLE_LOGGING.
    • Added a new warnings.filterwarnings entry to ignore UserWarning messages with the pattern ^Aiter backend is selected for fused RoPE\. originating from the apex.transformer.functional.fused_rope module.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to silence a specific warning from Apex on ROCm systems by default, which is a good user experience improvement. The change to use the pre-parsed UNSLOTH_ENABLE_LOGGING boolean is a great simplification and also fixes a subtle bug in the process. The new warning filter is well-scoped. I've added one suggestion to make the message filter slightly more robust to future changes in the warning text.

Comment thread unsloth/import_fixes.py Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@danielhanchen danielhanchen merged commit 86fde76 into main Feb 15, 2026
3 checks passed
@danielhanchen danielhanchen deleted the fix/silence-apex-aiter-warning branch February 15, 2026 06:14
abiswas-realadvice pushed a commit to abiswas-realadvice/unsloth that referenced this pull request May 14, 2026
…4058)

* Silence Apex Aiter RoPE warning unless logging is enabled

* Update unsloth/import_fixes.py

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: Daniel Hanchen <danielhanchen@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

1 participant