Skip to content

fix web-ui bug #5257

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 11 commits into from
Aug 5, 2025
Merged

fix web-ui bug #5257

merged 11 commits into from
Aug 5, 2025

Conversation

slin000111
Copy link
Collaborator

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Write the detail information belongs to this PR.
fix web-ui flash-attn, fix web-ui alert.

Experiment results

Paste your experiment result here(if needed).

Copy link
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.

Summary of Changes

Hello @slin000111, 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 addresses several web UI-related issues. It primarily corrects the default and available options for the attention mechanism in the LLM training interface, specifically updating it to flash_attention_2. Additionally, it rectifies misleading user alert messages regarding the impact of closing the terminal during training, providing accurate guidance. A minor bug fix related to updating UI elements in the base UI class is also included.

Highlights

  • Web UI Attention Mechanism Configuration: Updated the attn_impl dropdown in the LLM training UI (swift/ui/llm_train/hyper.py) to set flash_attention_2 as the default value and expanded the available choices to include None, sdpa, eager, flash_attention_2, and flash_attention_3. This addresses an issue with the Flash Attention configuration.
  • User Alert Message Correction: Corrected the submit_alert messages across various LLM training UI modules (llm_grpo.py, llm_rlhf.py, llm_train.py). The previous message incorrectly stated that closing the page would not affect training; the updated message now correctly warns users that closing the terminal will interrupt the training process.
  • UI Element Update Logic Refinement: Modified the update_all_settings method in swift/ui/base.py to use cls.valid_elements() instead of cls.elements() when returning gr.update() calls, ensuring that only valid UI elements are considered for updates.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 or fill out our survey to provide feedback.

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
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 effectively addresses bugs in the web UI. I've included suggestions to address code duplication concerning the alert message and naming consistency for flash attention implementations. Consolidating the string in the LLMTrain base class would enhance maintainability.

Comment on lines 55 to +59
'zh':
'任务已开始,请查看tensorboard或日志记录,关闭本页面不影响训练过程',
'任务已开始,请查看tensorboard或日志记录,请勿关闭终端,否则训练过程将被打断',
'en':
'Task started, please check the tensorboard or log file, '
'closing this page does not affect training'
'do not close the terminal, otherwise the training process will be interrupted'
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The submit_alert dictionary is duplicated across LLMTrain, LLMGRPO, and LLMRLHF. Since LLMGRPO inherits from LLMTrain, consider removing this submit_alert override from this file to reduce code duplication and improve maintainability.

Comment on lines 62 to +66
'zh':
'任务已开始,请查看tensorboard或日志记录,关闭本页面不影响训练过程',
'任务已开始,请查看tensorboard或日志记录,请勿关闭终端,否则训练过程将被打断',
'en':
'Task started, please check the tensorboard or log file, '
'closing this page does not affect training'
'do not close the terminal, otherwise the training process will be interrupted'
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The submit_alert is a duplicate of the one in the base class LLMTrain. To improve maintainability, consider removing this redundant override and letting the class inherit it from LLMTrain.

Comment on lines +138 to +142
gr.Dropdown(
elem_id='attn_impl',
value='flash_attention_2',
choices=[None, 'sdpa', 'eager', 'flash_attention_2', 'flash_attention_3'],
scale=20)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Consider standardizing the naming convention for flash attention implementations. Using flash_attention_2 as the default value, while the choices include flash_attention_3, suggests an inconsistency. Ensure that the naming is consistent and reflects the actual implementations available.

@slin000111 slin000111 merged commit 189ce54 into modelscope:main Aug 5, 2025
1 of 2 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants