-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI] Apply linting rules to AOT tests #11657
Conversation
cc @Lunderberg about the issue with linting |
+ "with packed calling convention which is not supported by the NPU codegen's " | ||
+ "TIR to Runtime Hook. We need to use a different target to test this feature" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+ "with packed calling convention which is not supported by the NPU codegen's " | |
+ "TIR to Runtime Hook. We need to use a different target to test this feature" | |
"with packed calling convention which is not supported by the NPU codegen's " | |
"TIR to Runtime Hook. We need to use a different target to test this feature" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mousius approved modulo one comment
@@ -151,7 +158,7 @@ def test_device_api_hooks_unpacked_api(device_api_main_func): | |||
# We dont need to check exact input and output var names in this test. | |||
# Hence, using a regex to cover any legal I/O name. | |||
regex = re.compile( | |||
'tir\.tvm_check_return\(0, -1, tir\.call_extern\("tvmgen_default_ethos_u_main_0", \w+, \w+, device_context_ethos_u\)\)' | |||
r'tir\.tvm_check_return\(0, -1, tir\.call_extern\("tvmgen_default_ethos_u_main_0", \w+, \w+, device_context_ethos_u\)\)' # pylint: disable=line-too-long |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you break this up rather than disabling? e.g.
r'tir\.tvm_check_return\('
r'0, -1, '
r'tir\.call_extern\("tvmgen_default_ethos_u_main_0", '
r'\w+, \w+, device_context_ethos_u\)\)'
This was something that I had experimented with when writing it, and there isn't a good way around it. The exact name must match in both the global scope of the module and in the argument list of the test function, so there is no name that would satisfy both
|
@Lunderberg could we do something like, in e.g. testing.py:
see https://docs.pytest.org/en/7.1.x/reference/reference.html#pytest-fixture |
This enables pylint against the AOT test cases. One issue I found was with the `tvm.testing.parameter` which breaks the naming convention rules in pylint (constants are upper case and function parameters are lower case). It may be worth a syntax similar to: ``` tvm.testing.parameter("enable_usmp", [True, False]) ```
@areusch We can, and that's basically what the The main issue comes when pytest is finding the fixtures to be used, and avoiding the need to repeatedly define the fixture name. I had tracked it down to the the function that locates fixtures to convince myself that it needed to be a named object in the file. (I been hoping that there would be some pytest variable that could hold the fixture objects, rather than requiring a python variable.)
|
This enables pylint against the AOT test cases.
One issue I found was with the
tvm.testing.parameter
which breaks the naming convention rules in pylint (constants are upper case and function parameters are lower case). It may be worth a syntax similar to:cc @areusch @driazati