Skip to content

Refactor modeling tests#482

Merged
yzhangcs merged 5 commits intomainfrom
modeling
Jun 24, 2025
Merged

Refactor modeling tests#482
yzhangcs merged 5 commits intomainfrom
modeling

Conversation

@yzhangcs
Copy link
Copy Markdown
Member

@yzhangcs yzhangcs commented Jun 24, 2025

Summary by CodeRabbit

  • Refactor
    • Consolidated test parameterization for modeling and generation tests across multiple model test suites, improving readability and maintainability.
    • Updated test function signatures to include explicit type annotations.
    • Standardized test case IDs for clearer test identification.
    • Unified parameter ordering and naming conventions in test functions.
    • Renamed some test functions for consistency.
    • Improved parameter passing style in core test helpers for clarity.
    • Renamed constants for consistency in test utilities.
  • Chores
    • Enhanced CI workflows to run tests with verbose and unbuffered output for improved logging and debugging.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jun 24, 2025

Caution

Review failed

The pull request is closed.

"""

Walkthrough

This change refactors the test parameterization for modeling and generation tests across multiple model test files. Multiple stacked pytest.mark.parametrize decorators are consolidated into single decorators that accept all parameters as tuples, with explicit test IDs and type annotations added. Some test functions were renamed for consistency. The test logic remains unchanged.

Changes

Files (grouped) Change Summary
tests/models/test_modeling_abc.py
tests/models/test_modeling_bitnet.py
tests/models/test_modeling_comba.py
tests/models/test_modeling_deltanet.py
tests/models/test_modeling_forgetting_transformer.py
tests/models/test_modeling_gated_deltanet.py
tests/models/test_modeling_gated_deltaproduct.py
tests/models/test_modeling_gla.py
tests/models/test_modeling_gsa.py
tests/models/test_modeling_hgrn.py
tests/models/test_modeling_lightnet.py
tests/models/test_modeling_linear_attn.py
tests/models/test_modeling_mamba.py
tests/models/test_modeling_mesanet.py
tests/models/test_modeling_nsa.py
tests/models/test_modeling_path_attn.py
tests/models/test_modeling_retnet.py
tests/models/test_modeling_rodimus.py
tests/models/test_modeling_samba.py
tests/models/test_modeling_transformer.py
Refactored test parameterization: replaced multiple pytest.mark.parametrize decorators with single decorators taking parameter tuples; added explicit test IDs and type annotations to test function signatures. Test logic and helper calls unchanged.
tests/models/test_modeling_hgrn2.py
tests/models/test_modeling_mamba2.py
tests/models/test_modeling_rwkv6.py
tests/models/test_modeling_rwkv7.py
Renamed test functions for consistency (e.g., test_rwkv6_modelingtest_modeling); consolidated parameterization into single decorators with explicit test IDs and type annotations.
tests/models/test_modeling_base.py Updated function signature of run_test_model_forward_backward to reorder parameters; changed calls to create_model_and_config to use keyword arguments for use_l2warp and dtype.
.github/workflows/intel-a770.yml
.github/workflows/nvidia-4090.yml
.github/workflows/nvidia-a100.yml
.github/workflows/nvidia-h100.yml
Updated pytest invocations in CI workflows to include -s and -v flags for disabling output capture and enabling verbose output. No other logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant Pytest
    participant TestFunction
    participant ModelTestHelper

    Pytest->>TestFunction: Run test_modeling/test_generation with parameter tuple
    TestFunction->>ModelTestHelper: Call run_test_model_forward_backward or run_test_generation with parameters
    ModelTestHelper-->>TestFunction: Return test result
    TestFunction-->>Pytest: Report result
Loading

Possibly related PRs

Poem

A bunny hopped through fields of code,
Where test cases once were overflowed.
Now tuples leap with tidy grace,
IDs and types in every place.
With pytest’s help, the tests unite—
Parameter joy, oh what a sight!
🐇✨
"""


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8238ded and d5c7aa2.

