コード例 #1
0
def pltPwrcapTimeIF(arch, app, dataPath, pltPath, thresh):
    tot_time = []
    mean_pwr = []
    r2r_time = []
    r2r_mean_pwr = []
    fID = ""
    pls = []
    for p in np.arange(125, 255, 5):
        pls.append(p)
        pl = str(p)

        if arch == "P100":
            fID = app + '-fp64-run-' + pl + '-P100-1328-'
        elif arch == "V100":
            fID = app + '-fp64-run-' + pl + '-V100-1380-'

        r2r_mean_pwr.clear()
        r2r_time.clear()

        for r in range(3):
            d = pc.readMetrics(dataPath + fID + str(r))
            df, s, e = pc.getComputationStartEnd(d, thresh)
            # striping non-computing power consumption
            data = pc.getStablePwr(df, s, e)

            r2r_mean_pwr.append(data['pwr'].mean())
            seconds = max(data['time']) - min(data['time'])
            r2r_time.append(seconds)

        mean_pwr.append(mean(r2r_mean_pwr))
        tot_time.append(mean(r2r_time))

    #print ('\nTime: ',tot_time,'\n')
    #print ('\nPower: ',mean_pwr,'\n')
    return tot_time, mean_pwr, arch, app, pltPath, 'PWRCAP', pls
コード例 #2
0
def getPwrPerfCounters(output, fileID, size, pwrThresh=100):
    #os.chdir('../')
    #baseDir = os.getcwd()
    #file = baseDir+'/test/output/'+app+'-'+prec+'-'+mode+'-'+size
    file = output + fileID + size
    # striping non-computing power consumption

    data = pc.readMetrics(file)

    gdata, cpStartTime, cpEndTime = pc.getComputationStartEnd(data, pwrThresh)
    df = pc.getStablePwr(gdata, cpStartTime, cpEndTime)

    #gpu0Pwr['time'] =  (df['time'] - (df['time'].iloc[0]))

    tot_seconds = max(df['time']) - min(df['time'])
    #timedelta = tot_time - datetime(1900, 1, 1)

    #tot_seconds = timedelta.total_seconds()
    print('\nTotal Seconds', tot_seconds)
    s = 0.0
    if size == '16' or size == '32' or size == '48' or size == '64' or size == '72':
        s = float(size) * 320
    else:
        s = float(size)

    gflop = 2 * s * s * s / 1e9
    print('\nGFlops:', gflop)
    if tot_seconds != 0:
        gflops = gflop / tot_seconds
    else:
        gflops = gflop

    return (df['pwr'].mean()), gflops
コード例 #3
0
def getPyMMPwr(output,fileID,numRuns,pwrThresh = 100):
        pyMMPwrs = []
        for r in numRuns:
                file = output+fileID+r
                data = pc.readMetrics(file)
                data,s,e = pc.getComputationStartEnd (data,pwrThresh)
                # striping non-computing power consumption
                df = pc.getStablePwr(data,s,e)
                pyMMPwrs.append(df['pwr'].mean())
        return pyMMPwrs
コード例 #4
0
def getPyMMPwr(output, fileID, numRuns, pwrThresh=100):
    pyMMPwrs = []
    for r in numRuns:
        '''
                if fileID+r == 'dgemm-fp64-run-250-V100-135-8' or fileID+r == 'dgemm-fp64-run-250-V100-135-9':
                        print ("\n ***SKIPPING*** \n")
                        print (fileID+r)
                        print ("\n ***SKIPPING*** \n")
                        continue
                '''

        file = output + fileID + r
        data = pc.readMetrics(file)
        data, s, e = pc.getComputationStartEnd(data, pwrThresh)
        # striping non-computing power consumption
        df = pc.getStablePwr(data, s, e)
        pyMMPwrs.append(df['pwr'].mean())
    return pyMMPwrs
コード例 #5
0
def pltVarations(output, fileID, r, pwrThresh=100):
    file = output + fileID + r
    gpu0Pwr = pc.readMetrics(file)
    # striping non-computing power consumption
    data, start, end = pc.getComputationStartEnd(gpu0Pwr, pwrThresh)
    rampUp, stable, rampDown = getVariationSlices(data, start, end)
    '''
        print ('\ntotal length:', len(gpu0Pwr))
        print('\nrampUp:',rampUp)
        print ('\nrampUp length:',len(rampUp))
 
        print('\nStable:',stable)
        print ('\nStable length:',len(stable))
        
        print('\nrampDown:',rampDown)
        print ('\nrampDown length:',len(rampDown))
        '''

    pltRampUp(rampUp, output, fileID)
    pltStable(stable, output, fileID)
    pltRampDown(rampDown, output, fileID)
コード例 #6
0
def pltDVFSTimeIF(arch, app, dataPath, pltPath, thresh):

    tot_time = []
    mean_pwr = []
    r2r_time = []
    r2r_mean_pwr = []

    freqs = []

    if arch == 'V100':
        alt = 0
        f = 135
        while f <= upper_freq:
            fID = app + '-fp64-run-250-V100-' + str(f) + '-'
            freqs.append(f)
            r2r_mean_pwr.clear()
            r2r_time.clear()
            if f == 1005:
                thresh = 85
            for r in range(3):
                d = pc.readMetrics(dataPath + fID + str(r))
                df, s, e = pc.getComputationStartEnd(d, thresh)
                # striping non-computing power consumption
                data = pc.getStablePwr(df, s, e)

                r2r_mean_pwr.append(data['pwr'].mean())
                seconds = max(data['time']) - min(data['time'])
                r2r_time.append(seconds)

            mean_pwr.append(mean(r2r_mean_pwr))
            tot_time.append(mean(r2r_time))

            if alt == 0:
                f += 7
                alt = 1
            else:
                f += 8
                alt = 0
        #print ('\nTime: ',tot_time,'\n')
        print('\nPower: ', mean_pwr, '\n')

        return tot_time, mean_pwr, arch, app, pltPath, 'DVFS', freqs

    elif arch == 'P100':
        f = 544
        while f <= 1329:  # 1328
            fID = app + '-fp64-run-250-P100-' + str(f) + '-'

            freqs.append(f)

            r2r_mean_pwr.clear()
            r2r_time.clear()
            if f > 1005:
                thresh = 85
            for r in range(3):
                d = pc.readMetrics(dataPath + fID + str(r))
                df, s, e = pc.getComputationStartEnd(d, thresh)
                # striping non-computing power consumption
                data = pc.getStablePwr(df, s, e)

                r2r_mean_pwr.append(data['pwr'].mean())
                seconds = max(data['time']) - min(data['time'])
                r2r_time.append(seconds)

            mean_pwr.append(mean(r2r_mean_pwr))
            tot_time.append(mean(r2r_time))

            if f == 1328:
                break

            if (path.exists(dataPath + app + '-fp64-run-250-P100-' +
                            str(f + 12) + '-0')):
                f += 12
            elif (path.exists(dataPath + 'dgemm-fp64-run-250-P100-' +
                              str(f + 13) + '-0')):
                f += 13

        return tot_time, mean_pwr, arch, app, pltPath, 'DVFS', freqs