-
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
[microTVM] Remove Arduino aot code #8869
Conversation
#8857 |
c928a2e
to
3a36816
Compare
I've rebased the PR on top of main now that #8857 is merged. This PR is ready for review. |
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.
@guberti thanks for this--a couple questions about your test fixtures
The more I think about it, the more the Even more so, the idea of having these saved project tests doesn't really fit with the test's "goal" - of simulating a user workflow of building and deploying a model on device. IMO, the cleanest solution is to build a whole new test, |
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.
Thanks for following up on this @guberti, apologies I didn't pick this up in my original PR - I appreciate your diligence 😸 I just have a few suggestions here.
|
||
@pytest.fixture(scope="function") | ||
def workspace_dir(request, platform): | ||
return conftest.make_workspace_dir("arduino_error_detection", platform) |
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.
Given these fixtures are only used as part of the tests in this folder, and conftest
is meant for auto-registration or pytest configuration rather than to hold helpers and utils, could these be either moved fully into conftest
as fixtures or the underlying function moved into a more suitably named file?
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.
The scope fixture of workspace_dir
varies from test to test (for example, test_arduino_workflowhas it at module scope), and I suspect tests with more complex
workspace_dirsetups will be added in the future. For that reason, I'd prefer to define
workspace_dirindividually in each test, but use the helper function
make_workspace_dir` to avoid code reuse. I've also added a comment to each of these functions to clarify it.
That said, if you feel strongly I'm also open to other solutions, like defining multiple kinds of workspace dirs in conftest
(e.g. a module_scope_workspace_dir
, per_function_workspace_dir
, etc.).
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.
Argh, I feel like I could've been clearer here, my apologies. My suggestion is not to have general functions in conftest.py
but rather in a different file such as a workspace.py
to include from the test. This means only pytest-specific things end up in conftest.py
, I have no issue with fixtures local to the test files which then use those functions.
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.
Ah, that makes more sense. I like the idea of moving non-pytest code into a workspace.py
, but I think that might be OOS for this PR. Definitely worth addressing in a follow up though!
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.
Agreed, it'd be good to have the move isolated in another PR 👍
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.
i agree with @Mousius sentiment--let's place test_utils in a file called test_utils or similar. can be a follow-up PR.
@Mousius Your comments should be addressed by bb37393 - take a look when you have a sec! |
Apologies @guberti, I was a bit unclear in my initial response and I've introduced more changes, feel free to reach out if you need more clarification 😸 |
bb37393
to
e873436
Compare
Break error detection tests into separate file Address comments from Mousius Re-add necessary fixture
e873436
to
2e433f6
Compare
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.
Looks good to me, removes the AOT code and then some 😸
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.
LGTM
* Fix Arduino DLDevice includes * microtvm_api_server fails if commands fail * Add regression test for microtvm_api_server not failing * Address PR comments Break error detection tests into separate file Address comments from Mousius Re-add necessary fixture
* Fix Arduino DLDevice includes * microtvm_api_server fails if commands fail * Add regression test for microtvm_api_server not failing * Address PR comments Break error detection tests into separate file Address comments from Mousius Re-add necessary fixture
PR #8758 changed the way AOT is handled in microTVM, which caused my Arduino PR to stop working. I should have been caught by the unit tests since it caused Arduino project compilation to stop working, but because I called
subprocess.run
inmicrotvm_api_server.py
without passingcheck=True
, the tests still pass.This PR fixes the Arduino implementation of microTVM, changes the unit tests for Arduino to use
check=True
, and adds a regression test to make sure the unit tests will catch compilation failures.@mehrdadh @areusch