Moderators: hgm, Andres Valverde
Ilari Pihlajisto wrote:- Forcing the engine to use X MB of RAM for everything can be difficult. What if I want to load the 4-men Scorpio bitbases to RAM, and also allocate a certain amount of memory for the hash table?
H.G.Muller wrote:Ilari Pihlajisto wrote:- Forcing the engine to use X MB of RAM for everything can be difficult. What if I want to load the 4-men Scorpio bitbases to RAM, and also allocate a certain amount of memory for the hash table?
Well, so what if you want that? Just subtract the size of the bitbases, together with all other tables you need, from the memory quota, and use that as hash size. That seems easy enough.
The philosophy of WinBoard protocol is that engines should be allowed to optimize their own use of the available resources. The desirability of the GUI telling them what hash size to use is just as large as to have it tell them the value of a Knight and a Bishop.
The division of memory between main hash, Pawn hash, move-generator tables, EGBB, EGTB cache and what have you belongs in the domain of engine tuning.
If we want the GUI to act as an interface for engine tuning through and engine-specific menu, we should define and use a WinBoard equivalent to the UCI option and setoption command. I already have an experimental XBoard version that implements this, through the option feature. If engines want to be told on installation how much EGTB cache to use, they could define a feature option="EGTBcache -spin 0 8 4", and WinBoard can then send option EGTBcache 4 to set it to the user-requested size. I don't think it makes much sense to make this a standard command, as every engine will require a different value for optimal functioning.
Ilari Pihlajisto wrote:It's not always that simple. My chess engine doesn't know (and probably shouldn't know) how much memory the EGBB library uses, unless none of the bitbases are loaded to RAM and only the EGBB cache is used.
That's a good philosophy. But since the memory command already violates the principle of letting engines decide for themselves, and they aren't required to support the command, why not do what UCI does? And it shouldn't just be a matter of philosophy, but also one of practicality. The de facto standard is that engines have a separate setting for hash table size; we should take that into account.
Sure. I think pawn hash, move generator tables, piece-square tables, etc. should be completely left out from these memory limits, they're too insignificant to matter. The main hash table and engame tables are something else.
H.G.Muller wrote:Ilari Pihlajisto wrote:It's not always that simple. My chess engine doesn't know (and probably shouldn't know) how much memory the EGBB library uses, unless none of the bitbases are loaded to RAM and only the EGBB cache is used.
I think it is very important to know that. We cannot have engines using unlimited amounts of memory in addition to what is available. There might be several TeraByte of 8-men bitbass on the machine they are running on, would you want to allow my engine to load it all in memory (preferably during ponder time, of course. )
I don't see how making the engine aware of the resources available to them violates the principle of havng them use the resources in the way that is best for them. Can you elaborate on that?
I also don't see the practicality issue. The de facto standard is actually that every engine uses its own method for setting hash-table or EGTBcache size (hard-coded, though command-line options, in ini files, whatever). Setting the size through the protocol will require a change in the engine. When people make that change, they might as well do it in such a way that it is actually useful.
Why not do it like UCI does? Because what UCI engines do sucks: What if UCI engine A plays UCI engine B on a machine with 512MB RAM, and A uses 256MB worth of bitbases, and B does not use bitbases, and the OS needs 100MB? How would you create fair conditions to play them against each other? Do you think it is fair to let A use 320MB, and B only 64MB, by setting the hash size to 64MB?
If I would develop an engine that does not use hashing for its main transposition table, but, say, a binary tree. (Which could be very competative, if the ordered way of storing the entries would guarantee that almost all accesses to it would be cache hits, rather than cache misses, as they are with Zobrist hashing). Would you want to allow my engine to use 2GB for it, when the hash setting was 64MB, and use that 64MB in addition to the 2GB for Pawn hash, just under the pretext that a binary tree is not hash table?
Perhaps more realistically: my future engines will have on-the-fly EGTBs, and they will need a 1GB buffer to build a 6-men tablebase. And a tablebase is also not a hash table. Should they be allowed to use the 1GB next to their hash tables to build the EGT in ponder time?
The only way to enforce fair conditions when engines are allowed all kind of extras that use memory, besides the number given to them by the GUI, is to hand tune the value given to them for each engine separately. Using a standardized command to convey an engine-specific parameter can only be detrimental, as it will encourage the sending of wrong values, meant for another engine than the one receiving it. So I think standardized options for specifying the size of just the main hash table do more harm than good.
Ilari Pihlajisto wrote:H.G.Muller wrote:Ilari Pihlajisto wrote:It's not always that simple. My chess engine doesn't know (and probably shouldn't know) how much memory the EGBB library uses, unless none of the bitbases are loaded to RAM and only the EGBB cache is used.
I think it is very important to know that. We cannot have engines using unlimited amounts of memory in addition to what is available. There might be several TeraByte of 8-men bitbass on the machine they are running on, would you want to allow my engine to load it all in memory (preferably during ponder time, of course. )
I don't know of any elegant and easy ways to make my engine aware of, not to mention control the EGBB library's memory usage, unless only the cache is used. I think it's the operator/user's job to choose what EGBBs are loaded to memory, and he should of course have some idea of the memory usage. Considering the design and functionality of the Scorpio EGBB library, the memory command is not that practical for controlling EGBB size. Or are there any engines that are doing it?I don't see how making the engine aware of the resources available to them violates the principle of havng them use the resources in the way that is best for them. Can you elaborate on that?
Well, we don't tell human players how many brain cells they may use, they'll use every one they can. So if we really wanted chess engines to be completely independent we'd let them use all the memory they want. But that's just the philosophy, of course it's not practical. So this is kind of a moot point.I also don't see the practicality issue. The de facto standard is actually that every engine uses its own method for setting hash-table or EGTBcache size (hard-coded, though command-line options, in ini files, whatever). Setting the size through the protocol will require a change in the engine. When people make that change, they might as well do it in such a way that it is actually useful.
For an engine that already has a hash size option, it's very easy to implement a command for setting said option. And because it's so easy, we'd have a better chance of getting engine authors to do it.Why not do it like UCI does? Because what UCI engines do sucks: What if UCI engine A plays UCI engine B on a machine with 512MB RAM, and A uses 256MB worth of bitbases, and B does not use bitbases, and the OS needs 100MB? How would you create fair conditions to play them against each other? Do you think it is fair to let A use 320MB, and B only 64MB, by setting the hash size to 64MB?
If fairness is defined by the amount of memory allocated for the engines, then no, that's not fair. But the point of using endgame tables is that they should give an advantage to the engines that use them.Punishing the engine for having endgame tables by reducing its hash size is counter-
productive if we just want both engines to play as well as possible, which is exactly what I want when I'm setting up a tournament. I know that many others think the same way; take a look at CCRL for example. Their testing conditions are clearly unfair by your definition, and they give an advantage to SMP engines and engines with endgame tables. The people who organize engine tournaments are an important part of my target market (for my upcoming GUI at least), so I want to take their needs into account.If I would develop an engine that does not use hashing for its main transposition table, but, say, a binary tree. (Which could be very competative, if the ordered way of storing the entries would guarantee that almost all accesses to it would be cache hits, rather than cache misses, as they are with Zobrist hashing). Would you want to allow my engine to use 2GB for it, when the hash setting was 64MB, and use that 64MB in addition to the 2GB for Pawn hash, just under the pretext that a binary tree is not hash table?
That would be just semantics. Even if the configuration option is called "Hash size", I would consider it the same as transposition table size, and would give your engine the same amount of memory that I give to the opponent. As for the pawn hash, I'd really wonder why you'd need it to be that big. But I'd probably allow it if there was enough free memory (there's plenty on my system).Perhaps more realistically: my future engines will have on-the-fly EGTBs, and they will need a 1GB buffer to build a 6-men tablebase. And a tablebase is also not a hash table. Should they be allowed to use the 1GB next to their hash tables to build the EGT in ponder time?
I would want a separate configuration option (in an ini file, by a command line argument, etc.) which would let me choose which tables to load. And if I wanted to run a match with endgame tables and I had enough RAM, then sure, your engine would get its 1GB of egt memory. I don't know how building the tables during pondering is relevant.The only way to enforce fair conditions when engines are allowed all kind of extras that use memory, besides the number given to them by the GUI, is to hand tune the value given to them for each engine separately. Using a standardized command to convey an engine-specific parameter can only be detrimental, as it will encourage the sending of wrong values, meant for another engine than the one receiving it. So I think standardized options for specifying the size of just the main hash table do more harm than good.
IMO you're pushing the pursuit of fairness so far that it actually hinders progress and handicaps the stronger engines. I guess this is one of those "We agree to disagree" things.
Miguel A. Ballicora wrote:That't not punishment!
You are rewarding an engine that created a necessity for more resources. Why is that fair?
Why if I want more memory because I have a special table for move generation that nobody has?
Fairness come from giving equal resources.
I do not understand how a command that informs the engine the amount of resources allocated to it hinders programs and handicaps stronger engines. If an engine cannot figure out how to use their resources, it is not very smart in my opinion.
H.G.Muller wrote:I don't know of any elegant and easy ways to make my engine aware of, not to mention control the EGBB library's memory usage, unless only the cache is used. I think it's the operator/user's job to choose what EGBBs are loaded to memory, and he should of course have some idea of the memory usage. Considering the design and functionality of the Scorpio EGBB library, the memory command is not that practical for controlling EGBB size. Or are there any engines that are doing it?
Well, we don't tell human players how many brain cells they may use, they'll use every one they can. So if we really wanted chess engines to be completely independent we'd let them use all the memory they want. But that's just the philosophy, of course it's not practical. So this is kind of a moot point.
For an engine that already has a hash size option, it's very easy to implement a command for setting said option. And because it's so easy, we'd have a better chance of getting engine authors to do it.
If fairness is defined by the amount of memory allocated for the engines, then no, that's not fair. But the point of using endgame tables is that they should give an advantage to the engines that use them.Punishing the engine for having endgame tables by reducing its hash size is counter-productive if we just want both engines to play as well as possible, which is exactly what I want when I'm setting up a tournament.
I know that many others think the same way; take a look at CCRL for example. Their testing conditions are clearly unfair by your definition, and they give an advantage to SMP engines and engines with endgame tables. The people who organize engine tournaments are an important part of my target market (for my upcoming GUI at least), so I want to take their needs into account.
That would be just semantics. Even if the configuration option is called "Hash size", I would consider it the same as transposition table size, and would give your engine the same amount of memory that I give to the opponent. As for the pawn hash, I'd really wonder why you'd need it to be that big. But I'd probably allow it if there was enough free memory (there's plenty on my system).
I would want a separate configuration option (in an ini file, by a command line argument, etc.) which would let me choose which tables to load. And if I wanted to run a match with endgame tables and I had enough RAM, then sure, your engine would get its 1GB of egt memory. I don't know how building the tables during pondering is relevant.
IMO you're pushing the pursuit of fairness so far that it actually hinders progress and handicaps the stronger engines. I guess this is one of those "We agree to disagree" things.
Ilari Pihlajisto wrote:Let's say we have engine A that loads the 4-men EGBBs to RAM (about 20MB), and engine B that doesn't use endgame tables. Then we set up a tournament where both engines get 32MB of memory. Engine A gets a 12MB hash table, and engine B gets a 32MB hash table. This is not good for engine A, the hash size is too small, and A would probably be better off without using the EGBBs at all. You could call these conditions fair, but they would still put a handicap on the engine that can use endgame tables.
H.G.Muller wrote:Ilari Pihlajisto wrote:Let's say we have engine A that loads the 4-men EGBBs to RAM (about 20MB), and engine B that doesn't use endgame tables. Then we set up a tournament where both engines get 32MB of memory. Engine A gets a 12MB hash table, and engine B gets a 32MB hash table. This is not good for engine A, the hash size is too small, and A would probably be better off without using the EGBBs at all. You could call these conditions fair, but they would still put a handicap on the engine that can use endgame tables.
We had this discussion before the memory command was introduced. My conclusion was that it would make no sense to try keeping non-competative techniques alive by making them competative artificially, by awarding extra resources to those engines that use them. If A would be better off not using EGBB, it should not use them. There are zillions of search or evaluation techniques that do not work, in the sense that they reduce engine strength. They all could be made competative by arbitrary declaring that engines that do use them get extra resources. "A recpture extension costs you 10Elo? Too bad no one uses it. Let us award 10% extra CPU time to engines that do use it! Of cuorse their opponents get 10% less time, to make up for that, we don't want longr games."
You are directly contradicting yourself. If you want the best possible Chess, you should be happy that engines do not waste memory on EGBB anymore. If you wnted best possible Chess, you would not set 32MB memory limit to leave the rest of your memory unused. You would do it because you only had 128MB on that machine (64MB being used by the OS). Or perhaps you had a quad with 256MB, and are playing 4 games simultaneously. So the 64MB for A and B together is non-negociable. Apparently you want to divide it s 22MB hash each, and 20MB EGBB for A. This might be good for A, (although not as good as iving it 42MB hash and no EGBB), but it is bad for B. The quality of the Chess produced by A already suffers, and that of the average quality of the game suffers even more.
But it is worse: you cannot expect B to let this happen. If those are the rules by which tourneys are conducted, B would of course be quickly altered to claim that he was using EGBB as well, even if it were not true. Because that would ensure they now both get 20MB of "EGBB memory", an 12MB of hash. (If you were playing an automated tourney with more than a single EGBB-using participant, where you wanted each game to use the same settings, you would even have to use 12MB hash size for both when B had not be claiming anything, to allow for two EGBB users playing against each other.) So now both programs incur the maximum performance hit, and the quality of the Chess you produce would suffer in the worst possible way!
(Fortunately, if B was my engine, it woud of course cheat, and use the memory it said was EGBB for hash anyway. Who is to know...)
Ilari Pihlajisto wrote:Miguel A. Ballicora wrote:That't not punishment!
You are rewarding an engine that created a necessity for more resources. Why is that fair?
Why if I want more memory because I have a special table for move generation that nobody has?
Fairness come from giving equal resources.
It's fair because the engine can actually put the extra resources to good use. Is it unfair that SMP engines get to use more CPU time than single CPU engines? To me, it's the same thing.
I do not understand how a command that informs the engine the amount of resources allocated to it hinders programs and handicaps stronger engines. If an engine cannot figure out how to use their resources, it is not very smart in my opinion.
Let's say we have engine A that loads the 4-men EGBBs to RAM (about 20MB), and engine B that doesn't use endgame tables. Then we set up a tournament where both engines get 32MB of memory. Engine A gets a 12MB hash table, and engine B gets a 32MB hash table. This is not good for engine A, the hash size is too small, and A would probably be better off without using the EGBBs at all. You could call these conditions fair, but they would still put a handicap on the engine that can use endgame tables.
Miguel A. Ballicora wrote:
SNIP
It is not about to chop memory for the engine that supports EGBB, it is about to give the same amount of extra memory to the opponent, who will be using it for whatever it pleases. You are not handicapping any engine. You are informing what is available.
Miguel
Roger Brown wrote:Miguel A. Ballicora wrote:
SNIP
It is not about to chop memory for the engine that supports EGBB, it is about to give the same amount of extra memory to the opponent, who will be using it for whatever it pleases. You are not handicapping any engine. You are informing what is available.
Miguel
Hello Miguel Ballicora,
I had an interesting exchange with H.G. on some of these points so permit me to obtain clarification on something.
(1) There are some engines which do not (cannot) adapt hash to exact integers (or even fractions of integers as I think Yace could do). Examples abound - Crafty and the Baron come to mind. So if I set the memory per engine at - say 90 mb - Crafty will use the next lower setting which is 48 mb. The other engine is using 96 mb. Are you saying that the memory command is simply a menu and that the engines are responsible for allocating it as they see fit?
So in that example it would simply be Crafty's tough luck, correct? So how would a TD ensure that engines are playing level in terms of available resources?
(2) There are engines with different hashes (main, pawn, bitbases etc.). So if I assign a fixed number to each process (engine) how does the engine allocate this to stay under the limit? Personally I believe that it is wrong to assign the memory set all to main hash and then grab some more for pawn hash and others.
Your thoughts?
Later.
Return to WinBoard development and bugfixing
Users browsing this forum: No registered users and 18 guests