This is a simple demonstration of XProf's capabilites, on an example training workload running on Cloud TPUs.
# Install the stable version of XProfpip install -U xprof
# Update protobuf version in the environmentpip install -U protobuf
# git clone the xprof repo so we have access to the demo data theregit clone http://github.com/openxla/xprof
Cloning into 'xprof'... warning: redirecting to https://github.com/openxla/xprof/ remote: Enumerating objects: 25588, done. remote: Counting objects: 100% (5234/5234), done. remote: Compressing objects: 100% (544/544), done. remote: Total 25588 (delta 4874), reused 4710 (delta 4690), pack-reused 20354 (from 1) Receiving objects: 100% (25588/25588), 118.17 MiB | 36.46 MiB/s, done. Resolving deltas: 100% (19969/19969), done.
# Load the TensorBoard notebook extension.
%load_ext tensorboard
# Launch TensorBoard and navigate to the Profile tab to view performance profile
%tensorboard --logdir=xprof/demo
Once tensorboard loads the profile data, use the Tools dropdown to select the tool you want to explore. Please see the tool-specific documentation pages for explanations of each tool's outputs.