Introduction
SOFA: Swarm of Functions Analysis Authors: All the contributors of SOFA
Prerequisite
- Run
./tools/prerequisite.sh
to install all the necessary packages and python packages. - [OPTIONAL] Run
./tools/empower-tcpdump.sh $(whoami)
to make network related events tracable in SOFA. After running this step, it is required to re-login to APPLY THE CHANGES!!!
Verify Permissions
Run the following simple tests to verify the permission settings of executing tcpdump under your permission.
tcpdump -w sofa.pcap
tcpdump -r sofa.pcap
Installation
- Simply run
./install.sh </PATH/TO/INSTALL>
to install SOFA on your system. Note thatsofa
will be appended to the path if the last directory is not sofa. - Then, run
source </PATH/TO/INSTALL>/sofa/tools/activate.sh
to activate SOFA running environment. (Need to be executed on each new shell.) - [ALTERNATIVE] Add
source </PATH/TO/INSTALL>/sofa/tools/activate.sh
in your~/.bashrc
to make this environment available on every shell.
Uninstall
Run bash </PATH/TO/INSTALL>/sofa/tools/uninstall.sh
to safely remove/uninstall files of SOFA.
Usages
SOFA supports serveral different usages, like how one can use perf.
Basic Statistics
- Profile your program by sampling involved CPUs:
sofa stat "wget http://www.bbc.com/news"
- Profile your program by sampling all CPUs:
sofa stat "wget http://www.bbc.com/news" --profile_all_cpus
Performance Visualizations
sofa record "wget http://www.bbc.com/news"
sofa report
- Open browser with one of the following links for different visualizations
Run with different plugins
- Run
sofa record "wget http://www.bbc.com/news"
only once to record the events. - Run
sofa preprocess
only once to process the events. - Run
sofa analyze
with A plugin. - Run
sofa analyze
with B plugin. - Run
sofa analyze
with C plugin.
Configurations
SOFA provides options for configurations. Some examples are shown below. Please use sofa --help
to see more info.
sofa --cpu_filters="idle:black,tensorflow:orange" record "python tf_cnn_benchmarks.py"
sofa --gpu_filters="tensorflow:orange" --verbose=True record "python tf_cnn_benchmarks.py"
Examples of Visualization Results:
sofa record "~/cuda_samples/1_Utilities/bandwidthTest/bandwidthTest"
sofa record "python tf_cnn_benchmarks.py --num_gpus=8 --batch_size=64 --model=resnet50 --variable_update=parameter_server --num_warmup_batches=1 --num_batches=3"
sofa record "python tf_cnn_benchmarks.py --num_gpus=8 --batch_size=64 --model=resnet50 --variable_update=parameter_server --num_warmup_batches=1 --num_batches=3"
sofa record "python tf_cnn_benchmarks.py --num_gpus=8 --batch_size=64 --model=alexnet --variable_update=replicated --all_reduce_spec=xring --num_warmup_batches=1 --num_batches=3"
sofa record "mpirun -f hosts.txt -n 4 ./compute_pi"