Skip to content

Commit

Permalink
Fix GreenTrainer img
Browse files Browse the repository at this point in the history
  • Loading branch information
hosiet committed Sep 27, 2023
1 parent f486014 commit 3e2187f
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 6 deletions.
Binary file removed assets/media/2023-greentrainer/basic_results.PNG
Binary file not shown.
Binary file added assets/media/2023-greentrainer/basic_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/media/2023-greentrainer/bp_flops_model.PNG
Binary file not shown.
Binary file added assets/media/2023-greentrainer/bp_flops_model.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/media/2023-greentrainer/llm_size.PNG
Binary file not shown.
Binary file added assets/media/2023-greentrainer/llm_size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions content/publication/2023-greentrainer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,33 @@ Fine-tuning with fixed selections of NN components in inefficient. It either sig
In GreenTrainer, we develop a tensor importance metric that incorporates parameter dependencies to evaluate how fine-tuning each tensor contributes to the
trained model’s accuracy at runtime. Knowledge about such tensor importance, then, allows us to achieve the desired FLOPS reduction while maximizing the model accuracy.

![The Need for Adaptive Backpropagation](2023-greentrainer/need_for_adaptive_bp.PNG)
![The Need for Adaptive Backpropagation](2023-greentrainer/need_for_adaptive_bp.png)

## FLOPs Model of Backpropagation
The design of GreenTrainer relies on proper calculation of the selected model substructures’ backpropagation FLOPs, which can be decomposed into two parts using the chain rule. For example, when training a 4-layer dense NN without bias, each layer computes i) $dy_i$ as the loss L’s gradient w.r.t the activation $y_i$, and ii) $dw_i$ as the loss gradient w.r.t weight $W_i$. Based on this rationale, we can construct FLOPs models for LLM substructures, including MHA and
FFN.

![FLOPs Model of Backpropagation](2023-greentrainer/bp_flops_model.PNG)
![FLOPs Model of Backpropagation](2023-greentrainer/bp_flops_model.png)


## Tensor FLOPs Profiling
GreenTrainer constructs the LLMs FLOPs model by profiling tensor FLOPs. First, we convert the layer-based NN structure of LLMs into a tensor-level computing graph, which retains the execution order of all tensors’ involvements in training. Then, we extract the related backpropagation operators of each tensor, and derive each tensor $i$’s FLOPs in backpropagation ($t_{dy_i}$ and $t_{dw_i}$) by matching and
aggregating the FLOPs of these NN operators.

![Tensor FLOPs Profiling](2023-greentrainer/tensor_flops_profiler.PNG)
![Tensor FLOPs Profiling](2023-greentrainer/tensor_flops_profiler.png)


## Experimental Results
We evaluated the training performance of GreenTrainer with three open-sourced LLMs, namely OPT, BLOOMZ and FLAN-T5, on text generation datasets including SciTLDR and DialogSum. We compare GreenTrainer's performance with existing efficient fine-tuning techniques such as Prefix Tuning and LoRA.

Our experiment results show that GreenTrainer can save up to 64% training FLOPs compared to full LLM fine-tuning, without any noticeable accuracy loss. Compared to existing fine-tuning techniques such as Prefix Tuning and LoRA, GreenTrainer can improve the model accuracy by 4%, with the same amount of FLOPs reduction!

![Training Cost & Accuracy](2023-greentrainer/basic_results.PNG)
![Training Cost & Accuracy](2023-greentrainer/basic_results.png)

GreenTrainer provides users with the flexibility to balance between the training accuracy and cost depending on the specific needs of green AI!

![Different FLOPs Objectives](2023-greentrainer/different_objective.PNG)
![Different FLOPs Objectives](2023-greentrainer/different_objective.png)

GreenTrainer maintains good performance on fine-tuning different LLM sizes!

![Different LLM Sizes](2023-greentrainer/llm_size.PNG)
![Different LLM Sizes](2023-greentrainer/llm_size.png)

0 comments on commit 3e2187f

Please sign in to comment.