# Bug on running TorchScript on H100

**URL:** <https://discuss.pytorch.org/t/bug-on-running-torchscript-on-h100/219006>\
**Category:** jit\
**Created:** [April 12, 2025, 8:20pm UTC](https://discuss.pytorch.org/t/bug-on-running-torchscript-on-h100/219006 "2025-04-12T20:20:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeybydun1](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mikeybydun1/32/76583_2.png) [@mikeybydun1](https://discuss.pytorch.org/u/mikeybydun1)\
**Post date:** [April 12, 2025, 8:20pm UTC](https://discuss.pytorch.org/t/bug-on-running-torchscript-on-h100/219006/1 "2025-04-12T20:20:44Z")

</div>

Hello,  
I have a torch script that using torch 1.13.0 (cuda version),  
I am compiling a pytorch code into .pt file and then run the model.  
On every gpu its working well (a100 for example),  
but when i run the same code on NVIDIA H100 the results just became nan.  
Do you have any idea why?  
Pytorch version? what i need to configure?  
Thanks!

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [April 12, 2025, 9:02pm UTC](https://discuss.pytorch.org/t/bug-on-running-torchscript-on-h100/219006/2 "2025-04-12T21:02:42Z")

</div>

PyTorch 1.13.0 was released with CUDA 11.6 and 11.7 while the Hopper architecture was introduced in CUDA 11.8 so you would need to update your PyTorch binary.

---

<div class="post-metadata">

**Author:** ![mikeybydun1](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mikeybydun1/32/76583_2.png) [@mikeybydun1](https://discuss.pytorch.org/u/mikeybydun1)\
**Post date:** [April 12, 2025, 9:04pm UTC](https://discuss.pytorch.org/t/bug-on-running-torchscript-on-h100/219006/3 "2025-04-12T21:04:46Z")

</div>

Thanks you very much my friend,  
I have another question. I have a PyTorch torch script that do:  
torch.prod of tensor in this shape: (1000,400,400,144).  
This takes so much time (10 seconds on A100),  
The only effective optimization i found is using bfloat16.  
You have other suggestions?  
Thanks!

---

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [April 13, 2025, 7:16pm UTC](https://discuss.pytorch.org/t/bug-on-running-torchscript-on-h100/219006/4 "2025-04-13T19:16:53Z")

</div>

Using a lower `dtype` sounds like a good idea.
