Exemplo n.º 1
0
def run_mx_binary_element_wise_operators_benchmarks(ctx=mx.cpu(),
                                                    dtype='float32',
                                                    warmup=25,
                                                    runs=100):
    """Runs benchmarks with the given context and precision (dtype)for all the binary
    element_wise operators in MXNet.

    Parameters
    ----------
    ctx: mx.ctx
        Context to run benchmarks
    dtype: str, default 'float32'
        Precision to use for benchmarks
    warmup: int, default 10
        Number of times to run for warmup
    runs: int, default 50
        Number of runs to capture benchmark results

    Returns
    -------
    Dictionary of results. Key -> Name of the operator, Value -> Benchmark results.

    """
    # Fetch all Binary Element_wise Operators
    mx_binary_element_wise_ops = get_all_elemen_wise_binary_operators()
    # Run benchmarks
    mx_binary_op_results = run_op_benchmarks(mx_binary_element_wise_ops, dtype,
                                             ctx, warmup, runs)
    return mx_binary_op_results
def run_mx_binary_element_wise_operators_benchmarks(ctx=mx.cpu(), dtype='float32', profiler='native', int64_tensor='off', warmup=25, runs=100):
    """Runs benchmarks with the given context, precision (dtype), and input data size (int64_tensor) for all the binary
    element_wise operators in MXNet.

    Parameters
    ----------
    ctx: mx.ctx
        Context to run benchmarks
    dtype: str, default 'float32'
        Precision to use for benchmarks
    profiler: str, default 'native'
        Type of Profiler to use (native/python)
    int64_tensor: str, default 'off'
        Input tensor size to use for tests (if on, dimensions >= 2**32)
    warmup: int, default 10
        Number of times to run for warmup
    runs: int, default 50
        Number of runs to capture benchmark results

    Returns
    -------
    Dictionary of results. Key -> Name of the operator, Value -> Benchmark results.

    """
    # Fetch all Binary Element_wise Operators
    mx_binary_element_wise_ops = get_all_elemen_wise_binary_operators()
    # Run benchmarks
    mx_binary_op_results = run_op_benchmarks(mx_binary_element_wise_ops, dtype, ctx, profiler, int64_tensor, warmup, runs)
    return mx_binary_op_results