You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/inference/conifer.md
+15-6Lines changed: 15 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,24 +14,33 @@
14
14
15
15
## Emulation in CMSSW
16
16
17
-
All L1T algorithms require bit-exact emulation for performance studies and validation of the hardware system. For conifer this is provided with a single header file at `L1Trigger/Phase2L1ParticleFlow/interface/conifer.h`. The user must also provide the BDT JSON file exported from the conifer Python tool for their model. JSON loading in CMSSW uses the `nlohmann/json` external.
17
+
All L1T algorithms require bit-exact emulation for performance studies and validation of the hardware system. For conifer this is provided with a [single header file](https://github.com/thesps/conifer/blob/master/conifer/backends/cpp/include/conifer.h) that is a CMSSW external `conifer.h`. The user must also provide the BDT JSON file exported from the conifer Python tool for their model. Usually the model JSON file should be saved at [`cms-data`](https://github.com/cms-data). JSON loading in CMSSW uses the `nlohmann/json` external.
18
18
19
19
Both the conifer FPGA firmware and C++ emulation use Xilinx's arbitrary precision types for fixed-point arithmetic (`hls` external of CMSSW). This is cheaper and faster in the FPGA fabric than floating-point types. An important part of the model preparation process is choosing the proper fixed-point data types to avoid loss of performance compared to the trained model. Input preprocessing, in particular scaling, can help constrain the input variables to a smaller numerical range, but may also have a hardware cost to implement. In C++ the arbitrary precision types are specified like: `ap_fixed<width, integer, rounding mode, saturation mode>`.
20
20
21
21
Minimal preparation from Python:
22
-
```
22
+
```python
23
23
import conifer
24
24
model = conifer. ...# convert or load a conifer model
25
25
# e.g. model = conifer.converters.convert_from_xgboost(xgboost_model)
26
26
model.save('my_bdt.json')
27
27
```
28
28
29
-
CMSSW C++ user code:
29
+
Include the conifer and HLS external in your package's `BuildFile.xml`:
0 commit comments