Conversation
|
Caution Review failedThe pull request is closed. """ WalkthroughThis change refactors the test parameterization for modeling and generation tests across multiple model test files. Multiple stacked 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
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
✨ Finishing Touches
🧪 Generate Unit Tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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.parametrizedecorator 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
dtypebeforeuse_l2warp(matching the parameter order), but the ID format string showsuse_l2warpbeforedtype.- 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_modelingwhile equivalent functions in other files are namedtest_modeling.For consistency across the test suite, consider renaming to
test_modelingto 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
📒 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.parametrizedecorators 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 ofuse_l2warpacross 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.parametrizedecorators into a single decorator with explicit parameter tuples significantly improves readability and test organization. The descriptive test IDs usingpytest.paramwill 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_*totest_*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.parametrizedecorators 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.parametrizedecorators 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_generationfunction 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.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/intel-a770.yml (1)
84-84: Repeated-s -vflags 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
📒 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
-sstreams 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=INFOor keep-sonly for the “continue-on-error” blocks.
91-91: LGTM – better debugging with verbose pytest
Adding-vhere will surface individual test IDs and is a net win for traceability.
There was a problem hiding this comment.
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_modelingwhile other files usetest_modeling. This might be intentional to distinguish HGRN2 from regular HGRN, but consider standardizing totest_modelingfor consistency across the test suite.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 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
dtypeafteruse_l2warpaligns 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_l2warpanddtypewhen callingcreate_model_and_configenhances 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.parametrizedecorators 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.parametrizedecorators 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_modelingtotest_modelingimproves 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.parametrizedecorators 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.parametrizedecorator 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.parametrizedecorators 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_l2warpanddtypeis 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_generationname 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.parametrizedecorators 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.parametrizedecorator 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.
Summary by CodeRabbit