[Hexagon] Add support to run on multiple devices#12504
Merged
kparzysz-quic merged 13 commits intoapache:mainfrom Aug 24, 2022
Merged
[Hexagon] Add support to run on multiple devices#12504kparzysz-quic merged 13 commits intoapache:mainfrom
kparzysz-quic merged 13 commits intoapache:mainfrom
Conversation
mehrdadh
reviewed
Aug 23, 2022
|
|
||
|
|
||
| @pytest.fixture(scope="session") | ||
| def android_serial_number() -> Optional[str]: |
Member
There was a problem hiding this comment.
can you explain why is it not a fixture anymore?
Contributor
Author
There was a problem hiding this comment.
Since pytest_configure(config) is a pytest hook, there were no easy way to have it use a pytest fixtures.
Maybe I'm missing the point, but I did not see the usefulness of having the android_serial_number as a pytest.fixture and by removing it, it solved the previous error.
mehrdadh
approved these changes
Aug 24, 2022
xinetzone
pushed a commit
to daobook/tvm
that referenced
this pull request
Nov 25, 2022
* working in parralel using worker * creating launchers per test and clean up * clean up * ci change to distrube tests * ci work with any number of devices * fix running on simulator * adding function docstring * fix android_serial_number to always return a list of string * lint issue * fix internal error when skipping tests while androideserial number is not set * lint issue
| def pytest_configure_node(node): | ||
| # the master for each node fills slaveinput dictionary | ||
| # which pytest-xdist will transfer to the subprocess | ||
| node.workerinput["device_adr"] = node.config.iplist.pop() |
Contributor
There was a problem hiding this comment.
This causes an error when we try to run these tests in parallel on simulator:
INTERNALERROR> File "/usr2/kparzysz/.local/lib/python3.6/site-packages/_pytest/main.py", line 266, in wrap_session
INTERNALERROR> config.hook.pytest_sessionstart(session=session)
[...]
INTERNALERROR> File "/usr2/kparzysz/.local/lib/python3.6/site-packages/pluggy/_callers.py", line 39, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/local/mnt/workspace/kparzysz/aitools/tvm-upstream/python/tvm/contrib/hexagon/pytest_plugin.py", line 242, in pytest_configure_node
INTERNALERROR> node.workerinput["device_adr"] = node.config.iplist.pop()
INTERNALERROR> IndexError: pop from empty list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR enables running on multiple devices .
Hexagon_luncher_processwill create a a single server on each device and assigns a worker to a test whenever a new device becomes available wherepytest-xdistwill transfer to the subprocess.To run on multiple devices, set the
ANDROID_SERIAL_NUMBERto devices separated by a comma. E.g:export ANDROID_SERIAL_NUMBER="xxx.xxx.xx.xxx:xxxx,yyy.yyy.yy.yyy:yyyy,zzz.zzz.zz.zzz:zzzz".And run the test using the following command:
py.test --tx {number_of_devices}*popen --dist=load test_fileThe
number_of_devicescab be less or equal to the actually number of devices set in theANDROID_SERIAL_NUMBER.Tests can still be run on a single device or simulator as before. E.g:
export ANDROID_SERIAL_NUMBER="xxx.xxx.xx.xxx:xxxx"pytest test_file@mehrdadh @Lunderberg @csullivan