Skip to content

Enable miscellaneous ruff rules #471

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

booxter
Copy link
Contributor

@booxter booxter commented Apr 15, 2025

  • chore: Enable flake8-bugbear checks
  • chore: Enable Pyflakes checks
  • chore: Enable pyupgrade
  • chore: Enable flake8-simplify

booxter added 4 commits April 15, 2025 18:00
Signed-off-by: Ihar Hrachyshka <[email protected]>
Signed-off-by: Ihar Hrachyshka <[email protected]>
Signed-off-by: Ihar Hrachyshka <[email protected]>
@mergify mergify bot added testing Relates to testing ci-failure labels Apr 15, 2025
@RobotSail
Copy link
Member

Why do we need this?

@booxter booxter marked this pull request as draft April 16, 2025 14:14
@booxter
Copy link
Contributor Author

booxter commented Apr 16, 2025

Reasons:

  • modernize code base for newer python features (e.g. not importing Optional);
  • fixing some coding issues (e.g. prepare_peft_model was using a mutable dict as default value for an argument, which is unsafe; another code was returning from under finally which potentially swallows exceptions).

@@ -732,7 +723,8 @@ class UniversalCheckpointArgs:
if UNIVERSAL_CHECKPOINT_INFO not in ds_checkpoint.global_state:
warnings.warn(
"Universal checkpoint information not found, setting it to "
"an empty dictionary."
"an empty dictionary.",
stacklevel=2,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these should probably be stacklevel=1 after all

"3. Disable flash attention by setting `disable_flash_attn=True` in your training arguments\n"
) from exc
# also verify that the flash_attn package is actually installed
if check_flash_attn_enabled(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: confirm this detection works as I expect

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

Successfully merging this pull request may close these issues.

2 participants