Hi,
A bunch of cpu acceleration is already implemented in pytorch for low level functions, in particular, if you use high quality blas libraries. If your custom uses them then it would already work.
If you need this for a new function that you implement, then you just need to implement it using it with the proper c flags to make sure it compiles on cpus that do not support them. All currently implemented code can be found in this 46 folder. And you can find the dispatcher function detectHostSIMDExtensions 52 for different architectures.
For AVX-512 (which is not used) in particular, you can look at this 285 issue.