An open API service indexing awesome lists of open source software.

https://github.com/sseung0703/tf2-jit-compile-on-multi-gpu

Tensorflow2 training code with jit compiling on multi-GPU.
https://github.com/sseung0703/tf2-jit-compile-on-multi-gpu

jit-compilation multi-gpu-training tensorflow2 xla

Last synced: 5 months ago
JSON representation

Tensorflow2 training code with jit compiling on multi-GPU.

Awesome Lists containing this project

README

          

## Tensorflow2 with jit (xla) compiling on multi-gpu training.
- CIFAR and ILSVRC training code with **jit compiling** and **distributed learning** on the multi-GPU system.
- I highly recommend using Jit compiling because most of the algorithm is static and can be compiled, which gives memory usage reduction and training speed improvement.
- This repository is built by **custom layers** and **custom training loop** for my project, but if you only want to check how to use jit compiling with distributed learning, check 'train.py' and 'op_util.py'.

## Requirement
- **Tensorflow >= 2.5**
- Pillow

## How to run
- ILSVRC
```
python train.py --compile --gpu_id {} --dataset ILSVRC --data_path /path/to/your/ILSVRC/home --train_path /path/to/log
```

- CIFAR{10,100}
```
python train.py --compile --gpu_id {} --dataset CIFAR{10,100} --train_path /path/to/log
```

## Experimental results
- I used four 1080ti.
- Jit compiling gives a 40% speedup for training time.

| | Accuracy | Training time
|------------| ------------- | -------------
|Distributed only | 75.83 | 94.61
|Distributed with Jit | 75.57 | 56.98


Training plot of ResNet-56 on ILSVRC-2012