mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-06 21:34:05 -05:00
This backend abstract communication with Hpu Fpga hardware.
It define it's proper entities to prevent circular dependencies with
tfhe-rs.
Object lifetime is handle through Arc<Mutex<T>> wrapper, and enforce
that all objects currently alive in Hpu Hw are also kept valid on the
host side.
It contains the second version of HPU instruction set (HIS_V2.0):
* DOp have following properties:
+ Template as first class citizen
+ Support of Immediate template
+ Direct parser and conversion between Asm/Hex
+ Replace deku (and it's associated endianess limitation) by
+ bitfield_struct and manual parsing
* IOp have following properties:
+ Support various number of Destination
+ Support various number of Sources
+ Support various number of Immediat values
+ Support of multiple bitwidth (Not implemented yet in the Fpga
firmware)
Details could be view in `backends/tfhe-hpu-backend/Readme.md`
99 lines
2.7 KiB
TOML
99 lines
2.7 KiB
TOML
|
|
[fpga]
|
|
regmap=["${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/hpu_regif_core.toml"]
|
|
polling_us=10
|
|
[fpga.ffi.Xrt]
|
|
id= 0
|
|
kernel= "hpu_msplit_3parts_1in3"
|
|
xclbin="${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/hpu_msplit_3parts.xclbin"
|
|
|
|
[rtl]
|
|
bpip_use = true
|
|
bpip_use_opportunism = true
|
|
bpip_timeout = 100_000
|
|
|
|
[board]
|
|
ct_mem = 4096
|
|
ct_pc = [
|
|
{Hbm= {pc=10}},
|
|
{Hbm= {pc=11}},
|
|
]
|
|
heap_size = 3584
|
|
|
|
lut_mem = 256
|
|
lut_pc = {Hbm={pc=12}}
|
|
|
|
fw_size= 65536
|
|
fw_pc = {Hbm={pc=1}}
|
|
|
|
bsk_pc = [
|
|
{Hbm={pc=2}},
|
|
{Hbm={pc=3}},
|
|
{Hbm={pc=4}},
|
|
{Hbm={pc=5}},
|
|
{Hbm={pc=6}},
|
|
{Hbm={pc=7}},
|
|
{Hbm={pc=8}},
|
|
{Hbm={pc=9}}
|
|
]
|
|
|
|
ksk_pc = [
|
|
{Hbm={pc=24}},
|
|
{Hbm={pc=25}},
|
|
{Hbm={pc=26}},
|
|
{Hbm={pc=27}},
|
|
{Hbm={pc=28}},
|
|
{Hbm={pc=29}},
|
|
{Hbm={pc=30}},
|
|
{Hbm={pc=31}}
|
|
]
|
|
|
|
trace_pc = {Hbm={pc=0}}
|
|
trace_depth = 4 # In MB
|
|
|
|
[firmware]
|
|
implementation = "Llt"
|
|
integer_w=[4,6,8,10,12,14,16,32,64,128]
|
|
min_batch_size = 6
|
|
kogge_cfg = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/kogge_cfg.toml"
|
|
custom_iop.'IOP[0]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_0.asm"
|
|
custom_iop.'IOP[1]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_1.asm"
|
|
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[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[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"
|
|
custom_iop.'IOP[19]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_19.asm"
|
|
custom_iop.'IOP[20]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_20.asm"
|
|
custom_iop.'IOP[21]' = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/custom_iop/cust_21.asm"
|
|
|
|
[firmware.op_cfg.default]
|
|
fill_batch_fifo = true
|
|
min_batch_size = false
|
|
use_tiers = false
|
|
flush_behaviour = "Patient"
|
|
flush = true
|
|
|
|
[firmware.op_cfg.by_op.MUL]
|
|
fill_batch_fifo = false
|
|
min_batch_size = false
|
|
use_tiers = false
|
|
flush_behaviour = "Patient"
|
|
flush = true
|
|
|
|
[firmware.op_cfg.by_op.MULS]
|
|
fill_batch_fifo = false
|
|
min_batch_size = false
|
|
use_tiers = false
|
|
flush_behaviour = "Patient"
|
|
flush = true
|
|
|
|
[firmware.op_cfg.by_op.ERC_20]
|
|
fill_batch_fifo = false
|
|
min_batch_size = true
|
|
use_tiers = true
|
|
flush_behaviour = "Patient"
|
|
flush = true
|