google / jetstream-pytorch

PyTorch/XLA integration with JetStream (https://github.com/google/JetStream) for LLM inference"
Apache License 2.0
33 stars 14 forks source link

Fix test_model_impl lint #50

Closed FanhaiLu1 closed 4 months ago

FanhaiLu1 commented 4 months ago

After this PR: Your code has been rated at 10.00/10

Before this PR: Your code has been rated at 6.79/10

test_model_impl.py:49:0: C0301: Line too long (132/100) (line-too-long) test_model_impl.py:50:0: C0301: Line too long (131/100) (line-too-long)

test_model_impl.py:30:0: C0115: Missing class docstring (missing-class-docstring) test_model_impl.py:32:2: C0116: Missing function or method docstring (missing-function-docstring) test_model_impl.py:79:43: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:90:36: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:89:4: W0612: Unused variable 'batch' (unused-variable) test_model_impl.py:109:2: C0116: Missing function or method docstring (missing-function-docstring) test_model_impl.py:109:2: R0914: Too many local variables (21/15) (too-many-locals) test_model_impl.py:111:16: W0212: Access to a protected member _model_arg of a client class (protected-access) test_model_impl.py:148:4: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:148:33: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:150:10: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:151:4: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:151:33: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:153:10: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:181:2: C0116: Missing function or method docstring (missing-function-docstring) test_model_impl.py:181:2: R0914: Too many local variables (21/15) (too-many-locals) test_model_impl.py:183:16: W0212: Access to a protected member _model_arg of a client class (protected-access) test_model_impl.py:220:4: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:220:33: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:222:10: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:223:4: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:223:33: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:225:10: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:252:2: C0116: Missing function or method docstring (missing-function-docstring) test_model_impl.py:252:2: R0914: Too many local variables (24/15) (too-many-locals) test_model_impl.py:254:16: W0212: Access to a protected member _model_arg of a client class (protected-access) test_model_impl.py:283:4: W0101: Unreachable code (unreachable) test_model_impl.py:288:6: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:288:35: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:290:12: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:291:6: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:291:35: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:293:12: W0212: Access to a protected member _elem of a client class (protected-access) test_model_impl.py:304:19: E0602: Undefined variable 'block_orig' (undefined-variable) test_model_impl.py:305:4: W0631: Using possibly undefined loop variable 'cache_decode' (undefined-loop-variable) test_model_impl.py:308:40: W0631: Using possibly undefined loop variable 'cache_decode' (undefined-loop-variable) test_model_impl.py:310:8: E0602: Undefined variable 'block_ours' (undefined-variable) test_model_impl.py:310:20: E0602: Undefined variable 'block_orig' (undefined-variable) test_model_impl.py:27:0: C0411: standard import "unittest" should be placed before third party imports "jetstream_pt.third_party.llama2.model_exportable", "jetstream_pt.third_party.llama2.model_original", "jetstream_pt.layers" (...) "torch_xla2", "jax", "jax.numpy" (wrong-import-order) test_model_impl.py:18:0: W0611: Unused model_args imported from jetstream_pt.third_party.llama2 (unused-import)