mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-08 22:28:01 -05:00
chore(hpu): adds 3 custom IOp to measure PBS performance on HPU and update trace parser to handle 32b timestamp wrap
This commit is contained in:
committed by
Pierre Gardrat
parent
2ca4a7fe1a
commit
afaf761cdd
120131
backends/tfhe-hpu-backend/config_store/v80/custom_iop/cust_15.asm
Normal file
120131
backends/tfhe-hpu-backend/config_store/v80/custom_iop/cust_15.asm
Normal file
File diff suppressed because it is too large
Load Diff
120131
backends/tfhe-hpu-backend/config_store/v80/custom_iop/cust_5.asm
Normal file
120131
backends/tfhe-hpu-backend/config_store/v80/custom_iop/cust_5.asm
Normal file
File diff suppressed because it is too large
Load Diff
90131
backends/tfhe-hpu-backend/config_store/v80/custom_iop/cust_6.asm
Normal file
90131
backends/tfhe-hpu-backend/config_store/v80/custom_iop/cust_6.asm
Normal file
File diff suppressed because it is too large
Load Diff
@@ -87,8 +87,11 @@
|
||||
custom_iop.'IOP[2]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_2.asm"
|
||||
custom_iop.'IOP[3]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_3.asm"
|
||||
custom_iop.'IOP[4]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_4.asm"
|
||||
custom_iop.'IOP[5]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_5.asm"
|
||||
custom_iop.'IOP[6]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_6.asm"
|
||||
custom_iop.'IOP[8]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_8.asm"
|
||||
custom_iop.'IOP[9]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_9.asm"
|
||||
custom_iop.'IOP[15]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_15.asm"
|
||||
custom_iop.'IOP[16]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_16.asm"
|
||||
custom_iop.'IOP[17]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_17.asm"
|
||||
custom_iop.'IOP[18]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_18.asm"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
from pandas import DataFrame
|
||||
from isctrace.analysis import Refilled, Retired, Trace
|
||||
|
||||
freq_mhz = 300
|
||||
freq_mhz = 400
|
||||
|
||||
iops = Trace.from_hw("data/trace.json")
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ def group_by_time(it, timef, threshold):
|
||||
batch = [next(it)]
|
||||
ptime = timef(batch[0])
|
||||
for obj, time in map(lambda i: (i, timef(i)), it):
|
||||
delta = time - ptime
|
||||
delta = (time - ptime)%2**32
|
||||
if (delta < threshold):
|
||||
batch.append(obj)
|
||||
else:
|
||||
@@ -210,12 +210,12 @@ class Retired:
|
||||
timestamp = event.timestamp
|
||||
if (event.data.__class__ == Retire):
|
||||
if insn in isn_map:
|
||||
latency = timestamp - isn_map[insn]
|
||||
latency = (timestamp - isn_map[insn])%2**32
|
||||
del isn_map[insn]
|
||||
else:
|
||||
latency = np.NAN
|
||||
delta = timestamp - prev_stamp
|
||||
reltime = timestamp - first_stamp
|
||||
delta = (timestamp - prev_stamp)%2**32
|
||||
reltime = (timestamp - first_stamp)%2**32
|
||||
yield InstructionStats(insn, latency, timestamp, delta, reltime)
|
||||
prev_stamp = timestamp
|
||||
elif (event.data.__class__ == Issue):
|
||||
@@ -229,7 +229,7 @@ class Retired:
|
||||
index='timestamp')
|
||||
|
||||
def runtime_us(self, freq_mhz) -> 'useconds':
|
||||
return (self._events[-1].timestamp - self._events[0].timestamp)/freq_mhz
|
||||
return ((self._events[-1].timestamp - self._events[0].timestamp)%2**32)/freq_mhz
|
||||
|
||||
def pbs_batches(self, threshold = BATCH_THRESHOLD):
|
||||
pbs = filter(lambda i: i.insn.opcode.startswith('PBS'), self)
|
||||
|
||||
Reference in New Issue
Block a user