Yes, if you are doing analysis you need as much hash as you can get.
Therefore the question comes up again and again.
Crafty has no such 2GB limitation and the is no reason to have such a limitation in stockfish.
Woul'd you be so kind and change it?
kind regards
Bernhard
Stockfish Maximum Hash Size
Moderators: hgm, Rebel, chrisw
-
- Posts: 1833
- Joined: Thu Jun 22, 2006 12:07 am
Re: Stockfish Maximum Hash Size
I was going to ask someone about this, I can't get my Crafty to use more than 1024M hash.BBauer wrote: Crafty has no such 2GB limitation and the is no reason to have such a limitation in stockfish.
kind regards
Bernhard
This happens if I try something bigger:
Code: Select all
Crafty v23.1 JA <4 cpus>
White<1>: hash 2048m
AlignedRemalloc<> failed, not enough memory.
hash table memory = 0 bytes.
White<1>:
Any idea?
-
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: Stockfish Maximum Hash Size
Hi Martin,Martin T wrote: I was going to ask someone about this, I can't get my Crafty to use more than 1024M hash.
This happens if I try something bigger:
I have about 5 GB free RAM and I can set 2GB hash in Stockfish without problems (also verified in task manager). Running Win 7 64-bit.Code: Select all
Crafty v23.1 JA <4 cpus> White<1>: hash 2048m AlignedRemalloc<> failed, not enough memory. hash table memory = 0 bytes. White<1>:
Any idea?
Take a look here.
Louis
-
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: Stockfish Maximum Hash Size
I should have linked to this post by Bob Hyatt, which led to my question.
-
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: Stockfish Maximum Hash Size
Hi Louis,zullil wrote:I should have linked to this post by Bob Hyatt, which led to my question.
could you please try the following patch and tell me if it works ? Now you should set up to 8GB (8192).
Code: Select all
Date: Mon, 1 Feb 2010 12:12:41 +0100
Subject: [PATCH] Extend maximum hash size to 8 GB
---
src/tt.cpp | 4 ++--
src/tt.h | 2 +-
src/ucioption.cpp | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/tt.cpp b/src/tt.cpp
index 1b2ae72..1fa60b1 100644
--- a/src/tt.cpp
+++ b/src/tt.cpp
@@ -55,9 +55,9 @@ TranspositionTable::~TranspositionTable() {
void TranspositionTable::set_size(unsigned mbSize) {
- assert(mbSize >= 4 && mbSize <= 2048);
+ assert(mbSize >= 4 && mbSize <= 8192);
- unsigned newSize = 1024;
+ size_t newSize = 1024;
// We store a cluster of ClusterSize number of TTEntry for each position
// and newSize is the maximum number of storable positions.
diff --git a/src/tt.h b/src/tt.h
index 5d0df72..c3017c6 100644
--- a/src/tt.h
+++ b/src/tt.h
@@ -114,7 +114,7 @@ private:
unsigned writes; // heavy SMP read/write access here
unsigned char pad_after[64];
- unsigned size;
+ size_t size;
TTCluster* entries;
uint8_t generation;
};
diff --git a/src/ucioption.cpp b/src/ucioption.cpp
index 0f9c2f8..9fc1f41 100644
--- a/src/ucioption.cpp
+++ b/src/ucioption.cpp
@@ -123,7 +123,7 @@ namespace {
o["Minimum Split Depth"] = Option(4, 4, 7);
o["Maximum Number of Threads per Split Point"] = Option(5, 4, 8);
o["Threads"] = Option(1, 1, THREAD_MAX);
- o["Hash"] = Option(32, 4, 2048);
+ o["Hash"] = Option(32, 4, 8192);
o["Clear Hash"] = Option(false, BUTTON);
o["New Game"] = Option(false, BUTTON);
o["Ponder"] = Option(true);
--
1.6.5.1.1367.gcd48
-
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: Stockfish Maximum Hash Size
What about your compile problems under gcc ?BBauer wrote:Yes, if you are doing analysis you need as much hash as you can get.
Therefore the question comes up again and again.
Crafty has no such 2GB limitation and the is no reason to have such a limitation in stockfish.
Woul'd you be so kind and change it?
kind regards
Bernhard
-
- Posts: 658
- Joined: Wed Mar 08, 2006 8:58 pm
Re: Stockfish Maximum Hash Size
I have no compile problems under gcc.
-
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: Stockfish Maximum Hash Size
yes, sorry it was intel.BBauer wrote:I have no compile problems under gcc.
What about your compile problems with icc ?
-
- Posts: 6442
- Joined: Tue Jan 09, 2007 12:31 am
- Location: PA USA
- Full name: Louis Zulli
Re: Stockfish Maximum Hash Size
Hi Marco,mcostalba wrote:Hi Louis,zullil wrote:I should have linked to this post by Bob Hyatt, which led to my question.
could you please try the following patch and tell me if it works ? Now you should set up to 8GB (8192).
Code: Select all
Date: Mon, 1 Feb 2010 12:12:41 +0100 Subject: [PATCH] Extend maximum hash size to 8 GB --- src/tt.cpp | 4 ++-- src/tt.h | 2 +- src/ucioption.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tt.cpp b/src/tt.cpp index 1b2ae72..1fa60b1 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -55,9 +55,9 @@ TranspositionTable::~TranspositionTable() { void TranspositionTable::set_size(unsigned mbSize) { - assert(mbSize >= 4 && mbSize <= 2048); + assert(mbSize >= 4 && mbSize <= 8192); - unsigned newSize = 1024; + size_t newSize = 1024; // We store a cluster of ClusterSize number of TTEntry for each position // and newSize is the maximum number of storable positions. diff --git a/src/tt.h b/src/tt.h index 5d0df72..c3017c6 100644 --- a/src/tt.h +++ b/src/tt.h @@ -114,7 +114,7 @@ private: unsigned writes; // heavy SMP read/write access here unsigned char pad_after[64]; - unsigned size; + size_t size; TTCluster* entries; uint8_t generation; }; diff --git a/src/ucioption.cpp b/src/ucioption.cpp index 0f9c2f8..9fc1f41 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -123,7 +123,7 @@ namespace { o["Minimum Split Depth"] = Option(4, 4, 7); o["Maximum Number of Threads per Split Point"] = Option(5, 4, 8); o["Threads"] = Option(1, 1, THREAD_MAX); - o["Hash"] = Option(32, 4, 2048); + o["Hash"] = Option(32, 4, 8192); o["Clear Hash"] = Option(false, BUTTON); o["New Game"] = Option(false, BUTTON); o["Ponder"] = Option(true); -- 1.6.5.1.1367.gcd48
I applied the patch, but it does not work. Choosing a Hash value above 2048 reserves the same amount of memory for Stockfish that Hash=2048 does. Choosing Hash=4096 reserves just 16M.
I'm using top to monitor memory usage, and all seems to work right if Hash <= 2048.
I have 6GB ram, so I did not try Hash > 4096.
Louis
-
- Posts: 2684
- Joined: Sat Jun 14, 2008 9:17 pm
Re: Stockfish Maximum Hash Size
Sorry to bother you but I don't have 2GB nor 64 bit PC so I cannot properly test myself.zullil wrote: I applied the patch, but it does not work.
Please add the following of top of previous patch:
Code: Select all
--- a/src/tt.cpp
+++ b/src/tt.cpp
@@ -53,7 +53,7 @@ TranspositionTable::~TranspositionTable() {
/// TranspositionTable::set_size sets the size of the transposition table,
/// measured in megabytes.
-void TranspositionTable::set_size(unsigned mbSize) {
+void TranspositionTable::set_size(size_t mbSize) {
assert(mbSize >= 4 && mbSize <= 8192);
diff --git a/src/tt.h b/src/tt.h
index c3017c6..2b2ce60 100644
--- a/src/tt.h
+++ b/src/tt.h
@@ -95,7 +95,7 @@ class TranspositionTable {
public:
TranspositionTable();
~TranspositionTable();
- void set_size(unsigned mbSize);
+ void set_size(size_t mbSize);
void clear();
void store(const Key posKey, Value v, ValueType type, Depth d, Move m);
TTEntry* retrieve(const Key posKey) const;