Skip to content

Instantly share code, notes, and snippets.

@connorgoggins
Last active February 20, 2020 01:38
Show Gist options
  • Save connorgoggins/09ebe15c3f3aefb34b2a854847d22030 to your computer and use it in GitHub Desktop.
Save connorgoggins/09ebe15c3f3aefb34b2a854847d22030 to your computer and use it in GitHub Desktop.

Script:

from mxnet import nd
from benchmark.opperf.utils.benchmark_utils import run_performance_test

print(run_performance_test(nd.SoftmaxActivation, run_backward=True, inputs=[{'data': (2**29,2,2,2), 'out': nd.random_normal(shape=(2**29,2,2,2))}], warmup=1, runs=1))

Output:

INFO:root:Begin Benchmark - SoftmaxActivation
INFO:root:Complete Benchmark - SoftmaxActivation
[{'SoftmaxActivation': [{'inputs': {'data': (536870912, 2, 2, 2), 'out': '<NDArray 536870912x2x2x2 @cpu(0)>'}, 'max_storage_mem_alloc_cpu/0': 24696062.0, 'avg_time_forward_SoftmaxActivation': 7426.1191, 'avg_time_backward_SoftmaxActivation': 16664.0254}]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment