Skip to content

Heterogeneous Containerization of Large Language Model Apps

License

Notifications You must be signed in to change notification settings

Multi-V-VM/MVVM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fc99f6a · Mar 12, 2025
Apr 4, 2024
Mar 12, 2025
Mar 12, 2025
Mar 12, 2025
Mar 6, 2024
Mar 20, 2024
Mar 12, 2025
Dec 9, 2024
Mar 12, 2025
Apr 8, 2024
Apr 29, 2023
Apr 29, 2023
May 7, 2024
Dec 9, 2024
Mar 12, 2025
Mar 25, 2022
Mar 11, 2025
Apr 16, 2024

Repository files navigation

Migratable Velocity Virtual Machine

MacOSMacOSUbuntuGenerate page

arch

Heterogeneous Containerization of Large Language Model Apps

Just run

wamrc --opt-level=3 --threshold-bits=16 --disable-aux-stack-check --enable-counter-loop-checkpoint -o bc.aot bench/bc.aot
./MVVM_checkpoint -t bench/bc.aot -a -g20,-n1000
./MVVM_restore -t bench/bc.aot

Policy for wamrc

  1. counter loop checkpoint --enable-counter-loop-checkpoint
  2. loop threshold for 1 << x per checkpoint
  3. loop checkpoint --enable-loop-checkpoint, meaning without the counter to checkpoint
  4. loop dirty checkpoint --enable-loop-dirty-checkpoint, meaning use the dirty bit to checkpoint
  5. --enable-checkpoint, enable function level checkpoint

To debug mode checkpoint and migrate a WAMR nano process

First comment out the following in checkpoint.cpp

wamr->get_int3_addr();
wamr->replace_int3_with_nop();
wamr->replace_mfence_with_nop();

Then

python3 ../artifact/common_util.py # return $recv is 193
SPDLOG_LEVEL=debug ./MVVM_checkpoint -t test/tcp_client.aot -f 193 -c 0 -x 10 -a "10" -e OMP_NUM_THREADS=1 -i
SPDLOG_LEVEL=debug ./MVVM_restore -t test/tcp_client.aot # All the wasi env will be restored
  1. -t Target: The path to the WASM interpreter or AOT executable
  2. -i Debug Mode: Switch on for debugging
  3. -f Function: The function to stop and checkpoint
  4. -x Function Counter: The WASM function counter to stop and checkpoint
  5. -c Counter: The WASM instruction counter to stop and checkpoint(Conflict with -f and -x)
  6. -a Arguments: The arguments to the function
  7. -e Environment: The environment variables to the function
image

Design Doc

  1. All the pointers will be stored as offset to the linear memory.
  2. Go forward and never go back, all the calling into WASI land will row back to the call on recovery.
  3. Use AOT compiler convention with a stable point to achieve cross-platform.

Performance

image image

Cite

@article{yang2024transparent,
  title={Transparent and Efficient Live Migration across Heterogeneous Hosts with Wharf},
  author={Yang, Yiwei and Hu, Aibo and Zheng, Yusheng and Zhao, Brian and Zhang, Xinqi and Quinn, Andrew},
  journal={arXiv preprint arXiv:2410.15894},
  year={2024}
}