2016-02-02 9 views
60

Mentre la formazione di un modello di seq2seq tensorflow compaiono i seguenti messaggi:Come interpretare i messaggi di Poolallocator in 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 

Che cosa vuol dire, vuol dire che sto avendo alcuni problemi di allocazione delle risorse? Sono in esecuzione su Titan X 3500+ CUDA, GPU da 12 GB

risposta

75

TensorFlow ha più allocatori di memoria, per la memoria che verrà utilizzata in modi diversi. Il loro comportamento ha alcuni aspetti adattivi.

Nel tuo caso particolare, dal momento che stai usando una GPU, c'è un PoolAllocator per la memoria della CPU che è pre-registrata con la GPU per DMA veloce. Un tensore che dovrebbe essere trasferito dalla CPU alla GPU, ad es., Sarà assegnato da questo pool.

Gli PoolAllocators tentano di ammortizzare il costo della chiamata a un allocatore sottostante più costoso mantenendo intorno un pool di blocchi allocati quindi liberati che sono idonei per il riutilizzo immediato. Il loro comportamento predefinito è di crescere lentamente fino a quando il tasso di sfratto scende al di sotto di qualche costante. (Il tasso di sfratto è la proporzione di chiamate gratuite in cui restituiamo un chunk inutilizzato dal pool al pool sottostante per non superare il limite di dimensioni.) Nei messaggi di log sopra, vedi "Raising pool_size_limit_" linee che mostrano il pool dimensione crescente. Supponendo che il tuo programma abbia effettivamente un comportamento a stato stazionario con una collezione di dimensioni massime di pezzi di cui ha bisogno, il pool crescerà per adattarlo e quindi non crescerà più. Si comporta in questo modo piuttosto che semplicemente mantenendo tutti i chunk mai allocati in modo che le dimensioni necessarie solo raramente, o solo durante l'avvio del programma, abbiano meno probabilità di essere conservate nel pool.

Questi messaggi dovrebbero essere motivo di preoccupazione solo se si esaurisce la memoria. In tal caso, i messaggi di log possono aiutare a diagnosticare il problema. Si noti inoltre che la velocità massima di esecuzione può essere raggiunta solo dopo che i pool di memoria hanno raggiunto le dimensioni appropriate.

+8

Risposta rassicurante, tuttavia non così facile da capire per le persone senza esperienza nelle architetture GPU. Grazie comunque! – stpk

+0

quindi, in base a questo, puoi rispondere a questa domanda: http://stackoverflow.com/questions/35171405/how-to-determine-maximum-batch-size-for-a-seq2seq-tensorflow-rnn-training-model – stackit

+0

As un'appendice, penso che il [codice qui] (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/common_runtime/gpu/pool_allocator.cc#L213) sarà utile per capire. Sembra che TF controllerà regolarmente il tasso di sfratto, e se il tasso di sfratto e il tasso insoddisfatto sono su un certo numero (0,003), aumenterà il limite. –

Problemi correlati