Skip to content

A small refactor, move 4d mask to processor#167

Merged
tastelikefeet merged 2 commits intomodelscope:mainfrom
tastelikefeet:fix/0418-2
Apr 18, 2026
Merged

A small refactor, move 4d mask to processor#167
tastelikefeet merged 2 commits intomodelscope:mainfrom
tastelikefeet:fix/0418-2

Conversation

@tastelikefeet
Copy link
Copy Markdown
Collaborator

PR type

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

PR information

Write the detail information belongs to this PR.

Experiment results

Paste your experiment result here(if needed).

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 refactors the NPU causal 4D mask removal logic by moving it from the Megatron model class to the processor base class. The processor now receives the model configuration to determine if the mask should be dropped. A review comment suggests optimizing the retrieval of the model configuration in the forward_backward method by using self.strategy.config directly instead of unwrapping the model to improve efficiency.

Comment thread src/twinkle/model/megatron/megatron.py
@tastelikefeet tastelikefeet merged commit 7ca9da1 into modelscope:main Apr 18, 2026
1 of 3 checks passed
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