📒 Files selected for processing (4)
  • tests/models/test_modeling_abc.py (1 hunks)
  • tests/models/test_modeling_base.py (4 hunks)
  • tests/models/test_modeling_path_attn.py (1 hunks)
  • tests/models/testing_utils.py (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate Unit Tests
  • Create PR with Unit Tests
  • Post Copyable Unit Tests in Comment
  • Commit Unit Tests in branch modeling

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 10

🧹 Nitpick comments (6)
tests/models/test_modeling_bitnet.py (1)

14-33: Fix parameter order inconsistency between decorator and function signature.

The parameter order in the @pytest.mark.parametrize decorator doesn't match the function signature order:

  • Decorator: ['L', 'B', 'T', 'H', 'D', 'use_l2warp', 'dtype']
  • Function: (L, B, T, H, D, dtype, use_l2warp)

While pytest matches parameters by name, this inconsistency reduces code readability and maintainability.

 @pytest.mark.parametrize(
-    ['L', 'B', 'T', 'H', 'D', 'use_l2warp', 'dtype'],
+    ['L', 'B', 'T', 'H', 'D', 'dtype', 'use_l2warp'],
     [
-        pytest.param(*test, id="L{}-B{}-T{}-H{}-D{}-use_l2warp{}-{}".format(*test))
+        pytest.param(*test, id="L{}-B{}-T{}-H{}-D{}-{}-use_l2warp{}".format(*test))
         for test in [
-            (4, 4, 1024, 4, 64, True, torch.bfloat16),
-            (4, 4, 1024, 4, 64, False, torch.bfloat16),
-            (4, 4, 1024, 4, 128, False, torch.bfloat16),
+            (4, 4, 1024, 4, 64, torch.bfloat16, True),
+            (4, 4, 1024, 4, 64, torch.bfloat16, False),
+            (4, 4, 1024, 4, 128, torch.bfloat16, False),
         ]
     ]
 )
tests/models/test_modeling_abc.py (1)

14-33: Fix ID format string to match parameter order.

The test case tuples have dtype before use_l2warp (matching the parameter order), but the ID format string shows use_l2warp before dtype.

-        pytest.param(*test, id="L{}-B{}-T{}-H{}-D{}-use_l2warp{}-{}".format(*test))
+        pytest.param(*test, id="L{}-B{}-T{}-H{}-D{}-{}-use_l2warp{}".format(*test))
tests/models/test_modeling_mesanet.py (1)

14-33: Fix parameter order inconsistency between decorator and function signature.

Same issue as in other test files - the parameter order in the decorator doesn't match the function signature:

  • Decorator: ['L', 'B', 'T', 'H', 'D', 'use_l2warp', 'dtype']
  • Function: (L, B, T, H, D, dtype, use_l2warp)
 @pytest.mark.parametrize(
-    ['L', 'B', 'T', 'H', 'D', 'use_l2warp', 'dtype'],
+    ['L', 'B', 'T', 'H', 'D', 'dtype', 'use_l2warp'],
     [
-        pytest.param(*test, id="L{}-B{}-T{}-H{}-D{}-use_l2warp{}-{}".format(*test))
+        pytest.param(*test, id="L{}-B{}-T{}-H{}-D{}-{}-use_l2warp{}".format(*test))
         for test in [
-            (4, 4, 1024, 4, 64, True, torch.bfloat16),
-            (4, 4, 1024, 4, 64, False, torch.bfloat16),
-            (4, 4, 1024, 4, 128, False, torch.bfloat16),
+            (4, 4, 1024, 4, 64, torch.bfloat16, True),
+            (4, 4, 1024, 4, 64, torch.bfloat16, False),
+            (4, 4, 1024, 4, 128, torch.bfloat16, False),
         ]
     ]
 )
tests/models/test_modeling_forgetting_transformer.py (1)

14-33: Fix parameter order inconsistency between decorator and function signature.

The parameter order mismatch reduces code readability:

  • Decorator: ['L', 'B', 'T', 'H', 'D', 'use_l2warp', 'dtype']
  • Function: (L, B, T, H, D, dtype, use_l2warp)
 @pytest.mark.parametrize(
-    ['L', 'B', 'T', 'H', 'D', 'use_l2warp', 'dtype'],
+    ['L', 'B', 'T', 'H', 'D', 'dtype', 'use_l2warp'],
     [
-        pytest.param(*test, id="L{}-B{}-T{}-H{}-D{}-use_l2warp{}-{}".format(*test))
+        pytest.param(*test, id="L{}-B{}-T{}-H{}-D{}-{}-use_l2warp{}".format(*test))
         for test in [
-            (4, 4, 1024, 4, 64, True, torch.bfloat16),
-            (4, 4, 1024, 4, 64, False, torch.bfloat16),
-            (4, 4, 1024, 4, 128, False, torch.bfloat16),
+            (4, 4, 1024, 4, 64, torch.bfloat16, True),
+            (4, 4, 1024, 4, 64, torch.bfloat16, False),
+            (4, 4, 1024, 4, 128, torch.bfloat16, False),
         ]
     ]
 )
tests/models/test_modeling_deltanet.py (1)

14-33: Fix parameter order inconsistency between decorator and function signature.

The parameter order mismatch affects code readability:

  • Decorator: ['L', 'B', 'T', 'H', 'D', 'use_l2warp', 'dtype']
  • Function: (L, B, T, H, D, dtype, use_l2warp)
 @pytest.mark.parametrize(
-    ['L', 'B', 'T', 'H', 'D', 'use_l2warp', 'dtype'],
+    ['L', 'B', 'T', 'H', 'D', 'dtype', 'use_l2warp'],
     [
-        pytest.param(*test, id="L{}-B{}-T{}-H{}-D{}-use_l2warp{}-{}".format(*test))
+        pytest.param(*test, id="L{}-B{}-T{}-H{}-D{}-{}-use_l2warp{}".format(*test))
         for test in [
-            (4, 4, 1024, 4, 64, True, torch.bfloat16),
-            (4, 4, 1024, 4, 64, False, torch.bfloat16),
-            (4, 4, 1024, 4, 128, False, torch.bfloat16),
+            (4, 4, 1024, 4, 64, torch.bfloat16, True),
+            (4, 4, 1024, 4, 64, torch.bfloat16, False),
+            (4, 4, 1024, 4, 128, torch.bfloat16, False),
         ]
     ]
 )
tests/models/test_modeling_hgrn2.py (1)

14-33: Refactoring quality is excellent, but naming inconsistency detected.

The parameterization consolidation and type annotations are well-implemented and follow the same high-quality pattern as other files. However, there's a naming inconsistency: this function is named test_hgrn2_modeling while equivalent functions in other files are named test_modeling.

For consistency across the test suite, consider renaming to test_modeling to match the pattern in other model test files.

-def test_hgrn2_modeling(
+def test_modeling(
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22d5d34 and 679fc11.

📒 Files selected for processing (24)
  • tests/models/test_modeling_abc.py (1 hunks)
  • tests/models/test_modeling_bitnet.py (1 hunks)
  • tests/models/test_modeling_comba.py (1 hunks)
  • tests/models/test_modeling_deltanet.py (1 hunks)
  • tests/models/test_modeling_forgetting_transformer.py (1 hunks)
  • tests/models/test_modeling_gated_deltanet.py (1 hunks)
  • tests/models/test_modeling_gated_deltaproduct.py (1 hunks)
  • tests/models/test_modeling_gla.py (1 hunks)
  • tests/models/test_modeling_gsa.py (1 hunks)
  • tests/models/test_modeling_hgrn.py (1 hunks)
  • tests/models/test_modeling_hgrn2.py (1 hunks)
  • tests/models/test_modeling_lightnet.py (1 hunks)
  • tests/models/test_modeling_linear_attn.py (1 hunks)
  • tests/models/test_modeling_mamba.py (1 hunks)
  • tests/models/test_modeling_mamba2.py (1 hunks)
  • tests/models/test_modeling_mesanet.py (1 hunks)
  • tests/models/test_modeling_nsa.py (1 hunks)
  • tests/models/test_modeling_path_attn.py (1 hunks)
  • tests/models/test_modeling_retnet.py (1 hunks)
  • tests/models/test_modeling_rodimus.py (1 hunks)
  • tests/models/test_modeling_rwkv6.py (1 hunks)
  • tests/models/test_modeling_rwkv7.py (1 hunks)
  • tests/models/test_modeling_samba.py (1 hunks)
  • tests/models/test_modeling_transformer.py (1 hunks)
🧰 Additional context used
🪛 Pylint (3.3.7)
tests/models/test_modeling_mamba2.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_gsa.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_nsa.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_rwkv7.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 50-50: Too many arguments (6/5)

(R0913)


[refactor] 50-50: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_path_attn.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_deltanet.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_abc.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_samba.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_linear_attn.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_gated_deltanet.py

[refactor] 24-24: Too many arguments (7/5)

(R0913)


[refactor] 24-24: Too many positional arguments (7/5)

(R0917)


[refactor] 48-48: Too many arguments (6/5)

(R0913)


[refactor] 48-48: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_gated_deltaproduct.py

[refactor] 28-28: Too many arguments (7/5)

(R0913)


[refactor] 28-28: Too many positional arguments (7/5)

(R0917)

tests/models/test_modeling_lightnet.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_comba.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_hgrn.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_bitnet.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_retnet.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_mamba.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_transformer.py

[refactor] 28-28: Too many arguments (7/5)

(R0913)


[refactor] 28-28: Too many positional arguments (7/5)

(R0917)


[refactor] 52-52: Too many arguments (6/5)

(R0913)


[refactor] 52-52: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_rwkv6.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_forgetting_transformer.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_gla.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_mesanet.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_rodimus.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_hgrn2.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test-models
  • GitHub Check: test-models
🔇 Additional comments (26)
tests/models/test_modeling_mamba2.py (1)

14-24: Excellent refactoring of test parameterization.

The consolidation of multiple @pytest.mark.parametrize decorators into a single decorator with descriptive test IDs significantly improves test readability and maintainability.

tests/models/test_modeling_comba.py (1)

14-58: Let’s broaden the search to catch every occurrence of use_l2warp across all model tests:

#!/bin/bash
echo "Searching for 'use_l2warp' usages in tests/models/..."
rg -n "use_l2warp" tests/models/
tests/models/test_modeling_lightnet.py (3)

14-24: Excellent refactoring of test parameterization!

The consolidation of multiple individual pytest.mark.parametrize decorators into a single decorator with explicit parameter tuples significantly improves readability and test organization. The descriptive test IDs using pytest.param will make test output much clearer.


25-33: Great addition of explicit type annotations.

The type annotations enhance code clarity and help with IDE support and static analysis. The parameter ordering is logical and consistent.


40-48: Consistent refactoring pattern for generation tests.

The same consolidation approach applied to the generation tests maintains consistency and improves maintainability.

tests/models/test_modeling_path_attn.py (1)

14-24: Consistent refactoring pattern applied successfully.

The same excellent parameterization consolidation approach has been applied consistently, which demonstrates good refactoring discipline across the codebase. The pattern maintains test coverage while improving organization.

Also applies to: 40-48

tests/models/test_modeling_rwkv7.py (1)

14-24: Effective refactoring with function name standardization.

The consolidation of parameterization is excellent, and the standardization of function names from test_rwkv7_* to test_* improves consistency across the test suite. This makes the test organization more uniform.

Also applies to: 41-48

tests/models/test_modeling_gsa.py (1)

14-24: Consistent and well-executed refactoring.

The parameterization consolidation and type annotation additions follow the established pattern perfectly, maintaining consistency across the test suite while improving readability.

Also applies to: 40-48

tests/models/test_modeling_retnet.py (1)

14-24: Successful completion of consistent refactoring pattern.

This file completes the systematic refactoring of test parameterization across the model test suite. The consistent application of the consolidation pattern, type annotations, and explicit test IDs significantly improves the maintainability and readability of the test codebase.

Also applies to: 40-48

tests/models/test_modeling_bitnet.py (1)

40-56: LGTM - Generation test refactoring looks good.

The consolidation of parametrize decorators and addition of type annotations improves test clarity.

tests/models/test_modeling_abc.py (1)

40-56: LGTM - Generation test refactoring looks good.

tests/models/test_modeling_mesanet.py (1)

40-56: LGTM - Generation test refactoring looks good.

tests/models/test_modeling_forgetting_transformer.py (1)

40-56: LGTM - Generation test refactoring looks good.

tests/models/test_modeling_deltanet.py (1)

40-56: LGTM - Generation test refactoring looks good.

tests/models/test_modeling_gated_deltaproduct.py (1)

43-57: Good refactoring of test parameterization.

The consolidation of multiple @pytest.mark.parametrize decorators into a single decorator with explicit test IDs and type annotations improves test organization and readability.

tests/models/test_modeling_linear_attn.py (1)

40-56: Good refactoring of test parameterization.

The consolidation approach with explicit test IDs and type annotations is well implemented for the generation test.

tests/models/test_modeling_gated_deltanet.py (1)

39-55: Good refactoring of test parameterization.

The generation test refactoring with consolidated parameterization and type annotations is well implemented.

tests/models/test_modeling_nsa.py (1)

40-56: Good refactoring of test parameterization.

The generation test consolidation with explicit test IDs and type annotations is well executed.

tests/models/test_modeling_hgrn.py (1)

40-56: Excellent consistent refactoring pattern.

This refactoring successfully consolidates test parameterization across multiple model test files, improving maintainability and test organization with explicit test IDs and type annotations.

tests/models/test_modeling_transformer.py (2)

17-36: Excellent refactoring of test parameterization!

The consolidation of multiple @pytest.mark.parametrize decorators into a single decorator with tuple parameters significantly improves readability and maintainability. The explicit test IDs using format strings will make test identification much clearer in test reports.

The type annotations are correctly ordered to match the parameter list, and the refactored structure is clean and consistent.


43-59: Clean generation test refactoring with improved test identification.

The parameterization consolidation follows the same pattern as the modeling test, maintaining consistency across the file. The explicit test ID will make it easier to identify this specific test case in reports.

Note: The static analysis warnings about "too many arguments" are acceptable in test contexts where comprehensive parameter combinations need to be tested.

tests/models/test_modeling_mamba.py (2)

14-33: Consistent parameterization refactoring across model tests.

The refactoring follows the same excellent pattern established in other test files, consolidating multiple decorators into a single parametrize decorator with tuple parameters and explicit test IDs. This consistency across different model test files will make the test suite much more maintainable.


40-56: Well-structured generation test with clear parameterization.

The generation test refactoring maintains the same high-quality approach, with proper type annotations and descriptive test IDs. The consistency with other model test files is commendable.

tests/models/test_modeling_hgrn2.py (1)

40-56: Generation test properly refactored with consistent naming.

The generation test correctly follows the refactoring pattern and uses the standardized test_generation function name, maintaining consistency with other model test files.

tests/models/test_modeling_rwkv6.py (2)

14-33: Perfect implementation of the refactoring pattern.

This file demonstrates the ideal implementation of the parameterization refactoring with proper function naming (test_modeling), clean parameter consolidation, and descriptive test IDs. The consistency with the established pattern across the test suite is excellent.


40-56: Consistent and well-structured generation test.

The generation test maintains the same high standard with proper naming, type annotations, and clear parameterization. The refactoring successfully improves test maintainability while preserving functionality.

Comment thread tests/models/test_modeling_mamba2.py
Comment thread tests/models/test_modeling_rodimus.py
Comment thread tests/models/test_modeling_gla.py
Comment thread tests/models/test_modeling_samba.py
Comment thread tests/models/test_modeling_comba.py
Comment thread tests/models/test_modeling_gated_deltaproduct.py
Comment thread tests/models/test_modeling_linear_attn.py
Comment thread tests/models/test_modeling_gated_deltanet.py
Comment thread tests/models/test_modeling_nsa.py
Comment thread tests/models/test_modeling_hgrn.py
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/intel-a770.yml (1)

84-84: Repeated -s -v flags violate DRY – consider centralising
Every pytest invocation now appends -s -v, which is great for visibility, but the flag sequence is duplicated five times. A tiny helper variable would keep the workflow concise and easier to tweak later:

+    env:
+      PYTEST_FLAGS: "-s -v"
...
-            pytest -s -v ${{ steps.find-dependent-tests.outputs.test_files }}
+            pytest $PYTEST_FLAGS ${{ steps.find-dependent-tests.outputs.test_files }}

This reduces copy-paste noise and guarantees any future change (e.g. adding --durations=10) is one-liner.

Also applies to: 91-91, 98-98, 113-113, 120-120

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 679fc11 and 8502d22.

📒 Files selected for processing (4)
  • .github/workflows/intel-a770.yml (2 hunks)
  • .github/workflows/nvidia-4090.yml (4 hunks)
  • .github/workflows/nvidia-a100.yml (4 hunks)
  • .github/workflows/nvidia-h100.yml (4 hunks)
✅ Files skipped from review due to trivial changes (3)
  • .github/workflows/nvidia-a100.yml
  • .github/workflows/nvidia-h100.yml
  • .github/workflows/nvidia-4090.yml
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test-models
🔇 Additional comments (2)
.github/workflows/intel-a770.yml (2)

84-84: Watch for log bloat after disabling capture with -s
-s streams all stdout/stderr; on verbose GPU runs this can breach the 14 MB GitHub log ceiling and silently truncate useful failures. If that becomes an issue, swap to --log-cli-level=INFO or keep -s only for the “continue-on-error” blocks.


91-91: LGTM – better debugging with verbose pytest
Adding -v here will surface individual test IDs and is a net win for traceability.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/models/test_modeling_hgrn2.py (1)

25-25: Consider function naming consistency.

The function is named test_hgrn2_modeling while other files use test_modeling. This might be intentional to distinguish HGRN2 from regular HGRN, but consider standardizing to test_modeling for consistency across the test suite.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8502d22 and 8238ded.

📒 Files selected for processing (25)
  • tests/models/test_modeling_abc.py (1 hunks)
  • tests/models/test_modeling_base.py (3 hunks)
  • tests/models/test_modeling_bitnet.py (1 hunks)
  • tests/models/test_modeling_comba.py (1 hunks)
  • tests/models/test_modeling_deltanet.py (1 hunks)
  • tests/models/test_modeling_forgetting_transformer.py (1 hunks)
  • tests/models/test_modeling_gated_deltanet.py (1 hunks)
  • tests/models/test_modeling_gated_deltaproduct.py (1 hunks)
  • tests/models/test_modeling_gla.py (1 hunks)
  • tests/models/test_modeling_gsa.py (1 hunks)
  • tests/models/test_modeling_hgrn.py (1 hunks)
  • tests/models/test_modeling_hgrn2.py (1 hunks)
  • tests/models/test_modeling_lightnet.py (1 hunks)
  • tests/models/test_modeling_linear_attn.py (1 hunks)
  • tests/models/test_modeling_mamba.py (1 hunks)
  • tests/models/test_modeling_mamba2.py (1 hunks)
  • tests/models/test_modeling_mesanet.py (1 hunks)
  • tests/models/test_modeling_nsa.py (1 hunks)
  • tests/models/test_modeling_path_attn.py (1 hunks)
  • tests/models/test_modeling_retnet.py (1 hunks)
  • tests/models/test_modeling_rodimus.py (1 hunks)
  • tests/models/test_modeling_rwkv6.py (1 hunks)
  • tests/models/test_modeling_rwkv7.py (1 hunks)
  • tests/models/test_modeling_samba.py (1 hunks)
  • tests/models/test_modeling_transformer.py (1 hunks)
🧰 Additional context used
🪛 Pylint (3.3.7)
tests/models/test_modeling_abc.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_bitnet.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_comba.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_deltanet.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_forgetting_transformer.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_gated_deltanet.py

[refactor] 24-24: Too many arguments (7/5)

(R0913)


[refactor] 24-24: Too many positional arguments (7/5)

(R0917)


[refactor] 48-48: Too many arguments (6/5)

(R0913)


[refactor] 48-48: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_gated_deltaproduct.py

[refactor] 28-28: Too many arguments (7/5)

(R0913)


[refactor] 28-28: Too many positional arguments (7/5)

(R0917)

tests/models/test_modeling_gla.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_gsa.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_hgrn.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_hgrn2.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_lightnet.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_linear_attn.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_mamba.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_mamba2.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_mesanet.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_nsa.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_path_attn.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_retnet.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_rodimus.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_rwkv6.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_rwkv7.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 50-50: Too many arguments (6/5)

(R0913)


[refactor] 50-50: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_samba.py

[refactor] 25-25: Too many arguments (7/5)

(R0913)


[refactor] 25-25: Too many positional arguments (7/5)

(R0917)


[refactor] 49-49: Too many arguments (6/5)

(R0913)


[refactor] 49-49: Too many positional arguments (6/5)

(R0917)

tests/models/test_modeling_transformer.py

[refactor] 28-28: Too many arguments (7/5)

(R0913)


[refactor] 28-28: Too many positional arguments (7/5)

(R0917)


[refactor] 52-52: Too many arguments (6/5)

(R0913)


[refactor] 52-52: Too many positional arguments (6/5)

(R0917)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test-models
🔇 Additional comments (51)
tests/models/test_modeling_base.py (2)

35-35: LGTM: Parameter reordering supports test suite consistency.

The reordering of dtype after use_l2warp aligns with the standardized parameter order being adopted across all model test files.


47-47: LGTM: Keyword arguments improve clarity and prevent parameter mismatching.

Using explicit keyword arguments for use_l2warp and dtype when calling create_model_and_config enhances code readability and reduces the risk of parameter order errors.

Also applies to: 90-90

tests/models/test_modeling_rodimus.py (3)

14-24: LGTM: Well-structured test parameterization consolidation.

The consolidation of multiple @pytest.mark.parametrize decorators into a single decorator with explicit test IDs improves test readability and maintainability.


25-34: LGTM: Parameter order and function call consistency achieved.

The function signature now correctly matches the parameter order in the decorator, and the use of keyword arguments in the function call enhances clarity. This addresses the parameter order mismatch that was flagged in previous reviews.


40-56: LGTM: Consistent refactoring applied to generation tests.

The same consolidation pattern with type annotations is properly applied to the generation test function, maintaining consistency across the test suite.

tests/models/test_modeling_deltanet.py (2)

14-34: LGTM: Consistent refactoring pattern applied.

The consolidation of test parameterization with explicit test IDs, type annotations, and keyword argument usage follows the same well-structured pattern as other test files in this refactor.


40-56: LGTM: Generation test refactoring maintains consistency.

The generation test function properly implements the same refactoring approach with consolidated parameterization and type annotations.

tests/models/test_modeling_forgetting_transformer.py (2)

14-34: LGTM: High-quality refactoring maintains test suite consistency.

The refactoring properly consolidates parameterization, adds type annotations, and uses keyword arguments, following the established pattern across the test suite.


40-56: LGTM: Generation test follows consistent refactoring pattern.

The generation test function is properly refactored with the same consolidation approach and type safety improvements.

tests/models/test_modeling_linear_attn.py (2)

14-34: LGTM: Parameter order issues resolved with consistent refactoring.

The refactoring successfully addresses the parameter order mismatch flagged in previous reviews while implementing the same high-quality consolidation pattern used across the test suite.


40-56: LGTM: Complete refactoring maintains test suite uniformity.

The generation test function completes the consistent refactoring pattern across all model test files, improving maintainability and type safety.

tests/models/test_modeling_lightnet.py (2)

14-34: Excellent refactoring of test parameterization.

The consolidation of multiple pytest.mark.parametrize decorators into a single decorator with explicit test IDs significantly improves test clarity and maintainability. The type annotations and keyword argument usage enhance code readability.


40-57: Well-structured generation test parameterization.

The generation test follows the same clean parameterization pattern with proper type annotations and explicit test ID.

tests/models/test_modeling_bitnet.py (2)

14-34: Consistent refactoring maintains code uniformity.

The BitNet test follows the same excellent refactoring pattern as other model tests, ensuring consistency across the test suite.


40-57: Generation test properly refactored.

Clean parameterization with appropriate type annotations and test identification.

tests/models/test_modeling_gla.py (2)

14-34: Parameter order issue resolved - refactoring looks excellent.

The parameter order mismatch mentioned in previous reviews has been properly addressed. The function signature now correctly matches the decorator parameter order, and the refactoring follows the consistent pattern across all model tests.


40-57: Generation test properly structured.

Clean parameterization with consistent formatting and proper type annotations.

tests/models/test_modeling_samba.py (2)

14-34: Parameter order corrected - excellent refactoring.

The critical parameter order issue from previous reviews has been resolved. The function signature now properly matches the decorator order, and the refactoring maintains consistency with the broader test suite improvements.


40-57: Generation test follows consistent pattern.

Well-structured parameterization with proper type annotations and clear test identification.

tests/models/test_modeling_rwkv7.py (2)

14-34: Function standardization and parameterization refactoring approved.

The renaming from test_rwkv7_modeling to test_modeling improves consistency across model test files. The parameterization refactoring follows the same excellent pattern as other files.


41-58: Generation test properly refactored with consistent naming.

The standardized function name and clean parameterization structure align well with the broader test suite improvements.

tests/models/test_modeling_transformer.py (2)

17-37: Excellent refactoring that improves test maintainability.

The consolidation of multiple @pytest.mark.parametrize decorators into a single decorator with explicit test IDs and type annotations significantly improves code readability and test identification. The use of keyword arguments in the function call also enhances clarity.


43-59: Consistent refactoring approach for generation tests.

The same consolidation pattern applied to the generation tests maintains consistency across the test suite while preserving the original test logic.

tests/models/test_modeling_nsa.py (2)

14-34: Parameter order is now correct and refactoring looks good.

The parameter order in the @pytest.mark.parametrize decorator now correctly matches the function signature. The refactoring follows the same excellent pattern as other test files with consolidated parameterization and type annotations.


40-56: Consistent application of refactoring pattern.

The generation test follows the same improved parameterization approach, maintaining consistency across the test suite.

tests/models/test_modeling_mamba.py (2)

14-34: Consistent refactoring maintains test suite uniformity.

The consolidated parameterization with explicit test IDs and type annotations follows the same excellent pattern applied across the test suite, improving maintainability and readability.


40-57: Generation test refactoring aligns with overall approach.

The generation test maintains the same improved parameterization style, ensuring consistency across all test functions.

tests/models/test_modeling_retnet.py (2)

14-34: Systematic refactoring enhances test organization.

The consolidation of parameterization decorators with explicit test IDs and type annotations demonstrates excellent attention to code quality and maintainability.


40-57: Generation test follows consistent refactoring pattern.

The generation test maintains the same improved structure, ensuring uniformity across the entire test suite.

tests/models/test_modeling_path_attn.py (2)

14-34: Final file completes the systematic test refactoring.

The consistent application of consolidated parameterization, type annotations, and explicit test IDs across all test files demonstrates a well-executed refactor that significantly improves test suite maintainability.


40-57: Generation test maintains refactoring consistency to completion.

The generation test follows the same improved pattern, completing the systematic refactor across the entire set of model test files.

tests/models/test_modeling_gated_deltaproduct.py (2)

17-37: LGTM! Test parameterization refactoring is well-implemented.

The consolidation of multiple @pytest.mark.parametrize decorators into a single decorator with explicit test IDs improves test clarity. The parameter order between the decorator and function signature is correctly aligned, and the use of keyword arguments in the test call follows best practices.


43-51: Generation test refactoring looks good.

The parameterization approach is consistent with the modeling test, using explicit test IDs and proper type annotations.

tests/models/test_modeling_hgrn.py (2)

14-34: Consistent refactoring implementation.

The parameterization refactoring follows the same pattern as other test files, with proper parameter alignment and type annotations. The use of keyword arguments for use_l2warp and dtype is appropriate.


40-48: Generation test refactoring is consistent.

The parameterization approach aligns with the modeling test and follows the established pattern.

tests/models/test_modeling_comba.py (2)

14-34: Well-executed refactoring with proper parameter alignment.

The consolidation maintains the same high-quality pattern seen in other files, with correct parameter order and appropriate use of keyword arguments.


40-48: Generation test follows consistent pattern.

The refactoring approach is properly applied with explicit test IDs and type annotations.

tests/models/test_modeling_gsa.py (2)

14-34: Refactoring consistently applied.

The parameterization follows the established pattern with proper alignment between decorator parameters and function signature.


40-48: Generation test maintains consistency.

The refactoring approach is properly implemented with explicit test IDs and type annotations.

tests/models/test_modeling_hgrn2.py (2)

14-34: Refactoring properly implemented despite naming consideration.

The parameterization refactoring follows the established pattern with correct parameter order and appropriate keyword arguments.


40-48: Generation test follows standard naming and pattern.

The generation test properly uses the standard test_generation name and follows the consistent refactoring approach.

tests/models/test_modeling_abc.py (2)

14-34: Excellent refactoring of test parameterization.

The consolidation of multiple @pytest.mark.parametrize decorators into a single decorator with explicit test IDs and type annotations significantly improves test clarity and maintainability. The parameter order matches correctly between decorator and function signature, and the use of keyword arguments in the function call enhances readability.


40-57: Clean parameterization for generation tests.

The generation test follows the same improved pattern with consolidated parameterization and proper type annotations. The implementation is consistent with the modeling test refactor.

tests/models/test_modeling_rwkv6.py (2)

14-34: Consistent refactoring approach across test files.

The RWKV6 test file follows the same excellent refactoring pattern as the ABC tests, maintaining consistency across the test suite. Parameter ordering, type annotations, and keyword argument usage are all properly implemented.


40-57: Generation test refactoring is well-aligned.

The generation test maintains the same high-quality refactoring approach with proper parameterization and type safety.

tests/models/test_modeling_gated_deltanet.py (2)

14-33: Parameter order issue has been resolved.

The current implementation correctly aligns the parameter order between the @pytest.mark.parametrize decorator and the function signature. The previous mismatch noted in past reviews has been fixed, and the refactoring follows the consistent pattern across all test files.


39-56: Generation test properly refactored.

The generation test maintains consistency with the overall refactoring approach and proper implementation.

tests/models/test_modeling_mesanet.py (2)

14-34: MesaNet test refactoring maintains consistency.

The refactoring of the MesaNet tests follows the same high-quality pattern established across all test files, with proper parameter ordering, type annotations, and keyword argument usage.


40-57: Generation test consistently implemented.

The generation test refactoring aligns perfectly with the overall PR objectives and maintains code quality.

tests/models/test_modeling_mamba2.py (2)

14-34: Parameter order corrected and refactoring completed successfully.

The current implementation properly aligns the parameter order between the decorator and function signature, resolving the previous mismatch issue. The Mamba2 test refactoring is now consistent with the overall PR pattern and maintains high code quality.


40-57: Generation test refactoring completed consistently.

The generation test follows the established refactoring pattern and is properly implemented.

@yzhangcs yzhangcs merged commit 72aa949 into main Jun 24, 2025
5 of 8 checks passed
@yzhangcs yzhangcs deleted the modeling branch June 24, 2025 22:41
yzhangcs added a commit that referenced this pull request Jun 24, 2025
@coderabbitai coderabbitai bot mentioned this pull request Sep 7, 2025
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