When trying to follow this guide to convert deepseek fp8 weight to bf16 (for converting to gguf):
https://huggingface.co/huihui-ai/DeepSeek-R1-bf16
I found out the fp8_cast_bf16.py requires >50GB vram to run. (It uses triton thus it requires nvidia gpu to run.)
I asked deepseek R1 website version to rewrite the code to reduce vram requirement, and this is the resulting code.