- Pippy
git clone https://github.com/pytorch/PiPPy.git
- Install Environment
pip install -r requirements.txt
Baseline Model: nvidia/segformer-b1-finetuned-cityscapes-1024-1024
python3 hf_generate.py
# measure latency
torchrun --nproc_per_node 8 pippy_evaluate.py
Divide the photo into four equal parts and sixteen equal parts, then utilize multi-threading for parallelization to process them simultaneously.
python3 slicing_evaluate.py
Utilize both multi-thread and multi-process to concurrently process multiple images, enhancing overall throughput and resource utilization.
- multi-thread
python3 multi_images_handling/test_threading.py
- multi-process
python3 multi_images_handling/test_multiprocessing.py
- Download and unzip the gtFine_trainvaltest.zip and leftImg8bit_trainvaltest.zip from cityscapes official websites
- Use Validation set from cityscapes dataset
To run parallel_gpu.py with multiple GPUs, use the command:
accelerate config
Follow the settings in the terminal to finish editing the config file.
After that, run the code by:
accelerate launch parallel_gpu.py