| Batch | Results | Inference Time (sec) |
|---|---|---|
| Batch 1 | ![]() | 27.7s |
| Batch 2 | ![]() | 55.0s |
| Batch 3 | ![]() | 1m.24s |
##. Potential Overhead from Loop-Based Batch Processing
In some parts of the code, you may see a pattern like:
for (int i = 0; i < batch_size; i++) {
concat.slice(0, i, i + 1).copy_(encoder_hidden_states.slice(0, i, i + 1));
qkv_proj.forward(...);
// ...
}
Jupyter Notebook
88.4%
Cuda
5.1%
Python
3.8%
C++
2.3%
| Batch | Results | Inference Time (sec) |
|---|---|---|
| Batch 1 | ![]() | 27.7s |
| Batch 2 | ![]() | 55.0s |
| Batch 3 | ![]() | 1m.24s |
##. Potential Overhead from Loop-Based Batch Processing
In some parts of the code, you may see a pattern like:
for (int i = 0; i < batch_size; i++) {
concat.slice(0, i, i + 1).copy_(encoder_hidden_states.slice(0, i, i + 1));
qkv_proj.forward(...);
// ...
}
Jupyter Notebook
88.4%
Cuda
5.1%
Python
3.8%
C++
2.3%