openclimatefix / nowcasting_forecast

Making live forecasts for the nowcasting project
MIT License
5 stars 2 forks source link

Use AITemplate for faster inference? #167

Open jacobbieker opened 2 years ago

jacobbieker commented 2 years ago

Detailed Description

https://github.com/facebookincubator/AITemplate

This is a new thing for PyTorch that compiles the models down to CUDA kernels for fast inference. There are still some caveats, but it might be worth it for larger models, like Power Perceiver, or possibly MetNet for making it quicker and cheaper inference.

Context

Possible Implementation

peterdudfield commented 1 year ago

Thanks @jacobbieker for this. How big is the MetNet model? How long is training taking?

jacobbieker commented 1 year ago

Metnet is quite large, haven't trained it yet, still doing the last debugging with the datapipe, but I'd expect it to be quite a bit faster than power perceiver and probably smaller?

peterdudfield commented 1 year ago

Metnet is quite large, haven't trained it yet, still doing the last debugging with the datapipe, but I'd expect it to be quite a bit faster than power perceiver and probably smaller?

When you start, do you mind saying how many parameters it is? Just to get some comparison to PP

peterdudfield commented 1 year ago

PP is 366 million parameters Metnet ~ 2.3 million, Metnet2 ~ 173 million

jacobbieker commented 1 year ago

Another thing for speeding up the loading of models can be HF's new safe tensors: https://github.com/huggingface/safetensors