It is the same PyTorch whether it runs on an AMD or an NVIDIA GPU.
The exact same PyTorch, actually.
Are you're trying to suggest that the machine code that runs on the GPU is the one that is different?
If you knew a bit more, you would know that this is the case even between different generations of GPUs of the same vendor; making that argument completely absurd.
And here is pretty damning evidence that you're full of shit: https://github.com/ggml-org/llama.cpp/blob/master/ggml/src/g...
The ggml-hip backend references the ggml-cuda kernels. The "software is the same" (as in, it is CUDA) and yet AMD is still behind.