Log in

View Full Version : AMD Ryzen x264 optimisation


hajj_3
2nd March 2017, 14:05
I was wondering whether the latest x264 build has been optimised for amd's new ryzen chips or will a new build be released shortly that will be optimised for it?

soneca
2nd March 2017, 16:47
If it is optimized I do not know, but I really enjoyed this test (http://www.guru3d.com/articles_pages/amd_ryzen_7_1800x_processor_review,11.html). :cool:

Groucho2004
2nd March 2017, 19:48
Ryzen seems to do very well with x264:
(from http://www.hardware.fr/articles/956-13/encodage-video-x264-x265.html)

http://www.hardware.fr/getgraphimg.php?id=446&n=9

dipje
3rd March 2017, 14:57
maybe very simple thinking, but since it doesn't really introduce new instructions or anything I don't think there's much to optimize?

Groucho2004
3rd March 2017, 15:20
maybe very simple thinking, but since it doesn't really introduce new instructions or anything I don't think there's much to optimize?Pretty much, yes. The fact that it supports AVX2 is probably the reason it performs so well with (lib)x264.

So, the answer to the OP is that x264 is already optimized for Ryzen.

nevcairiel
3rd March 2017, 16:43
AMDs AVX2 implementation is slower then Intels (AMD implements it by combining two 128-bit execution ports, Intel has proper 256-bit ports), but the higher clocks then a 6900K probably make up for the difference. Plus that AVX2 can actually cause Intel CPUs to clock down since it needs extra power, have to be careful when using it.

NikosD
4th March 2017, 19:39
Ivy bridge with no AVX2 is 5% slower than Haswell with AVX2 support using the same clock and x264.

So, x264 uses just a little AVX2 instructions.

I really don't think that x264 will be optimized for AVX2, so no x264 will not use any new (actually 2013) instruction set.

But the lack of AVX2 optimizations is the reason that Ryzen performs so well (!)

Because if x264 was heavily optimized for AVX2, Ryzen would definitely be slower than Intel's CPUs due to double speed of AVX/AVX2 implementation by Intel.

So, it's better to stay that way for RyZen.

Atak_Snajpera
4th March 2017, 19:56
Ivy bridge with no AVX2 is 5% slower than Haswell with AVX2 support using the same clock and x264.

So, x264 uses just a little AVX2 instructions.

I really don't think that x264 will be optimized for AVX2, so no x264 will not use any new (actually 2013) instruction set.

But the lack of AVX2 optimizations is the reason that Ryzen performs so well (!)

Because if x264 was heavily optimized for AVX2, Ryzen would definitely be slower than Intel's CPUs due to double speed of AVX/AVX2 implementation by Intel.

So, it's better to stay that way for RyZen.

To be exact AVX2 is not 2x faster in practice. 1.7x is max you can get in real life scenarios
http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/performance-xeon-e5-v3-advanced-vector-extensions-paper.pdf

NikosD
4th March 2017, 19:59
It's ~2x faster than RyZen's implementation due to 128bit vs 256 bit which is validated in real world results as I have already posted in x265 thread.

There are a lot of AVX/AVX2 real world results confirming x2 performance of Intel over RyZen

Atak_Snajpera
4th March 2017, 20:12
Performance of AVX1 should be similar to Intel because Ryzen has 2xFADD 128bit+2xFMUl 128bit. For example SandyBridge has FAAD 256bit + FMUL 256 bit.
AVX2 is a different story due to added FMA3. Ryzen basically can not execute AVX256bit+FMA in single clock like Haswell.

NikosD
4th March 2017, 20:18
No, your assumption is wrong.

For AVX, we are comparing 2 FMACs of 256bit of Haswell and onwards vs 2 FMACs (2 FADD + 2 FMUL) of 128 bit of RyZen.

So, RyZen has half speed of AVX execution.

Sagittaire
5th March 2017, 10:41
Because if x264 was heavily optimized for AVX2, Ryzen would definitely be slower than Intel's CPUs due to double speed of AVX/AVX2 implementation by Intel.

.

Well if you want say that i7 6900K will be 100% faster than R7 1800X because AVX/AVX2 is 100% faster for Intel than AMD, it's completely false. Simply because x265 is not 100% write for AVX/AVX2 instruction.

I read a x265 test for i3-7950K (2C/4T) vs G4620 (2C/4T) at same clock. i3-7950K have AVX/AVX2 instruction and not for G4620. At same clock, there are less than 10% difference between i3-7950K and G4620.

Moreover there are already test in net for Rysen 7 vs i7 6900K:
http://www.hardware.fr/getgraphimg.php?id=446&n=10
http://www.kitguru.net/wp-content/uploads/2017/03/x265.png

Sagittaire
5th March 2017, 10:50
And 265dev will introduce specifical Ryzen optimisation soon ... ;)

NikosD
5th March 2017, 11:12
Well if you want say that i7 6900K will be 100% faster than R7 1800X because AVX/AVX2 is 100% faster for Intel than AMD, it's completely false. Simply because x265 is not 100% write for AVX/AVX2 instruction.


Never said that, it's too simplistic.

But if someone optimizes the critical, time consuming paths in AVX2, then yes the performance of RyZen on those critical AVX2 instructions will be roughly at half speed of Intel's Haswell and onwards CPUs.

Many times that means roughly half speed of the whole app, though.

It depends on the app.

I read a x265 test for i3-7950K (2C/4T) vs G4620 (2C/4T) at same clock. i3-7950K have AVX/AVX2 instruction and not for G4620. At same clock, there are less than 10% difference between i3-7950K and G4620.


That's an interesting test.
Can you post a link?

I have done many tests on x265 using Sandybridge vs Haswell and the difference was huge, more than 40% IIRC.

And that answers your previous assumption regarding x265 dependance on AVX2 instructions.

But that 10% you posted, is way too low.


Moreover there are already test in net for Rysen 7 vs i7 6900K:
http://www.hardware.fr/getgraphimg.php?id=446&n=10
http://www.kitguru.net/wp-content/uploads/2017/03/x265.png

You keep posting the same two reviews that favor RyZen over 6900K but there are about 6 or 7 other reviews, favoring 6900K and even Kabylake on x265.

Just take a look at anandtech comparison which is the worst for RyZen I think.

hajj_3
5th March 2017, 11:32
that benchmark image uses x265 v2.1, we could do with benchmarks using latest build ideally.

Sagittaire
5th March 2017, 11:36
Never said that, it's too simplistic.
Just take a look at anandtech comparison which is the worst for RyZen I think.

You are serious?

http://images.anandtech.com/graphs/graph11170/85887.png

http://images.anandtech.com/graphs/graph11170/85885.png

annand bench for x264/x265 is simply the worst on the net. Certainely not really good thread optimisation even for x264. In annand bench, i7-7700K, Rysen 7 or i7-6900K have the same speed. i7-6900K and rysen 7 outperform i7-7700K in all other bench on the net for x264. Annand tech bench is really bad exemple. in this test 4C/4T can fight with 8C/16T CPU. Really ridiculous test.

nevcairiel
5th March 2017, 11:41
For many people its not really important how some optimized benchmark runs, but how a real-world application runs. And if those Handbrake settings are more-or-less what reflects real-world use, then the benchmarks serve a useful purpose.

NikosD
5th March 2017, 11:42
You don't seem too serious for me.

I told you first that anandtech is the worst.

But there are at least 5 or 6 more reviews that don't favor Ryzen at all on x265.

Also, you seem that you select your replies carefully in order to seem that you are always right, even if that represents the 10% of the whole truth.

Still waiting for the link of the comparison between Core i3 vs Pentium Kabylake on x265

Sagittaire
5th March 2017, 11:53
Still waiting for the link of the comparison between Core i3 vs Pentium Kabylake on x265

well i don't find it. Annand tech bench is simply really ridiculous test for x264 and x265. 4C/4T at same level than 8C/16T is simply ridiculous.

Anyway you have Rysen 7 vs i7 6900K test and it's less than 10% in all case, isn't?

I can find all the test in the net if you want ... ;-)

Sagittaire
5th March 2017, 12:08
here interessing comparison at same clock for all CPU. Try to explain AVX/AVX2 disavantage for Rysen in this x265 test if you want ... ;-)

http://www.overclockers.com/amd-ryzen-7-1800x-cpu-review/

https://www.overclockers.com/wp-content/uploads/2017/02/image007_2.png

Atak_Snajpera
5th March 2017, 13:02
AVX2 in x265 gives huge speed boost! My SandyBridge E5-2690 is being destroyed by CPU's with AVX2 on board! Yes CPU usage is always at 100%!

Effective clock speed during test on E5-2690 is 3.2GHz.

http://i.imgsafe.org/bfdb30b9ac.png

MasterNobody
5th March 2017, 20:45
People should understand that x265 is faster on CPUs with AVX2 not only because this instructions are faster on them (due full 256-bit pipeline support) but because non-AVX2 code path can not exist at all or be not so optimized for this old instruction sets. So even emulation of 256-bit instructions (with 128-bit pipeline) can result in faster code path than non-AVX2 fallback code path.