Skip to content
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

[Bug] [microTVM] BYOC hardware test fails when used with Arduino #12033

Closed
guberti opened this issue Jul 7, 2022 · 4 comments
Closed

[Bug] [microTVM] BYOC hardware test fails when used with Arduino #12033

guberti opened this issue Jul 7, 2022 · 4 comments

Comments

@guberti
Copy link
Member

guberti commented Jul 7, 2022

Currently, the test tests/micro/arduino/test_arduino_rpc_server.py::test_byoc_microtvm fails. We have a similar test for Zephyr which runs fine, so the issue appears to be Arduino-specific. Below is a log of the test failure - it seems like ndarray.h got moved or something.

guberti@guberti-Precision-7540:~/tvm$ python -m pytest tests/micro/arduino/test_arduino_rpc_server.py::test_byoc_microtvm --arduino-board=due
[13:59:04] /home/guberti/tvm/src/target/target_kind.cc:163: Warning: Unable to detect CUDA version, default to "-arch=sm_20" instead
enabled targets: llvm
pytest marker: 
====================================================== test session starts =======================================================
platform linux -- Python 3.8.10, pytest-7.1.1, pluggy-0.13.1
rootdir: /home/guberti/tvm
plugins: cov-3.0.0, anyio-3.5.0, typeguard-2.13.2
collected 1 item                                                                                                                 

tests/micro/arduino/test_arduino_rpc_server.py F                                                                           [100%]

============================================================ FAILURES ============================================================
____________________________________________________ test_byoc_microtvm[due] _____________________________________________________

board = 'due', arduino_cli_cmd = 'arduino-cli', tvm_debug = False
workspace_dir = <tvm.contrib.utils.TempDirectory object at 0x7fc46bc0e7f0>
... (omitted for brevity) ...
E           subprocess.CalledProcessError: Command '['arduino-cli', 'compile', './project/', '--fqbn', 'arduino:sam:arduino_due_x_dbg', '--build-path', PosixPath('/home/guberti/tvm/tests/micro/arduino/workspace_arduino_rpc_server_due/2022-07-07T13-59-04/project/build')]' returned non-zero exit status 1.

python/tvm/micro/project_api/client.py:135: ServerError
------------------------------------------------------ Captured stdout call ------------------------------------------------------


Used platform Version Path                                                         
arduino:sam   1.6.12  /home/guberti/.arduino15/packages/arduino/hardware/sam/1.6.12

------------------------------------------------------ Captured stderr call ------------------------------------------------------


A new release of Arduino CLI is available: 0.23.0 → 0.24.0
https://arduino.github.io/arduino-cli/latest/installation/#latest-packages
/home/guberti/tvm/tests/micro/arduino/workspace_arduino_rpc_server_due/2022-07-07T13-59-04/project/src/model/default_lib3.c:7:33: fatal error: tvm/runtime/ndarray.h: No such file or directory
 #include "tvm/runtime/ndarray.h"
                                 ^
compilation terminated.

Error during build: exit status 1
======================================================== warnings summary ========================================================
../.local/lib/python3.8/site-packages/onnx/mapping.py:27
  /home/guberti/.local/lib/python3.8/site-packages/onnx/mapping.py:27: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. 
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    int(TensorProto.STRING): np.dtype(np.object)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
==================================================== short test summary info =====================================================
FAILED tests/micro/arduino/test_arduino_rpc_server.py::test_byoc_microtvm[due] - tvm.micro.project_api.server.ServerError: call...
================================================== 1 failed, 1 warning in 3.13s ==================================================

cc @alanmacd @gromero @mehrdadh

@guberti
Copy link
Member Author

guberti commented Jul 7, 2022

Kudos to @mehrdadh for first spotting this.

@guberti
Copy link
Member Author

guberti commented Jul 7, 2022

git bisect tells us the breakage was caused by 985680e:

985680ee1ae77ebe51f373df64063f8372e6cb6e is the first bad commit
commit 985680ee1ae77ebe51f373df64063f8372e6cb6e
Author: Mark Shields <87091372+mbs-octoml@users.noreply.github.com>
Date:   Thu Jun 30 10:27:21 2022 -0700

    [BYOC] Handle constants in IRModule-at-a-time external codegen (#11770)

This checks out, as that commit deals with BYOC.

@mbs-octoml
Copy link
Contributor

My bad, I think the fix is #12061. A unit test would be nice.

@guberti
Copy link
Member Author

guberti commented Jul 14, 2022

Can confirm the issue is fixed.

@guberti guberti closed this as completed Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants