2016-02-02 15 views
60

Podczas szkolenia tensorflow seq2seq modelu widzę następujące komunikaty:Jak interpretować komunikaty Poolallocator w tensorflow?

 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 27282 get requests, put_count=9311 evicted_count=1000 eviction_rate=0.1074 and unsatisfied allocation rate=0.699032 
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:239] Raising pool_size_limit_ from 100 to 110 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 13715 get requests, put_count=14458 evicted_count=10000 eviction_rate=0.691659 and unsatisfied allocation rate=0.675684 
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:239] Raising pool_size_limit_ from 110 to 121 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 6965 get requests, put_count=6813 evicted_count=5000 eviction_rate=0.733891 and unsatisfied allocation rate=0.741421 
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:239] Raising pool_size_limit_ from 133 to 146 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 44 get requests, put_count=9058 evicted_count=9000 eviction_rate=0.993597 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 46 get requests, put_count=9062 evicted_count=9000 eviction_rate=0.993158 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 4 get requests, put_count=1029 evicted_count=1000 eviction_rate=0.971817 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 2 get requests, put_count=1030 evicted_count=1000 eviction_rate=0.970874 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 44 get requests, put_count=6074 evicted_count=6000 eviction_rate=0.987817 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 12 get requests, put_count=6045 evicted_count=6000 eviction_rate=0.992556 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 2 get requests, put_count=1042 evicted_count=1000 eviction_rate=0.959693 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 44 get requests, put_count=6093 evicted_count=6000 eviction_rate=0.984737 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 4 get requests, put_count=1069 evicted_count=1000 eviction_rate=0.935454 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 17722 get requests, put_count=9036 evicted_count=1000 eviction_rate=0.110668 and unsatisfied allocation rate=0.550615 
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:239] Raising pool_size_limit_ from 792 to 871 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 6 get requests, put_count=1093 evicted_count=1000 eviction_rate=0.914913 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 6 get requests, put_count=1101 evicted_count=1000 eviction_rate=0.908265 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 3224 get requests, put_count=4684 evicted_count=2000 eviction_rate=0.426985 and unsatisfied allocation rate=0.200062 
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:239] Raising pool_size_limit_ from 1158 to 1273 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 17794 get requests, put_count=17842 evicted_count=9000 eviction_rate=0.504428 and unsatisfied allocation rate=0.510228 
I tensorflow/core/common_runtime/gpu/pool_allocator.cc:239] Raising pool_size_limit_ from 1400 to 1540 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 31 get requests, put_count=1185 evicted_count=1000 eviction_rate=0.843882 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 40 get requests, put_count=8209 evicted_count=8000 eviction_rate=0.97454 and unsatisfied allocation rate=0 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 0 get requests, put_count=2272 evicted_count=2000 eviction_rate=0.880282 and unsatisfied allocation rate=-nan 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 0 get requests, put_count=2362 evicted_count=2000 eviction_rate=0.84674 and unsatisfied allocation rate=-nan 
W tensorflow/core/common_runtime/gpu/pool_allocator.cc:227] PoolAllocator: After 38 get requests, put_count=5436 evicted_count=5000 eviction_rate=0.919794 and unsatisfied allocation rate=0 

Co to znaczy, to znaczy mam pewne problemy alokacji zasobów? Działa na Titan X 3500+ CUDA, 12 GB GPU

Odpowiedz

75

TensorFlow ma wiele podzielników pamięci dla pamięci, która będzie używana na różne sposoby. Ich zachowanie ma pewne aspekty adaptacyjne.

W twoim przypadku, ponieważ używasz GPU, istnieje moduł PoolAllocator dla pamięci procesora, który jest wstępnie zarejestrowany z GPU dla szybkiego DMA. Tensor, który ma zostać przeniesiony z procesora na GPU, np. Zostanie przydzielony z tej puli.

The PoolAllocators próbują zamortyzować koszt wywołania droższego instrumentu bazowego, przechowując pulę przydzielonych, a następnie zwolnionych części, które kwalifikują się do natychmiastowego ponownego użycia. Ich domyślnym zachowaniem jest powolny wzrost, dopóki wskaźnik eksmisji nie spadnie poniżej pewnej stałej. (Współczynnik eksmisji to odsetek bezpłatnych połączeń, w których zwracamy niewykorzystany fragment z puli do puli podstawowej, aby nie przekroczyć limitu rozmiaru.) W powyższych komunikatach dziennika widzisz linie "Podnoszenie pool_size_limit_", które pokazują pulę rozmiar rośnie. Zakładając, że twój program faktycznie zachowuje się w stanie ustalonym z maksymalnym zbiorem potrzebnych fragmentów, pula będzie rosła, aby się do niej dostosować, a następnie nie będzie już rosnąć. Zachowuje się w ten sposób, a nie po prostu zachowuje wszystkie przydzielone porcje, tak aby rozmiary potrzebne tylko rzadko lub tylko podczas uruchamiania programu, były mniej prawdopodobne, aby pozostały w puli.

Te wiadomości powinny być powodem do niepokoju, jeśli zabraknie Ci pamięci. W takim przypadku komunikaty dziennika mogą pomóc w zdiagnozowaniu problemu. Zauważ także, że szczytową prędkość wykonania można osiągnąć tylko wtedy, gdy pule pamięci urosną do odpowiedniego rozmiaru.

+8

Uspokajająca odpowiedź, jednak nie tak łatwa do zrozumienia dla osób bez doświadczenia w architekturze GPU. Mimo to dziękuję! – stpk

+0

tak na tej podstawie możesz odpowiedzieć na to pytanie: http://stackoverflow.com/questions/35171405/how-to-determine-maximum-batch-size-for-a-seq2seq-tensorflow-rnn-training-model – stackit

+0

Jako dodatek, myślę, że [kod tutaj] (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/common_runtime/gpu/pool_allocator.cc#L213) będzie przydatny do zrozumienia. Wygląda na to, że TF będzie rutynowo sprawdzać wskaźnik eksmisji, a jeśli stopa eksmisji i niezadowolona stawka przekroczą pewną liczbę (0,003), zwiększy to limit. –

Powiązane problemy