MRT User Interface (MRT-UI) serves as an alternative to the command line operation of mrt quantization tools, which supports remote model submitting, quantization and uploading (TODO). Comprehensive parameter tuning interfaces, logging console and intermediate visualization tools (TODO) are enabled for easier usage of MRT.
MRT-UI depends on Django, which implements the frontend web service. Both direct access (TODO) and gRPC-python are utilized for the realization of remote processes. The architecture of this project can be shown as follows:
At the very beginning, install the prerequisites:
pip install -r conf/requirements.txtThis step is required in both server side and client side. Clone the project to a specified directory.
git clone https://github.com/declmal/mrt-ui.git /path/to/mrt-uiBoth web and rpc module of mrt-ui is based on the mrt module in the project cvm-runtime, so we need to install this package as mentioned in mrt installation guide. Then, some environment varaibles need to be installed by the following command.
cd /path/to/mrt-ui
./conf/env.shDon't forget to activate the environment variables by either of the following command with respect to your system.
# for Linux system
source ~/.bashrc# for MACOS system
source ~/.bash_profileFirstly, since mrt_rpc is based on grpc-python whose parameter packing protocol is inherently realized by protobuf, the intermediate generated python code that corresponding to proto files, the following command should be executed before the launch of RPC server.
make protoThe rpc module applies the client-server mode, thus the RPC server should be started before any remote procedured is called. To launch the mrt_rpc server, in the root dir of mrt-ui, execute the following command:
make rpc-serverTo run the unit tests, in the root dir of mrt-ui, execute the following commands:
# test model submission
python tests/test_submit.py \
--host-addr [remote-server-address] \
--host-port [remote-server-port] \
--src-dir [local-model-dir] \
--model-name [model-name] \
--dst-dir [remote-model-dir]# test model quantization
python tests/test_execute.py \
--host-addr [remote-server-address] \
--host-port [remote-server-port] \
--yaml-dir [local-yaml-dir] \
--model-name [model-name]MRT-UI has provided a web-browser based user-interface for quick test and visualization of model quantization. Since the web server has module that relies on grpc api, the protocol code must be generated beforehand, the process of which is elaborated in [Protocol Generation](#Protocol Generation).
Then, the web service can be launched by:
make web-serverNote: If you launch the web browser locally and want to make use of the services on a remote machine, you need lauch the rpc server on that remote machine, see [Launch RPC server on your remote host](#Launch RPC server on your remote host) for reference.
Afterwards, we can enter http://127.0.0.1:8000/test into a web browser and start using the web interface for supported services.
