It is currently Thu Mar 28, 2024 6:41 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 20 posts ] 
Author Message
Offline
 Post subject: RAM Latency
Post #1 Posted: Sat May 06, 2023 12:28 am 
Judan

Posts: 6087
Liked others: 0
Was liked: 786
For a desktop with Ryzen 7700 and B650 Tomahawk and RTX 4070 to build, I can choose RAM

- DDR5-5600 CL28-34-34-89 with at most 2 DIMM (64GB)

- DDR5-4800 CL38-38-38 with up to 4 DIMM (now 64GB, later optionally 128GB)

The slower RAM has the option of 4 DIMMs.

I think the speed 5600 or 4800 is immaterial, right?

The latency might be more relevant, but is it? Does it make a significant difference for KataGo to use CL28-34-34 or CL38-38-38?

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #2 Posted: Sat May 06, 2023 2:19 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
I would run the test on the existing hardware, then change the timings and run the test again

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #3 Posted: Sat May 06, 2023 2:43 am 
Judan

Posts: 6087
Liked others: 0
Was liked: 786
Someone might. I can't because first I need to buy the computer:) When doing so, I want to get the more appropriate RAM.

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #4 Posted: Sat May 06, 2023 2:48 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
if you are interested, I can test on different frequencies, write an approximate configuration of the katago version, network

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #5 Posted: Sat May 06, 2023 2:56 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
you will most likely run a non-CPU version, in my opinion the difference will be very insignificant

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #6 Posted: Sat May 06, 2023 5:13 am 
Lives in sente
User avatar

Posts: 1308
Liked others: 14
Was liked: 153
Rank: German 1 Kyu
For my Igo Hatsuyôron 120 @ KataGo 60b training project, selfplay is running on Ryzen 5950 / RTX 3090, using about "only" 18 GByte of SYSTEM memory.
Therefore, I do not assume that SYSTEM memory is any limiting factor, especially not for your likely purposes of analysis.

_________________
The really most difficult Go problem ever: https://igohatsuyoron120.de/index.htm
Igo Hatsuyōron #120 (really solved by KataGo)

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #7 Posted: Sat May 06, 2023 5:34 am 
Judan

Posts: 6087
Liked others: 0
Was liked: 786
As has been reported, ca. 6h of calculating ca. 20 million playouts by two 2080TI can fill ca. 64GB of RAM. As I might also want to study complex global ko fights, many playouts can be useful.

Frequencies are less interesting so please do not spend more than a few minutes on them. I have been hoping for somebody to have done RAM tests before or collected experience with different RAM parameters.

I am more interested in RAM latencies. So a bit of more study time for them would be welcome.

Yes, I would run on the GPU rather than nothing but the CPU. That is what graphics cards are for, after all:)

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #8 Posted: Sun May 07, 2023 9:45 am 
Lives in sente
User avatar

Posts: 1308
Liked others: 14
Was liked: 153
Rank: German 1 Kyu
What do you expect from 20 million playouts?

_________________
The really most difficult Go problem ever: https://igohatsuyoron120.de/index.htm
Igo Hatsuyōron #120 (really solved by KataGo)

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #9 Posted: Sun May 07, 2023 12:35 pm 
Judan

Posts: 6087
Liked others: 0
Was liked: 786
Greater confidence than from 20 thousand.

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #10 Posted: Sun May 07, 2023 2:56 pm 
Lives in sente
User avatar

Posts: 1308
Liked others: 14
Was liked: 153
Rank: German 1 Kyu
RobertJasiek wrote:
Greater confidence than from 20 thousand.

If your net is familiar with the position under examination, 20 thousand playouts are more than enough.
If it is not, even 20 billion playouts will not really help.

The more unrealistic the position (in the sense of "never seen in training so far"), the more likely it is that you will have to train your net accordingly.

_________________
The really most difficult Go problem ever: https://igohatsuyoron120.de/index.htm
Igo Hatsuyōron #120 (really solved by KataGo)

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #11 Posted: Mon May 08, 2023 2:36 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
I started katago_tensorRT (gf 1650 gtx, 18b, 60 sec) 3 times (DDR4 2400 17 17 17 39): 19098, 15387, 16296 visits
and 3 times (DDR4 2133 15 15 15 35): 19735, 21400, 17456 visits
I started it in sabaki, connected the engine again every time and katago made the first move

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #12 Posted: Mon May 08, 2023 2:59 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
https://ram.userbenchmark.com/Software

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #13 Posted: Mon May 08, 2023 3:38 am 
Judan

Posts: 6087
Liked others: 0
Was liked: 786
Code:
(DDR4 2400 17 17 17 39): average, 19098, 15387, 16296 visits
---------- 100% -------- 100%     100%   100%   100%
(DDR4 2133 15 15 15 35): average, 19735, 21400, 17456 visits
-----------113.3% ------ 116.5%   103.3% 139.1% 107.1%


Supposing only the RAM parameters differed and software details were immaterial, we get the following: The relative speed of the first RAM latency value is almost the average improved percentage of numbers of visits. The RAM frequency seems to be immaterial, or is dominated by the minor latencies. Of course the test sample is small. If, however, we trust it, the conclusion seems to be that RAM latency is a decisive factor!

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #14 Posted: Mon May 08, 2023 7:48 am 
Lives in sente

Posts: 905
Liked others: 22
Was liked: 168
Rank: panda 5 dan
IGS: kvasir
I suspect you are drawing incorrect conclusions.

