Skip to content

Conversation

@Crystal-jiang
Copy link
Collaborator

What does this PR do?

fix async ulysses test bug

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include misc, ci, config, docs, data, dist, omni, logging, model, optim, ckpt, release, task, perf, ops, parallel
    • If this PR involves multiple modules, separate them with , like [ci, data, model]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][parallel, model] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

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 correctly fixes a bug in the async ulysses tests where the is_torch_npu_available function was not being called, causing the tests to be skipped incorrectly. The change is simple and effective. I have also provided a suggestion to improve the maintainability of the test code by refactoring duplicated decorators.


@pytest.mark.skipif(get_torch_device().device_count() < 4, reason="device_count should be >= 4")
@pytest.mark.skipif(is_torch_npu_available, reason="npu skip async ulysses")
@pytest.mark.skipif(is_torch_npu_available(), reason="npu skip async ulysses")
Copy link
Contributor

Choose a reason for hiding this comment

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

high

While this line is now correct, the combination of skipif decorators on lines 65-66 is duplicated for test_self_attn_padding (lines 117-118). This duplication can make maintenance more difficult and error-prone. If the skip conditions need to be updated, the change must be applied in multiple places, increasing the risk of inconsistency and potentially leading to tests being skipped or run incorrectly in the future.

To improve maintainability and readability, consider combining these conditions into a single decorator. For example:

@pytest.mark.skipif(
    get_torch_device().device_count() < 4 or is_torch_npu_available(),
    reason="Requires >=4 devices and is not supported on NPU for async ulysses test"
)

Applying this pattern would make the test suite more robust. Since you are already modifying this part of the code, it would be a good opportunity to address this.

@Crystal-jiang Crystal-jiang added the ascend everything about Ascend support label Jan 7, 2026
@FoolPlayer FoolPlayer merged commit 749ea6f into ByteDance-Seed:main Jan 7, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ascend everything about Ascend support ci fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants