The stand-alone ultra-fast simulation option for LHCb
Project description
SQLamarr
The stand-alone ultra-fast simulation option for LHCb
The detailed simulation of the hadron collisions at the LHC, and of the interaction of the generated particles with the detector material dominates the cost for the computing infrastructure pledged to the LHCb Collaboration.
Among the various options explored towards a faster simulation, there is Lamarr, a framework defining a pipeline of parametrizations transforming generator-level quantities to reconstructed, analysis-level features. Most of the parametrizations are defined using machine-learning, and in particular Deep Neural Networks and Gradient Boosted Decision Trees, with a traing procedure defined in independent packages (e.g. landerlini/lb-trksim-train and mbarbetti/lb-pidsim-train).
To be integrated in the LHCb software stack, models must be queried from a C++ application, running in the Gaudi framework, which includes a dedicated multithreading scheduler which was found to conflict with the schedulers of TensorFlow and ONNX runtimes. In addition, since the models are relatively simple and fast to evaluate, the overhead of context switching from Gaudi to a dedicated runtime was observed to be unaccptably large. Hence, models are converted into compatible C code using the landerlini/scikinC package and distributed through the CernVM FileSystem releasing the LamarrData package.
While crucial to the applications within LHCb, the integration with
Gaudi and Gauss makes the adoption
of Lamarr unappealing for researchers outside of the LHCb community
approaching the LHCb simulation to evaluate
the experiment sensitivity to new physics phenomena or studying the
recently-released LHCb Open Data.
The landerlini/SQLamarr
package aims at decoupling Lamarr from Gaudi providing a stand-alone
application with minimal dependencies that can be easily set up and
run in any Linux machine.
The parametrizations are shared between the Gauss-embedded implementation
LbLamarr
and SQLamarr
.
In the future, the exact same package might be integrated within Gaudi
to reduce the maintainance effort.
To replace the ROOT-based TransientEventStore concept defind in Gaudi,
SQLamarr
adopts the SQLite3 package, enabling vectorized processing
of batches of events, for a better performance.
To avoid dependencies on ROOT, also the persistency is handled using SQLite3, writing the reconstructed (or intermediate) quantities in the form of SQLite3 databases. Note that converting an SQLite3 table to a ROOT nTuple requires no more than 3 lines of Python:
import sqlite3, uproot, pandas
with sqlite3.connect("SomeInput.db") as conn:
uproot.open("SomeFile.root", "RECREATE")["myTree"] = pandas.read_sql_table("myTable", conn)
Dependencies
Build from source
Make sure you have conda (or similar) installed, if not
get miniconda3.
Create and activate a dedicated conda environment, say sqlamarr
:
conda create -y -n sqlamarr -c conda-forge python=3.10 gxx gxx_linux-64 hepmc3 doxygen
conda activate sqlamarr
Create a out-of-source directory:
mkdir build
cd build
Configure and build
cmake ..
cmake --build .
How to use SQLamarr
The project is not mature enough to provide a good user experience.
For the time being, clone the repository and compile the package with CMake,
then edit the file src/main.cpp
to
define the desired pipeline, by using the building blocks provided by
the package.
BlockLib
The namespace SQLamarr::BlockLib
groups functions defining specialized blocks
making assumptions on the workflow in which these blocks will be deployed.
While useful for testing and for organizing the code defining pipelines,
it is not supposed to be stable (as it is being modified while the workflow
under test is modified) and should not be used as part of other packages.
Other packages, however, may take inspiration from the structure of SQLamarr::BlockLib
to design specialized blocks, resident in their codebase, in a more
organized way than having everything pipelined in a single file.
To test the completeness of the feature set in the main part of the library,
SQLamarr::BlockLib
is designed to only include functions, accessing public methods
of the objects defined in the main part of the library.
Copyright and Licence
(c) Copyright 2022 CERN for the benefit of the LHCb Collaboration.
This software is distributed under the terms of the GNU General Public Licence version 3 (GPL Version 3), copied verbatim in the file "LICENCE".
In applying this licence, CERN does not waive the privileges and immunities
granted to it by virtue of its status as an Intergovernmental Organization
or submit itself to any jurisdiction.
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 Distributions
Built Distributions
File details
Details for the file SQLamarr-0.0rc4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: SQLamarr-0.0rc4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2192739fbc162bf3077abe5a595c1f004cef5c79493308647526c7cfd351d84 |
|
MD5 | db2723f489ed9d68801693fc7df21e94 |
|
BLAKE2b-256 | 1a2bdbda94b7102c208826a66a9bdac49b9f7f26bd90b5f27293fe9ac4ce3e0a |
File details
Details for the file SQLamarr-0.0rc4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: SQLamarr-0.0rc4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0465bc32a134031b08322714c862e0032b27beaab07efcf1d664d06c02b15525 |
|
MD5 | 4337d860e58f2ffdced818ccaa3d730f |
|
BLAKE2b-256 | 0d95a4489a937732c12a662a02926db52d6d45995b891ba4db2aaadd3f71bfe6 |
File details
Details for the file SQLamarr-0.0rc4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: SQLamarr-0.0rc4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ed77c90196978d8e638857637329304d7ba71532e6681f08c240f52b37b7a5a |
|
MD5 | 7c2a319adc04467ac97d3b728a3cec4b |
|
BLAKE2b-256 | 45c3562e9e19713bae914a1f4e5e562f381e7b99060b935721504502b87ddd64 |
File details
Details for the file SQLamarr-0.0rc4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: SQLamarr-0.0rc4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9d26939cfd11aa9ad869cdba4f21227cd851ac9af63c8cd33c105b1ff77bdba |
|
MD5 | 755fd7b8ccbb1e1c35d054c7afa2e3f9 |
|
BLAKE2b-256 | ed42d548a5c5a21796443e91d4b7eee115923f7e716eb985b93df80649f50496 |
File details
Details for the file SQLamarr-0.0rc4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: SQLamarr-0.0rc4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a54f0ff51144db60c26f3f393502ab9d614240ea85d124fd30f1436e13adc8ee |
|
MD5 | 8e1393166575934ac73993a7fa6005f1 |
|
BLAKE2b-256 | 614c34082b4804b9982f0a0eb28d9e13324f9356cc3a580786f77c10c7024f0e |