mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-08 22:28:01 -05:00
feat(hpu): Add Hpu backend implementation
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`
This commit is contained in:
@@ -42,6 +42,14 @@ env_logger = "0.11"
|
||||
log = "0.4.19"
|
||||
hex = "0.4.3"
|
||||
# End regex-engine deps
|
||||
# Used in noise-measurements
|
||||
csv = "1.3.0"
|
||||
|
||||
# Begin hpu-demo deps
|
||||
# Enable to have hpu execution trace
|
||||
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
||||
clap-num = {version = "1.1.1"}
|
||||
# End hpu-demo deps
|
||||
|
||||
[build-dependencies]
|
||||
cbindgen = { version = "0.28", optional = true }
|
||||
@@ -83,6 +91,8 @@ serde-wasm-bindgen = { version = "0.6.0", optional = true }
|
||||
getrandom = { version = "0.2.8", optional = true }
|
||||
bytemuck = { workspace = true }
|
||||
|
||||
tfhe-hpu-backend = { version = "0.1", path = "../backends/tfhe-hpu-backend", optional = true }
|
||||
|
||||
[features]
|
||||
boolean = []
|
||||
shortint = ["dep:sha3"]
|
||||
@@ -96,6 +106,12 @@ gpu-experimental-multi-arch = [
|
||||
]
|
||||
gpu-profile = ["gpu", "tfhe-cuda-backend/profile"]
|
||||
zk-pok = ["dep:tfhe-zk-pok"]
|
||||
# Start Fpga Hpu features
|
||||
hpu = ["dep:tfhe-hpu-backend", "shortint", "integer"]
|
||||
hpu-xrt = ["hpu", "tfhe-hpu-backend/hw-xrt"]
|
||||
hpu-v80 = ["hpu", "tfhe-hpu-backend/hw-v80"]
|
||||
hpu-debug = ["hpu", "tfhe-hpu-backend/io-dump"]
|
||||
# End Fpga Hpu features
|
||||
|
||||
# Adds more FheUint/FheInt types to the HL
|
||||
extended-types = []
|
||||
@@ -149,6 +165,7 @@ features = [
|
||||
"zk-pok",
|
||||
"software-prng",
|
||||
"strings",
|
||||
"hpu",
|
||||
]
|
||||
rustdoc-args = ["--html-in-header", "katex-header.html"]
|
||||
|
||||
@@ -200,6 +217,23 @@ required-features = ["integer", "pbs-stats"]
|
||||
name = "dist_tuniform"
|
||||
required-features = ["integer", "internal-keycache"]
|
||||
|
||||
# Start of Hpu related section
|
||||
[[example]]
|
||||
name = "hpu_hlapi"
|
||||
path = "examples/hpu/hlapi.rs"
|
||||
required-features = ["hpu"]
|
||||
|
||||
[[example]]
|
||||
name = "hpu_matmul"
|
||||
path = "examples/hpu/matmul.rs"
|
||||
required-features = ["hpu"]
|
||||
|
||||
[[example]]
|
||||
name = "hpu_bench"
|
||||
path = "examples/hpu/bench.rs"
|
||||
required-features = ["hpu"]
|
||||
# End of Hpu related section
|
||||
|
||||
[lib]
|
||||
crate-type = ["lib", "staticlib", "cdylib"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user