Package: benchlog
Benchlog PackageBenchlog allows a user to record the runtime and resource allocation of their program overtime.ChangelogVersion 0.3FeaturesAdded logging of accuracyAdded unique filename generation (using date and time)[Documentation] Added a changelogAllow local saving and sending to server withsetHost(HOST, local)Added GPU logging of usage, memory, memory utilization, gpu UUID and name withenableGPU()Prevent users that do not have 'nvidia-smi' installed from enabling GPUBug FixesFixed bug where sendData would only save to telemetry.json on error instead of callingsaveDataPrevented user from callingend()without callingstart()Prevented user from callingend()twiceCall for variabledeviceIDdid not exist inenableGPU(), useself.gpuObjinsteadFixed bug where we calledsaveData()instead ofself.saveData()Installationpip install benchlogUseBenchlog ArgumentsArgumentTypeDescriptionprojectnamestringThe name of your projectiterationNumintegerNumber of iteration your code uses (Used to record progress)Opt: featureList[string]Record list of features used for projectOpt: quietintegerSet to 1 to disable logging, default: 0SetupImport BenchLogfrom benchlog import BenchLogDeclare new instance of BenchLog
E.g.logging = BenchLog('Test Project', 1024, ['tensorflow', 'featureB'], quiet1]Optional:Declare a host to send the telemetry data to. If no host is stored or data fails to send we will store the data in a file calledtelemetry.jsonin the directory of the project. If you would like to enable local and external logging, set the second argument to 1.
setHost(ipaddress, [OPTIONAL:1 to enable local logging, 0 default])
E.glogging.setHost('http://localhost:3000',1)Optional:GPU Logging - Enable GPU Logging by callinglogging.enableGPU()If you have more than one GPU refer to the enableGPU sectionStart logging by callinglogging.start()Calllogging.log(iterationNum)every once in awhile to log progress.End logging by callinglogging.end()Example Codefrom benchlog import BenchLog
logging = BenchLog('My Project', 10000, ['FeatureA','FeatureB'])
logging.setHost('http://localhost:3000')
array =
logging.enableGPU(0)
logging.start()
for i in range(1,10000):
    if(i % 1000 == 0):
        #Do Something here
        logging.log(i)
logging.end()enableGPU()logging.enableGPU()usesGPUtilin order to gather gpu information. This will only work with Nvidia GPUs.If you havemultiple GPUsyou can pass in the index of the GPU you want to use. You can find which GPU you want to log by calling nvidia-smi and returning the GPU you want to use. E.glogging.enableGPU(1)GPU logging records three things.GpuMemUsage- This is the amount of memory being used by the GPUGpuMemUtil- This is the memory activity (i/o) within GPU memoryGpuUsage- This is the standard gpu loadExample telemetry output{"cores":"4","runTime":"1.506113","size":"10000","features":["testa","testb"],"projectName":"test","infoRunTime":["0.177929","0.345282","0.511437","0.685919","0.850231","1.011178","1.182584","1.345929","1.505748","1.506086"],"infoCpuUsage":["13.2","32.4","30.3","35.7","30.8","28.1","36.2","26.2","28.1","0.0"],"infoMemoryUsage":["452567040","852570112","1252573184","1652576256","2052579328","2452582400","2852585472","3252588544","3652591616","3652591616"],"infoProgress":["0.1","0.2","0.3","0.4","0.5","0.6","0.7","0.8","0.9","1.0"]}Future To DoDo not overwrite old telemetry dataGPU UtilizationLocal VisualizationWeb UI to view resultsServerChange progress to 0-100