Python caffe2.python.workspace.GetCuDNNVersion() Examples

The following are 7 code examples of caffe2.python.workspace.GetCuDNNVersion(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module caffe2.python.workspace , or try the search function .
Example #1
Source File: c2.py    From KL-Loss with Apache License 2.0 5 votes vote down vote up
def get_nvidia_info():
    return (
        get_nvidia_smi_output(),
        workspace.GetCUDAVersion(),
        workspace.GetCuDNNVersion(),
    ) 
Example #2
Source File: c2.py    From Clustered-Object-Detection-in-Aerial-Image with Apache License 2.0 5 votes vote down vote up
def get_nvidia_info():
    return (
        get_nvidia_smi_output(),
        workspace.GetCUDAVersion(),
        workspace.GetCuDNNVersion(),
    ) 
Example #3
Source File: c2.py    From Detectron-Cascade-RCNN with Apache License 2.0 5 votes vote down vote up
def get_nvidia_info():
    return (
        get_nvidia_smi_output(),
        workspace.GetCUDAVersion(),
        workspace.GetCuDNNVersion(),
    ) 
Example #4
Source File: c2.py    From Detectron with Apache License 2.0 5 votes vote down vote up
def get_nvidia_info():
    return (
        get_nvidia_smi_output(),
        workspace.GetCUDAVersion(),
        workspace.GetCuDNNVersion(),
    ) 
Example #5
Source File: c2.py    From Detectron-DA-Faster-RCNN with Apache License 2.0 5 votes vote down vote up
def get_nvidia_info():
    return (
        get_nvidia_smi_output(),
        workspace.GetCUDAVersion(),
        workspace.GetCuDNNVersion(),
    ) 
Example #6
Source File: c2.py    From CBNet with Apache License 2.0 5 votes vote down vote up
def get_nvidia_info():
    return (
        get_nvidia_smi_output(),
        workspace.GetCUDAVersion(),
        workspace.GetCuDNNVersion(),
    ) 
Example #7
Source File: benchmarks.py    From dlcookbook-dlbs with Apache License 2.0 5 votes vote down vote up
def main():
    args = parse_args()

    if args.dtype == 'float32':
        args.dtype = 'float'

    # report some available info
    if args.device == 'gpu':
        assert args.num_gpus > 0, "Number of GPUs must be specified in GPU mode"
        print("__caffe2.cuda_version__=%s" % (json.dumps(workspace.GetCUDAVersion())))
        print("__caffe2.cudnn_version__=%s" % (json.dumps(workspace.GetCuDNNVersion())))

    try:
        opts = vars(args)
        opts['phase'] = 'inference' if args.forward_only else 'training'
        model_title, times = benchmark(opts)
    except Exception as err:
        #TODO: this is not happenning, program terminates earlier.
        # For now, do not rely on __results.status__=...
        times = np.zeros(0)
        model_title = 'Unk'
        print ("Critical error while running benchmarks (%s). See stacktrace below." % (str(err)))
        traceback.print_exc(file=sys.stdout)

    if len(times) > 0:
        mean_time = np.mean(times) # seconds
        # Compute mean throughput
        num_local_devices = 1 if args.device == 'cpu' else args.num_gpus  #Number of compute devices per node
        num_devices = num_local_devices * args.num_workers                #Global number of devices
        replica_batch = args.batch_size                                   #Input is a replica batch
        mean_throughput = num_devices * replica_batch / mean_time         #images / sec
        #
        print("__results.time__=%s" % (json.dumps(1000.0 * mean_time)))
        print("__results.throughput__=%s" % (json.dumps(int(mean_throughput))))
        print("__exp.model_title__=%s" % (json.dumps(model_title)))
        print("__results.time_data__=%s" % (json.dumps((1000.0*times).tolist())))
    else:
        print("__results.status__=%s" % (json.dumps("failure")))