QXGBoost: Quantized XGBoost for FPGA deployment
Project description
qxgb
QXGBoost: quantized XGBoost Classifier for FPGA Deployment.
qxgb provides QXGBClassifier inheriting from xgboost.XGBClassifier with quantization aware training and registers the Alkaid tracer plugin for converting trained (Q)XGBoost boosters into RTL designs with Alkaid.
Installation
pip install qxgb
Quick Start
from qxgb import QXGBClassifier
model = QXGBClassifier(
scale=4,
bias=2,
n_estimators=32,
max_depth=3,
)
model.fit(X_train, y_train)
y_pred = model.predict(X_test)
hw_bst = model.ibooster() # Integer booster
from alkaid.converter import trace_model
from alkaid.trace import FVArray, trace
inp = FVArray.new(16).quantize(0, 8, 0).as_new()
_, out = trace_model(hw_bst, inputs=inp, mode='mux')
comb = trace(inp, out)
hw_pred = comb.predict(X_test) # == y_pred
Examples
Notebook examples are in examples/:
jsc.ipynbmnist.ipynbnid.ipynb
License
LGPLv3. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qxgb-0.1.0.tar.gz.
File metadata
- Download URL: qxgb-0.1.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b5e0a4702d3b9e6e0322f2bde56012bc2a9f5686e4be7d53d00fc28d19d2826
|
|
| MD5 |
e6a9776afc54ce448319ee1297e53f82
|
|
| BLAKE2b-256 |
ea760b9ad17df97f558568017cdef7f39c396b22bbab3a05f4f4f52b316cfc53
|
Provenance
The following attestation bundles were made for qxgb-0.1.0.tar.gz:
Publisher:
python-publish.yml on calad0i/qxgb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qxgb-0.1.0.tar.gz -
Subject digest:
9b5e0a4702d3b9e6e0322f2bde56012bc2a9f5686e4be7d53d00fc28d19d2826 - Sigstore transparency entry: 1588043845
- Sigstore integration time:
-
Permalink:
calad0i/qxgb@55580a96b7f70c8b33f950d236758eb327da972a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/calad0i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@55580a96b7f70c8b33f950d236758eb327da972a -
Trigger Event:
release
-
Statement type:
File details
Details for the file qxgb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: qxgb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d3752ada9cee3c02a3564a644520b8892ee31e4f32f4de00cfac240a0fc2463
|
|
| MD5 |
bc2f58a6a1769022d67e9702a261c998
|
|
| BLAKE2b-256 |
249c0b6c121db898afb5684cf924f976c33db475d01741cebb5d2891b1894a8e
|
Provenance
The following attestation bundles were made for qxgb-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on calad0i/qxgb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qxgb-0.1.0-py3-none-any.whl -
Subject digest:
6d3752ada9cee3c02a3564a644520b8892ee31e4f32f4de00cfac240a0fc2463 - Sigstore transparency entry: 1588043916
- Sigstore integration time:
-
Permalink:
calad0i/qxgb@55580a96b7f70c8b33f950d236758eb327da972a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/calad0i
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@55580a96b7f70c8b33f950d236758eb327da972a -
Trigger Event:
release
-
Statement type: