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

[Hexagon] RPC server/client for simulator #10361

Merged
merged 1 commit into from
Feb 24, 2022
Merged

[Hexagon] RPC server/client for simulator #10361

merged 1 commit into from
Feb 24, 2022

Conversation

kparzysz-quic
Copy link
Contributor

@kparzysz-quic kparzysz-quic commented Feb 23, 2022

This is the C++ code for running Hexagon code on simulator via the RPC mechanism. It is intended to be integrated into the current HexagonLauncher, although the integration will require further changes to the launcher python code.

The final goal is to be able to run the same file.py on either hardware or simulator without needing to edit the python file, but simply by changing the configuration of the execution platform (i.e. something like --execute-on=simulator as a command line or in an environment variable). The exact details are still to be determined.

This is the C++ code for running Hexagon code on simulator via the
RPC mechanism. It is intended to be integrated into the current
HexagonLauncher, although the integration will require further changes
to the launcher python code.

The final goal is to be able to run the same file.py on either
hardware or simulator without needing to edit the python file, but
simply by changing the configuration of the execution platform
(i.e. something like --exectute-on=simulator as a command line or
in an environment variable). The exact details are still to be
determined.
@kparzysz-quic
Copy link
Contributor Author

cc: @mehrdadh

# Build X86 binaries:
# - tvm_rpc_x86

ExternalProject_Add(x86_tvm_runtime_rpc
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build a cpp RPC server app for x86 with the Hexagon RPC code enabled.

HEX_VA_t dispatch_v_, message_buffer_v_;
std::unique_ptr<HexagonWrapper> sim_;

// Sim configuration routines.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of this configuration code was taken from src/runtime/hexagon/android/sim/hexagon_device_sim.cpp.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you move all of these configurations to a header file and reuse it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The offload code will be removed, so this will be the only place where it appears. The files in src/runtime/hexagon/android will be deleted.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mehrdadh Since the original code will be removed, I think it's fine to merge this as is and let @kparzysz-quic continue completing his work.

@masahi masahi self-assigned this Feb 23, 2022
rpc->dispatch_v_ = RssV & ~0u; // ~0u is uint32_t
rpc->message_buffer_v_ = RssV >> 32;

LOG(INFO) << "dispatch:" << reinterpret_cast<void*>(rpc->dispatch_v_)
Copy link
Member

@masahi masahi Feb 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DLOG or VLOG (can be done in a follow up)

@kparzysz-quic kparzysz-quic merged commit cb7f773 into apache:main Feb 24, 2022
@kparzysz-quic kparzysz-quic deleted the hexagon-rpc-simulator branch February 24, 2022 13:33
pfk-beta pushed a commit to pfk-beta/tvm that referenced this pull request Apr 11, 2022
This is the C++ code for running Hexagon code on simulator via the
RPC mechanism. It is intended to be integrated into the current
HexagonLauncher, although the integration will require further changes
to the launcher python code.

The final goal is to be able to run the same file.py on either
hardware or simulator without needing to edit the python file, but
simply by changing the configuration of the execution platform
(i.e. something like --exectute-on=simulator as a command line or
in an environment variable). The exact details are still to be
determined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants