tree: f19d8c78d2f613728839c79da4f62baab5a935c8 [path history] [tgz]
  1. BUILD
  2. README.md
  3. rnn_ptb.py
  4. rnn_ptb_graph_test.py
  5. rnn_ptb_test.py
tensorflow/contrib/eager/python/examples/rnn_ptb/README.md

Recurrent Neural Network model.

Implements a language modeling network described in https://www.tensorflow.org/tutorials/recurrent that is compatible with (and idiomatic for) eager execution.

To run:

Benchmarks (using synthetic data):

# Using eager execution
python rnn_ptb_test.py --benchmarks=.

# Using graph execution
python rnn_ptb_graph_test.py --benchmarks=.

The above uses the model definition included with the TensorFlow pip package. To build (and run benchmarks) from source:

# Using eager execution
bazel run -c opt --config=cuda :rnn_ptb_test -- --benchmarks=.

# Using graph execution
bazel run -c opt --config=cuda :rnn_ptb_graph_test -- --benchmarks=.

(Or remove the --config=cuda flag for running on CPU instead of GPU).

On October 31, 2017, the benchmarks demonstrated slightly better performance (3-6%) for graph execution over eager execution for this particular model when using a single NVIDIA Titan X (Pascal) GPU on a host with an Intel Xeon E5-1650 CPU @ 3.50GHz and a batch size of 32.

Benchmark nameexamples/second
eager_cudnn_train_large_gpu_batch_20938
graph_cudnn_train_large_gpu_batch_20971
eager_cudnn_train_small_gpu_batch_202433
graph_cudnn_train_small_gpu_batch_202585