Maybe one device is faster but CL of 15 or CL of 17 is the CAS latency in clock cycles, which needs to be divided by the bus speed in hertz to get the cache latency in seconds (usually reported in nano seconds). When a CL 15 device runs on a bus speed of 1066.67 MHz and a CL 17 device runs on 1200 Mhz (which is supposed to be the standard specification) then the CAS latency is 14.063 ns and 14.16 ns respectively. A difference of 0.69%.

The experiment compares a device with a lower data rate and a higher latency with a device with a higher data rate and a lower latency, or that would appear to be the case. I don't know if it's the case or not, but possibly the DDR4 2133 was actually running at the same bus speed as the DDR4 2400. Usually RAM and mother boards have documentation for recommended settings, that would mean the DDR4 2133 15-15-15-35 was basically a DDR4 2400 15-15-15-35 and the CAS latency would be 12.5 ns. These RAM devices use an external clock and usually there are more than one recommended setting.

I'd expect (maybe as a first hypothesis) that comparison of the wall time for a fully memory bound computation that doesn't take advantage of prefetching (or can't benefit) to have a close correspondence to the difference in clock latency measured in nano seconds. If the computation takes advantage of prefetching (from memory into CPU cache) I'd expect a correspondence to the difference in memory transfer rate. One possibility is that the behavior is more indicative of the program used to control KataGo, I think I remember that Sabaki is a Python program and I usually use Katrain, another Python program, and observe that it occasionally uses a lot of memory and CPU and GPU resources (that is the Graphical Processing Unit not the Go Processing Unit).

The DDR5 devices quoted (far) above are different in that one has both a higher data rate and a lower latency than the other, it's should be better all around. The only issue is the possibility the cost of upgrading memory later.

By the way the official AMD website states that the CPU (same CPU or?) supports 4 DIMMs for DDR5-3600 or less and 2 DIMMs for DDR5-5200 or less. With this information I'd assume that the 4x DDR5-4200 or 2x DDR5-5600 would operate as DDR5-3600 or DDR5-5200, since the memory controller is, I believe, built into the AMD CPUs. Then again AMD does somewhat encourage overclocking, it's supposed to void the warranty though.

===Edit for some reason I wrote cache latency but it's called call CAS latency (column address strobe latency).


Last edited by kvasir on Mon May 08, 2023 11:23 am, edited 1 time in total.
Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #15 Posted: Mon May 08, 2023 11:07 am 
Judan

Posts: 6087
Liked others: 0
Was liked: 786
Are you effectively trying to say that we do not have enough information to judge whether the RAM with higher frequency or the RAM with lower latency is better for us?

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #16 Posted: Mon May 08, 2023 12:36 pm 
Lives in sente

Posts: 905
Liked others: 22
Was liked: 168
Rank: panda 5 dan
IGS: kvasir
RobertJasiek wrote:
Are you effectively trying to say that we do not have enough information to judge whether the RAM with higher frequency or the RAM with lower latency is better for us?


The DDR5-5600 that you cited is faster in every regard.

* DDR5-5600 CL28-34-34-89

Maximum transfer speed: 44.8 GiB (5600 M/T * 8 B/t)
Bus speed: 2800 MHz (5600 M/T * 1 / (2 T))
CAS latency: 10 ns (28 / 2800 MHz)

* DDR5-4800 CL38-38-38

Maximum transfer speed: 38.4 MiB
Bus speed: 2400 MHz
CAS latency: 15.8 ns

If the only question is which memory device serves data faster, then it is the DDR5-5600. It both transfers more per second and starts transferring quicker. In that sense it's enough information.

If this is a question on the measurements by And using different DDR4 memories then there might not be enough information to interpret it. At least drawing the conclusion that the difference was due to CAS latency doesn't seem right.

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #17 Posted: Mon May 08, 2023 2:42 pm 
Judan

Posts: 6087
Liked others: 0
Was liked: 786
Further considerations:
- Does the RAM cooler fit under the CPU cooler?
- Does the mainboard or RAM manifacturer confirm compatibility for a model set of a particular GB size and number of occupied DIMMs?
- Is it RGB or not and which does one prefer?
- Is the price difference too large?
As it turns out after closer inspection, I may have to bow to such soft criteria. (I do not choose other mainboard and CPU cooler just to get the perfect RAM modules.)

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #18 Posted: Tue May 09, 2023 1:56 am 
Judan

Posts: 6087
Liked others: 0
Was liked: 786
https://timdettmers.com/2018/12/16/deep ... Clock_Rate

Tim Dettmers writes that fast versus slow RAM makes 0 ~ 3% speed difference for machine learning. I conclude that spending €30 on much faster RAM might be worth it (ca. 1.5% of a €2000+ desktop price) but not €50. More important may be RAM stability and longevity.

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #19 Posted: Thu May 11, 2023 8:52 am 
Gosei
User avatar

Posts: 1348
Liked others: 202
Was liked: 203
I changed the processor to Ryzen 5 (there was an athlon x4), the memory is the same, (DDR4 2667 20 19 19 43): 10739, 11473, 11164 visits.
started tuning katago again, after: 10964

Top
 Profile  
 
Offline
 Post subject: Re: RAM Latency
Post #20 Posted: Thu May 11, 2023 10:16 am 
Judan

Posts: 6087
Liked others: 0
Was liked: 786
As it has turned out, the alleged 4 DIMM option was a mistake on the mainboard reference page. After more careful inspection, I have also noticed that the smallest CL stick is incompatible to my chosen board. The cheapest module has not been readily available. So I am settling for some reasonable compromise for a typical market price after all;) It remains the most important that RAM sticks do work at all together with the chosen CPU and mainboard! Nevertheless, the discussion has been interesting and might help others.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group