Graph Machine Learning
AnemoI
English
anaprietonem commited on
Commit
2309a51
·
verified ·
1 Parent(s): c5e5501

Upload run_AIFS_v1.ipynb

Browse files
Files changed (1) hide show
  1. run_AIFS_v1.ipynb +2 -2
run_AIFS_v1.ipynb CHANGED
@@ -594,7 +594,7 @@
594
  "cell_type": "markdown",
595
  "metadata": {},
596
  "source": [
597
- "** Note - changing the device from GPU to CPU**\n",
598
  "\n",
599
  "- Running the transformer model used on the CPU is tricky, it depends on the FlashAttention library which only supports Nvidia and AMD GPUs, and is optimised for performance and memory usage\n",
600
  "- In newer versions of anemoi-models, v0.4.2 and above, there is an option to switch off flash attention and uses Pytorchs Scaled Dot Product Attention (SDPA). The code snippet below shows how to overwrite a model from a checkpoint to use SDPA. Unfortunately it's not optimised for memory usage in the same way, leading to much greater memory usage. Please refer to https://github.com/ecmwf/anemoi-inference/issues/119 for more details "
@@ -682,7 +682,7 @@
682
  "torch.use_deterministic_algorithms(True)\n",
683
  "\n",
684
  "```\n",
685
- "Using the above will lead to a significant increase in runtime. Additionally, the input conditions here are provided by open data. The reprojection performed on open data differs from the one carried out at the operational level, hence small differences in the forecast are expected."
686
  ]
687
  },
688
  {
 
594
  "cell_type": "markdown",
595
  "metadata": {},
596
  "source": [
597
+ "**Note - changing the device from GPU to CPU**\n",
598
  "\n",
599
  "- Running the transformer model used on the CPU is tricky, it depends on the FlashAttention library which only supports Nvidia and AMD GPUs, and is optimised for performance and memory usage\n",
600
  "- In newer versions of anemoi-models, v0.4.2 and above, there is an option to switch off flash attention and uses Pytorchs Scaled Dot Product Attention (SDPA). The code snippet below shows how to overwrite a model from a checkpoint to use SDPA. Unfortunately it's not optimised for memory usage in the same way, leading to much greater memory usage. Please refer to https://github.com/ecmwf/anemoi-inference/issues/119 for more details "
 
682
  "torch.use_deterministic_algorithms(True)\n",
683
  "\n",
684
  "```\n",
685
+ "Using the above approach will significantly increase runtime. Additionally, the input conditions come from open data, which we reproject from o1280 (the original projection of IFS initial conditions) to n320 (AIFS resolution) by first converting them to a 0.25-degree grid. In the operational setup, however, data is reprojected directly from o1280 to n320. This difference in reprojection methods may lead to variations in the resulting input conditions, causing minor differences in the forecast."
686
  ]
687
  },
688
  {