CUDA cores numbers or gpu memory size who make baking go faster ?

i wanna to buy one of this two gpu’s but i noticed that one of this two gpu’s have a version with 2gb memory but with more CUDA Cores then another one with 4 gb memory so any one is better for baking ?

GeForce GTX 770 with 1536 CUDA Cores this gpu have a version with 2gb memory and other one with 4 gb
or

GeForce GTX 1050 Ti with 768 CUDA Cores that’s have 4 gb memory

Shader core count isn’t everything, IPC can improve from generation to generation and per-core frequency should be accounted for as well.

I’d go with a 1060 over those you listed any day, but then I wouldn’t even care about the speed as much as GPU memory quantity which is why I went for a factory over-clocked RX 470 8GB rather than say a RX 480 4GB or a GTX 1060 6GB.

Why prioritize memory over performance? Run out of memory and depending on renderer used either you will start paging to slower memory or just crash. In cycles(GPU) you would crash the renderer.

^This.

Also: Comparing core counts across several generations of nVidia cards is comparing apples to oranges…
BTW, the GTX 770 is just a rebranded and slightly overclocked GTX 680, so that card is even older than you might think.

thanks guys very usefull informations