Skip to content

Commit 759c849

Browse files
committed
Add times
1 parent 62671c9 commit 759c849

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed

img/training_times.png

59.4 KB
Loading

results_description.md

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,69 @@
11
# Results
22

3-
File devoted to an accurate description of results.
3+
In this section we will describe the results obtained from the experiments conducted in this project. Specifically, we will focus on the following aspects:
4+
5+
- **Accuracy**: The performance of the model in terms of accuracy.
6+
- **Time**: The time taken to train the model and make predictions.
7+
- **Memory**: The amount of GPU memory used during training.
8+
- **GPU Usage**: The GPU utilization during training.
49

510
## Accuracy
611

12+
13+
714
## Time
815

16+
### Training Time
17+
Here we present the training times for different models. The training times are measured in seconds and they represent the time taken to complete a single step of training (forward + backward).
18+
19+
![Times](./img/training_times.png)
20+
21+
The same data are repored in the table below:
22+
23+
| Model | 256 | 512 | 784 |
24+
|----------------|--------|--------|--------|
25+
| S4 | 169.14 | 288.95 | 483.29 |
26+
| S4D Real | 4.43 | 5.72 | 6.49 |
27+
| S4D Inv | 4.61 | 5.94 | 6.75 |
28+
| S4 Low Rank | 5.31 | 6.58 | 7.38 |
29+
| S6 | 16.82 | 30.74 | 38.54 |
30+
| Mamba S4D Real | 6.37 | 8.99 | 10.98 |
31+
| Mamba S4D Inv | 6.96 | 9.06 | 11.31 |
32+
| Mamba S4D LR | 7.35 | 9.92 | 12.14 |
33+
| Mamba S6 | 32.6 | 60.58 | 76.23 |
34+
| Gated MLP | 1.56 | 2.03 | 2.28 |
35+
| Transformer | 5.06 | 7.59 | 10.68 |
36+
| LSTM | 1.24 | 1.51 | 1.79 |
37+
38+
From both the table and the figure we can see that the S4 model is the slowest to train, with a huge gap with the other models. The S4D models are significantly faster, with the S4D Real being the fastest. Moreover, the introduction of the Mamba architecture always lead to a significant increase of the training time. As it regard S6 model we can see that it is significantly slower than the S4D models, but still faster than the S4 model. This is due the recurrent nature of the S6 model, which requires more time to compute the forward and backward passes. A more efficient implementation of parallel scannning routine in S6 could lead to a significant speedup with performance comparable to the other architectures. As it regards LSTM and Transformer architecture, we can see that they are close to the S4D models, but way faster than S6.
39+
40+
### Inference Time
41+
42+
Here we present the inference times for different models. The inference times are measured in seconds and they represent the time taken to complete a single step of inference (forward without gradients).
43+
44+
![Inference Times](./img/inference_times.png)
45+
46+
The same data are repored in the table below:
47+
48+
| Model | 256 | 512 | 784 |
49+
|----------------|------|-------|-------|
50+
| S4 | 6.02 | 11.11 | 16.37 |
51+
| S4D Real | 0.25 | 0.29 | 0.29 |
52+
| S4D Inv | 0.26 | 0.3 | 0.3 |
53+
| S4 Low Rank | 0.3 | 0.46 | 0.34 |
54+
| S6 | 0.8 | 0.98 | 0.99 |
55+
| Mamba S4D Real | 0.29 | 0.34 | 0.34 |
56+
| Mamba S4D Inv | 0.3 | 0.34 | 0.34 |
57+
| Mamba S4D LR | 0.45 | 0.39 | 0.53 |
58+
| Mamba S6 | 0.85 | 1.03 | 1.04 |
59+
| Gated MLP | 0.06 | 0.07 | 0.07 |
60+
| Transformer | 0.12 | 0.13 | 0.14 |
61+
| LSTM | 0.07 | 0.09 | 0.1 |
62+
63+
Comparing the results of inference times with the training times we can see that the latter are significantly higher. This is due to the fact that during training we need to compute the gradients and update the weights, while during inference we only need to compute the forward pass. The S4 model is still the slowest, but the gap with the other models is smaller. The S6 model is still slower than Transformer and LSTM based models.
64+
965
## Memory
1066

11-
## GPU Usage
67+
68+
69+
## GPU Usage

0 commit comments

Comments
 (0)