Is there a way to speed up the .predict() method? ...
# neural-forecast
a
Is there a way to speed up the .predict() method? The
'predicting dataloader'
takes quite sometime to complete and it feels like a bottleneck. I've already disabled some loggers as below.
Copy code
warnings.simplefilter("ignore", DeprecationWarning)
 warnings.simplefilter("ignore", FutureWarning)
 logging.getLogger("nhits").setLevel(logging.ERROR)

NFO:lightning_fabric.utilities.seed:Global seed set to 1
 Epoch 0:  0%|                           | 10/4800 [00:07<1:02:45, 1.27it/s, v_num=66764, train_loss_step=0.891, train_loss_epoch=2.270]
 Training model: model_input_LeakyReLU__HuberLoss_202310060621
 Predicting DataLoader 0: 100%|█████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 161.28it/s]
 Predicting DataLoader 0: 100%|█████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 159.98it/s]
 Predicting DataLoader 0: 100%|█████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 115.89it/s]
k
Hey @Afiq Johari I think some of the bottle neck can be traced back to these forecast parsing functions: • https://github.com/Nixtla/neuralforecast/blob/main/neuralforecast/core.py#L41https://github.com/Nixtla/neuralforecast/blob/main/neuralforecast/core.py#L80https://github.com/Nixtla/neuralforecast/blob/main/neuralforecast/core.py#L102 We would need to confirm the bottleneck. My intuition is to that vectorizing the functions can improve the speed.
🙏 1