SlideShare a Scribd company logo
1 of 21
Download to read offline
A Python upgrade to the GooFit package for parallel fitting
Henry Schreiner1
Himadri Pandey1
Michael Sokoloff1
Hittle Bradley2
Karen Tomko2
Christoph Hasse3
July 9, 2018
1
University of Cincinnati
2
Ohio Supercomputer Center
3
CERN / Technische Universität Dortmund (DE)
What is GooFit? GooFit Introduction
GPU and OpenMP embarrassingly parallel function evaluation engine.
• Designed to look like RooFit, but up to 1000x faster.
• Great for fitting, toy samples, and more.
Python • Inde
(simpler functions)
xing • Amp
(amplitude grammar)
Gen
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 1/16
GooFit Performance [from ACAT 2017] GooFit Introduction
1 2 4 12 24 48
44
85
213
418
843
OpenMP threads on 24 core Xeon
Time[s]
πππ0
, 16 time-dependent amplitudes
• Original RooFit code: 19,489 s single core
2 Cores Core 2 Duo 1,159 s
GPU GeForce GTX 1050 Ti 86.4 s
GPU Tesla K40 64.0 s
MPI Tesla K40 ×2 39.3 s
GPU Tesla P100 20.3 s
1 2 4 12 24 48
36
60
118
336
625
1,240
OpenMP threads on 24 core Xeon
Time[s]
ZachFit: M(D∗+
) − M(D0
)
• 142,576 events in unbinned fit
2 Cores Core 2 Duo 738 s
GPU GeForce GTX 1050 Ti 60.3 s
GPU Tesla K40 96.6 s
MPI Tesla K40 ×2 54.3 s
GPU Tesla P100 23.5 s
[Phys.Rev.Lett. 111 (2013) no.11, 111801]
[Phys.Rev. D93 (2016) no.11, 112014]
[Phys.Rev. D88 (2013) no.5, 052003]
[CHEP 2013]
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 2/16
How GooFit Works GooFit Introduction
Indices
Values
0 1 2
Function 1
How GooFit Works
• CPU classes: Variable, Observable, DataSet, GooPdf
• Functions in CUDA with pointers held by GooPdf
• Function and variable arrays populated by GooFit
• Evaluation runs through CUDA functions through
pointers (one kernel)
• Launching is handled by Thrust
Compose
PDFs
Core
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 3/16
How GooFit Works GooFit Introduction
Indices
Values
0 1 2
Function 1
0 2 3
Function 2
How GooFit Works
• CPU classes: Variable, Observable, DataSet, GooPdf
• Functions in CUDA with pointers held by GooPdf
• Function and variable arrays populated by GooFit
• Evaluation runs through CUDA functions through
pointers (one kernel)
• Launching is handled by Thrust
Compose
PDFs
Core
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 3/16
GooFit History GooFit Introduction
Modernization
2013 2014 2015 2016 2017 2018
0.1 0.2 0.3
OpenMP
0.4
Work in forks Minor updates
1.0
CMake
2.0
Python
2.1
Indexing
2.2
Recent History
• 2.0: New build system, C++11, and 4-body time dependent analyses support
• 2.1: Python bindings using Pybind11
• 2.2: New indexing (and lots of Python improvements)
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 4/16
Installation (Python) GooFit and Python
Pip install
• Pip always builds from source
• Uses CUDA if found, otherwise OpenMP
• It is possible to pass in CMake arguments
Pip 9
• pip install skbuild cmake
• pip install -v goofit
Pip 10
• pip install -v goofit
• Note: not a formal endorsement of Pip 10
CMake and normal directory
• Use GOOFIT_PYTHON=ON (Auto)
• Build directory should be in path
Also available in repository
• 12 of 13 C++ examples converted
• Interactive notebook examples
• Can be built ROOTless
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 5/16
Comparison GooFit and Python
#include <goofit/...>
using namespace GooFit;
Observable x{"x", 0, 10};
Variable mu{"mu", 1};
Variable sigma{"sigma", 1, 0, 10};
GaussianPdf gauss{"gauss", &x, &mu, &sigma};
UnbinnedDataSet ds{x};
std::mt19937 gen;
std::normal_distribution<double> d{1, 2.5};
for(size_t i=0; i<100000; i++)
ds.addEvent(d(gen));
gauss.fitTo(&ds);
std::cout << mu << std::endl;
from goofit import *
import numpy as np
x = Observable("x", 0, 10)
mu = Variable("mu", 1)
sigma = Variable("sigma", 1, 0, 10)
gauss = GaussianPdf("gauss", x, mu, sigma)
ds = UnbinnedDataSet(x)
data = np.random.normal(1, 2.5, (100000,1))
ds.from_matrix(data, filter=True)
gauss.fitTo(ds)
print(mu)
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 6/16
Pythonisms GooFit and Python
mu.value = 2
print(mu)
Variables
• Variables provide property access
• Variables can be printed
• Getters and Setters supported too
Memory
• GooFit object memory handled
transparently
ds.from_matrix(numpydata, filter=True)
DataSet: from/to Python
• DataSets can be read in/out to 2D buffers
• Option to filter invalid values
ds = BinnedDataSet(x, y, z)
ds.addEvent(xval, yval, zval)
Arguments
• Automatic conversion for lists
• Variable length arguments supported
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 7/16
Simulation and Evaluation GooFit and Python
grid, pts = gauss.evaluatePdf(x)
gauss.setData(grid)
PDF evaluation
• Evaluate on a grid
• Can be rerun interactively
gauss.fillMCDataSimple(1000000)
1D MC generation
• Simple way to produce MC
• Initial MC on CPU, evaluation on GPU
dplt = DalitzPlotter(prod, dp)
arr = dplt.make2D()
Amp3Body (TD)
• Can produce simple 3-body Toy MC
• DalitzPlotter functionality planned for
merge into Amp3Body
aa.setGenerationOffset(0);
aa.GenerateSig(1000000);
Amp4Body (TD)
• Full GPU Toy MC using MCBooster
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 8/16
Evaluation Example GooFit and Python
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 9/16
Evaluation Example GooFit and Python
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 9/16
Documentation GooFit and Python
Documentation
• Documentation exported to Jupyter
Implementation details
• Generated by CMake from Doxygen style
comments
Conversion to Jupyter style markdown
for math
• Attached to class in PyBind11
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 10/16
New Indexing System Indexing
Observable ID 1 0 1 1
Parameters 2 3.0 2.0 1 3.0
Constants 0 1 3.14
Normalization factors 1 1.0 1 1.0
ParameterContainer
• Nice API for PDFs
• Handles initialization/updates
• Can work past unknown components
πππ0
toy 1 πππ0
toy 5 Dalitz
0
100
200
Timeperiteration[ms]
2.0 GPU 2.2 GPU 2.0 CPU 2.2 CPU
Dual Xeon E5-2680 28 2.4 Ghz
NVIDIA P100
Performance: 2.0 to 2.2
• Faster on CUDA
• A bit slower on OpenMP
• Further optimizations possible
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 11/16
Indexing in Device Functions Indexing
__device__ fptype f_device(fptype* evt, ParameterContainer& pc) {
int id = pc.getObservable(0);
fptype x = evt[id];
fptype v = pc.getParameter(0);
pc.incrementIndex(1, 1, 0, 1, 1);
return x * v;
}
__device__ device_function_ptr ptr_to_Gaussian = device_Gaussian;
Device functions
• Simpler, easier than before
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 12/16
Indexing in PDF Indexing
__host__ MyPdf::MyPdf(std::string name, Observable x, Variable v,)
: GooPdf("MyPdf", name, x, v) {
registerFunction("ptr_to_f", ptr_to_f);
initialize();
}
Registration
• Simply register the function (with debug name)
• Observables, Variables can be registered in the constructor
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 13/16
Introduction to AmpGen AmpGen
AmpGen by Tim Evans
• Successor to MINT3: JIT compiler for amplitudes
• Includes easy to use and read grammar
• Inside LHCb framework, but can build standalone
• Includes pure Python ctypes interface
D0[D]{K(892)~0{K-,pi+},rho(770)0{pi+,pi-}}
D0
[D]
K*(892)0~ ρ(770)0
K- π+ π+ π-
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 14/16
DecayLanguage AmpGen
DecayLanguage: BETA
• Python package implementing AmpGen’s syntax
• Powerful PDG particle class included
• Reads in and understands decay chains
• Still in beta: future potential
• Expands lines, produces pictures
• Can output GooFit code!
• On PyPI and ReadTheDocs
D0
→ K π±
π±
π model
[Eur.Phys.J. C78 (2018)]
• AmpGen model: 222 lines
• GooFit model: 1314 lines
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 15/16
Summary Final Words
GooFit Python
• Easy to compose model
• Easy to manipulate model
• Pythonic interface
GooFit Indexing
• Simpler to add PDFs
• Faster on GPU
• More flexibility for
developers
AmpGen/DecayLanguage
• Syntax for amplitudes
• Beta Python package
• Future potential
Need help? Use GitHub issues, Gitter, or hschrein@cern.ch
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 16/16
Status of 2.2 Backup
GooFit 2.2 release delayed by critical bug in 4-body Amplitude calculation.
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 17/16
New Features Since 2.1 Backup
• CLI11 1.6 (2.2)
• Better MPI testing (2.2)
• Many new tests, in Catch2 (2.2)
• Dropped max limits for indexes (2.2)
• Large internal rename and new inheritance tree (2.2)
• 3-body fit fractions (2.1.3)
• Pip 10 support (2.1.3)
• Live notebook examples and support (2.1.2)
• DalitzPlotter (2.1.1)
A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 18/16

More Related Content

What's hot

PyHEP 2018: Tools to bind to Python
PyHEP 2018:  Tools to bind to PythonPyHEP 2018:  Tools to bind to Python
PyHEP 2018: Tools to bind to PythonHenry Schreiner
 
DPF 2017: GPUs in LHCb for Analysis
DPF 2017: GPUs in LHCb for AnalysisDPF 2017: GPUs in LHCb for Analysis
DPF 2017: GPUs in LHCb for AnalysisHenry Schreiner
 
Digital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingDigital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingHenry Schreiner
 
RDM 2020: Python, Numpy, and Pandas
RDM 2020: Python, Numpy, and PandasRDM 2020: Python, Numpy, and Pandas
RDM 2020: Python, Numpy, and PandasHenry Schreiner
 
IRIS-HEP Retreat: Boost-Histogram Roadmap
IRIS-HEP Retreat: Boost-Histogram RoadmapIRIS-HEP Retreat: Boost-Histogram Roadmap
IRIS-HEP Retreat: Boost-Histogram RoadmapHenry Schreiner
 
PyHEP 2019: Python Histogramming Packages
PyHEP 2019: Python Histogramming PackagesPyHEP 2019: Python Histogramming Packages
PyHEP 2019: Python Histogramming PackagesHenry Schreiner
 
Boosting command line experience with python and awk
Boosting command line experience with python and awkBoosting command line experience with python and awk
Boosting command line experience with python and awkKirill Pavlov
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIYoni Davidson
 
GPars in Saga Groovy Study
GPars in Saga Groovy StudyGPars in Saga Groovy Study
GPars in Saga Groovy StudyNaoki Rin
 
Odsc workshop - Distributed Tensorflow on Hops
Odsc workshop - Distributed Tensorflow on HopsOdsc workshop - Distributed Tensorflow on Hops
Odsc workshop - Distributed Tensorflow on HopsJim Dowling
 
BuildKitでLazy Pullを有効にしてビルドを早くする話
BuildKitでLazy Pullを有効にしてビルドを早くする話BuildKitでLazy Pullを有効にしてビルドを早くする話
BuildKitでLazy Pullを有効にしてビルドを早くする話Kohei Tokunaga
 
Scaling out Tensorflow-as-a-Service on Spark and Commodity GPUs
Scaling out Tensorflow-as-a-Service on Spark and Commodity GPUsScaling out Tensorflow-as-a-Service on Spark and Commodity GPUs
Scaling out Tensorflow-as-a-Service on Spark and Commodity GPUsJim Dowling
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Ray Jenkins
 
Python VS GO
Python VS GOPython VS GO
Python VS GOOfir Nir
 
Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6?
Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6?Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6?
Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6?Viach Kakovskyi
 
PyCon Russian 2015 - Dive into full text search with python.
PyCon Russian 2015 - Dive into full text search with python.PyCon Russian 2015 - Dive into full text search with python.
PyCon Russian 2015 - Dive into full text search with python.Andrii Soldatenko
 
Pig TPC-H Benchmark and Performance Tuning
Pig TPC-H Benchmark and Performance TuningPig TPC-H Benchmark and Performance Tuning
Pig TPC-H Benchmark and Performance TuningJie Li
 

What's hot (20)

PyHEP 2018: Tools to bind to Python
PyHEP 2018:  Tools to bind to PythonPyHEP 2018:  Tools to bind to Python
PyHEP 2018: Tools to bind to Python
 
DPF 2017: GPUs in LHCb for Analysis
DPF 2017: GPUs in LHCb for AnalysisDPF 2017: GPUs in LHCb for Analysis
DPF 2017: GPUs in LHCb for Analysis
 
Digital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meetingDigital RSE: automated code quality checks - RSE group meeting
Digital RSE: automated code quality checks - RSE group meeting
 
RDM 2020: Python, Numpy, and Pandas
RDM 2020: Python, Numpy, and PandasRDM 2020: Python, Numpy, and Pandas
RDM 2020: Python, Numpy, and Pandas
 
IRIS-HEP Retreat: Boost-Histogram Roadmap
IRIS-HEP Retreat: Boost-Histogram RoadmapIRIS-HEP Retreat: Boost-Histogram Roadmap
IRIS-HEP Retreat: Boost-Histogram Roadmap
 
PyHEP 2019: Python 3.8
PyHEP 2019: Python 3.8PyHEP 2019: Python 3.8
PyHEP 2019: Python 3.8
 
PyHEP 2019: Python Histogramming Packages
PyHEP 2019: Python Histogramming PackagesPyHEP 2019: Python Histogramming Packages
PyHEP 2019: Python Histogramming Packages
 
Boosting command line experience with python and awk
Boosting command line experience with python and awkBoosting command line experience with python and awk
Boosting command line experience with python and awk
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
 
GPars in Saga Groovy Study
GPars in Saga Groovy StudyGPars in Saga Groovy Study
GPars in Saga Groovy Study
 
Odsc workshop - Distributed Tensorflow on Hops
Odsc workshop - Distributed Tensorflow on HopsOdsc workshop - Distributed Tensorflow on Hops
Odsc workshop - Distributed Tensorflow on Hops
 
BuildKitでLazy Pullを有効にしてビルドを早くする話
BuildKitでLazy Pullを有効にしてビルドを早くする話BuildKitでLazy Pullを有効にしてビルドを早くする話
BuildKitでLazy Pullを有効にしてビルドを早くする話
 
Scaling out Tensorflow-as-a-Service on Spark and Commodity GPUs
Scaling out Tensorflow-as-a-Service on Spark and Commodity GPUsScaling out Tensorflow-as-a-Service on Spark and Commodity GPUs
Scaling out Tensorflow-as-a-Service on Spark and Commodity GPUs
 
R sharing 101
R sharing 101R sharing 101
R sharing 101
 
Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!Understanding eBPF in a Hurry!
Understanding eBPF in a Hurry!
 
Python VS GO
Python VS GOPython VS GO
Python VS GO
 
Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6?
Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6?Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6?
Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6?
 
PyPy London Demo Evening 2013
PyPy London Demo Evening 2013PyPy London Demo Evening 2013
PyPy London Demo Evening 2013
 
PyCon Russian 2015 - Dive into full text search with python.
PyCon Russian 2015 - Dive into full text search with python.PyCon Russian 2015 - Dive into full text search with python.
PyCon Russian 2015 - Dive into full text search with python.
 
Pig TPC-H Benchmark and Performance Tuning
Pig TPC-H Benchmark and Performance TuningPig TPC-H Benchmark and Performance Tuning
Pig TPC-H Benchmark and Performance Tuning
 

Similar to CHEP 2018: A Python upgrade to the GooFit package for parallel fitting

PEARC17: Modernizing GooFit: A Case Study
PEARC17: Modernizing GooFit: A Case StudyPEARC17: Modernizing GooFit: A Case Study
PEARC17: Modernizing GooFit: A Case StudyHenry Schreiner
 
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPyDong-hee Na
 
PyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsPyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsHenry Schreiner
 
SciPy22 - Building binary extensions with pybind11, scikit build, and cibuild...
SciPy22 - Building binary extensions with pybind11, scikit build, and cibuild...SciPy22 - Building binary extensions with pybind11, scikit build, and cibuild...
SciPy22 - Building binary extensions with pybind11, scikit build, and cibuild...Henry Schreiner
 
Scientific Visualization
Scientific VisualizationScientific Visualization
Scientific VisualizationJosef Heinen
 
Connecting Python To The Spark Ecosystem
Connecting Python To The Spark EcosystemConnecting Python To The Spark Ecosystem
Connecting Python To The Spark EcosystemSpark Summit
 
Spark Summit 2016: Connecting Python to the Spark Ecosystem
Spark Summit 2016: Connecting Python to the Spark EcosystemSpark Summit 2016: Connecting Python to the Spark Ecosystem
Spark Summit 2016: Connecting Python to the Spark EcosystemDaniel Rodriguez
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io
 
ACL-2022_tutorial_part_AB_V8 (1).pdf
ACL-2022_tutorial_part_AB_V8 (1).pdfACL-2022_tutorial_part_AB_V8 (1).pdf
ACL-2022_tutorial_part_AB_V8 (1).pdftuxinhui1
 
The Ring programming language version 1.9 book - Part 9 of 210
The Ring programming language version 1.9 book - Part 9 of 210The Ring programming language version 1.9 book - Part 9 of 210
The Ring programming language version 1.9 book - Part 9 of 210Mahmoud Samir Fayed
 
Python packaging: how did we get here, and where are we going?
Python packaging: how did we get here, and where are we going?Python packaging: how did we get here, and where are we going?
Python packaging: how did we get here, and where are we going?takluyver
 
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...Claire Rioualen
 
State of Big Data on ARM64 / AArch64 - Apache Bigtop
State of Big Data on ARM64 / AArch64 - Apache BigtopState of Big Data on ARM64 / AArch64 - Apache Bigtop
State of Big Data on ARM64 / AArch64 - Apache BigtopGanesh Raju
 
Heroku to Kubernetes & Gihub to Gitlab success story
Heroku to Kubernetes & Gihub to Gitlab success storyHeroku to Kubernetes & Gihub to Gitlab success story
Heroku to Kubernetes & Gihub to Gitlab success storyJérémy Wimsingues
 
WPS Projects Update
WPS Projects UpdateWPS Projects Update
WPS Projects UpdateJody Garnett
 
GPU Computing with Python and Anaconda: The Next Frontier
GPU Computing with Python and Anaconda: The Next FrontierGPU Computing with Python and Anaconda: The Next Frontier
GPU Computing with Python and Anaconda: The Next FrontierNVIDIA
 
Python and GObject Introspection
Python and GObject IntrospectionPython and GObject Introspection
Python and GObject IntrospectionYuren Ju
 

Similar to CHEP 2018: A Python upgrade to the GooFit package for parallel fitting (20)

PEARC17: Modernizing GooFit: A Case Study
PEARC17: Modernizing GooFit: A Case StudyPEARC17: Modernizing GooFit: A Case Study
PEARC17: Modernizing GooFit: A Case Study
 
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
[GSoC 2017] gopy: Updating gopy to support Python3 and PyPy
 
PyCon2022 - Building Python Extensions
PyCon2022 - Building Python ExtensionsPyCon2022 - Building Python Extensions
PyCon2022 - Building Python Extensions
 
SciPy 2022 Scikit-HEP
SciPy 2022 Scikit-HEPSciPy 2022 Scikit-HEP
SciPy 2022 Scikit-HEP
 
SciPy22 - Building binary extensions with pybind11, scikit build, and cibuild...
SciPy22 - Building binary extensions with pybind11, scikit build, and cibuild...SciPy22 - Building binary extensions with pybind11, scikit build, and cibuild...
SciPy22 - Building binary extensions with pybind11, scikit build, and cibuild...
 
Scientific Visualization
Scientific VisualizationScientific Visualization
Scientific Visualization
 
PyCon Estonia 2019
PyCon Estonia 2019PyCon Estonia 2019
PyCon Estonia 2019
 
Connecting Python To The Spark Ecosystem
Connecting Python To The Spark EcosystemConnecting Python To The Spark Ecosystem
Connecting Python To The Spark Ecosystem
 
Spark Summit 2016: Connecting Python to the Spark Ecosystem
Spark Summit 2016: Connecting Python to the Spark EcosystemSpark Summit 2016: Connecting Python to the Spark Ecosystem
Spark Summit 2016: Connecting Python to the Spark Ecosystem
 
Mender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and GolangMender.io | Develop embedded applications faster | Comparing C and Golang
Mender.io | Develop embedded applications faster | Comparing C and Golang
 
ACL-2022_tutorial_part_AB_V8 (1).pdf
ACL-2022_tutorial_part_AB_V8 (1).pdfACL-2022_tutorial_part_AB_V8 (1).pdf
ACL-2022_tutorial_part_AB_V8 (1).pdf
 
The Ring programming language version 1.9 book - Part 9 of 210
The Ring programming language version 1.9 book - Part 9 of 210The Ring programming language version 1.9 book - Part 9 of 210
The Ring programming language version 1.9 book - Part 9 of 210
 
Python packaging: how did we get here, and where are we going?
Python packaging: how did we get here, and where are we going?Python packaging: how did we get here, and where are we going?
Python packaging: how did we get here, and where are we going?
 
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
IFB cloud: Integration of snakemake workflows in an appliance designed for Ch...
 
State of Big Data on ARM64 / AArch64 - Apache Bigtop
State of Big Data on ARM64 / AArch64 - Apache BigtopState of Big Data on ARM64 / AArch64 - Apache Bigtop
State of Big Data on ARM64 / AArch64 - Apache Bigtop
 
Heroku to Kubernetes & Gihub to Gitlab success story
Heroku to Kubernetes & Gihub to Gitlab success storyHeroku to Kubernetes & Gihub to Gitlab success story
Heroku to Kubernetes & Gihub to Gitlab success story
 
WPS Projects Update
WPS Projects UpdateWPS Projects Update
WPS Projects Update
 
GPU Computing with Python and Anaconda: The Next Frontier
GPU Computing with Python and Anaconda: The Next FrontierGPU Computing with Python and Anaconda: The Next Frontier
GPU Computing with Python and Anaconda: The Next Frontier
 
The GPGPU Continuum
The GPGPU ContinuumThe GPGPU Continuum
The GPGPU Continuum
 
Python and GObject Introspection
Python and GObject IntrospectionPython and GObject Introspection
Python and GObject Introspection
 

More from Henry Schreiner

Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
Princeton RSE Peer network first meeting
Princeton RSE Peer network first meetingPrinceton RSE Peer network first meeting
Princeton RSE Peer network first meetingHenry Schreiner
 
Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Henry Schreiner
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingHenry Schreiner
 
What's new in Python 3.11
What's new in Python 3.11What's new in Python 3.11
What's new in Python 3.11Henry Schreiner
 
Everything you didn't know you needed
Everything you didn't know you neededEverything you didn't know you needed
Everything you didn't know you neededHenry Schreiner
 
PyCon 2022 -Scikit-HEP Developer Pages: Guidelines for modern packaging
PyCon 2022 -Scikit-HEP Developer Pages: Guidelines for modern packagingPyCon 2022 -Scikit-HEP Developer Pages: Guidelines for modern packaging
PyCon 2022 -Scikit-HEP Developer Pages: Guidelines for modern packagingHenry Schreiner
 
boost-histogram / Hist: PyHEP Topical meeting
boost-histogram / Hist: PyHEP Topical meetingboost-histogram / Hist: PyHEP Topical meeting
boost-histogram / Hist: PyHEP Topical meetingHenry Schreiner
 
HOW 2019: Machine Learning for the Primary Vertex Reconstruction
HOW 2019: Machine Learning for the Primary Vertex ReconstructionHOW 2019: Machine Learning for the Primary Vertex Reconstruction
HOW 2019: Machine Learning for the Primary Vertex ReconstructionHenry Schreiner
 
HOW 2019: A complete reproducible ROOT environment in under 5 minutes
HOW 2019: A complete reproducible ROOT environment in under 5 minutesHOW 2019: A complete reproducible ROOT environment in under 5 minutes
HOW 2019: A complete reproducible ROOT environment in under 5 minutesHenry Schreiner
 
ACAT 2019: A hybrid deep learning approach to vertexing
ACAT 2019: A hybrid deep learning approach to vertexingACAT 2019: A hybrid deep learning approach to vertexing
ACAT 2019: A hybrid deep learning approach to vertexingHenry Schreiner
 
2019 CtD: A hybrid deep learning approach to vertexing
2019 CtD: A hybrid deep learning approach to vertexing2019 CtD: A hybrid deep learning approach to vertexing
2019 CtD: A hybrid deep learning approach to vertexingHenry Schreiner
 
2019 IML workshop: A hybrid deep learning approach to vertexing
2019 IML workshop: A hybrid deep learning approach to vertexing2019 IML workshop: A hybrid deep learning approach to vertexing
2019 IML workshop: A hybrid deep learning approach to vertexingHenry Schreiner
 
CHEP 2019: Recent developments in histogram libraries
CHEP 2019: Recent developments in histogram librariesCHEP 2019: Recent developments in histogram libraries
CHEP 2019: Recent developments in histogram librariesHenry Schreiner
 
LHCb Computing Workshop 2018: PV finding with CNNs
LHCb Computing Workshop 2018: PV finding with CNNsLHCb Computing Workshop 2018: PV finding with CNNs
LHCb Computing Workshop 2018: PV finding with CNNsHenry Schreiner
 

More from Henry Schreiner (15)

Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Princeton RSE Peer network first meeting
Princeton RSE Peer network first meetingPrinceton RSE Peer network first meeting
Princeton RSE Peer network first meeting
 
Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023Software Quality Assurance Tooling 2023
Software Quality Assurance Tooling 2023
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance Tooling
 
What's new in Python 3.11
What's new in Python 3.11What's new in Python 3.11
What's new in Python 3.11
 
Everything you didn't know you needed
Everything you didn't know you neededEverything you didn't know you needed
Everything you didn't know you needed
 
PyCon 2022 -Scikit-HEP Developer Pages: Guidelines for modern packaging
PyCon 2022 -Scikit-HEP Developer Pages: Guidelines for modern packagingPyCon 2022 -Scikit-HEP Developer Pages: Guidelines for modern packaging
PyCon 2022 -Scikit-HEP Developer Pages: Guidelines for modern packaging
 
boost-histogram / Hist: PyHEP Topical meeting
boost-histogram / Hist: PyHEP Topical meetingboost-histogram / Hist: PyHEP Topical meeting
boost-histogram / Hist: PyHEP Topical meeting
 
HOW 2019: Machine Learning for the Primary Vertex Reconstruction
HOW 2019: Machine Learning for the Primary Vertex ReconstructionHOW 2019: Machine Learning for the Primary Vertex Reconstruction
HOW 2019: Machine Learning for the Primary Vertex Reconstruction
 
HOW 2019: A complete reproducible ROOT environment in under 5 minutes
HOW 2019: A complete reproducible ROOT environment in under 5 minutesHOW 2019: A complete reproducible ROOT environment in under 5 minutes
HOW 2019: A complete reproducible ROOT environment in under 5 minutes
 
ACAT 2019: A hybrid deep learning approach to vertexing
ACAT 2019: A hybrid deep learning approach to vertexingACAT 2019: A hybrid deep learning approach to vertexing
ACAT 2019: A hybrid deep learning approach to vertexing
 
2019 CtD: A hybrid deep learning approach to vertexing
2019 CtD: A hybrid deep learning approach to vertexing2019 CtD: A hybrid deep learning approach to vertexing
2019 CtD: A hybrid deep learning approach to vertexing
 
2019 IML workshop: A hybrid deep learning approach to vertexing
2019 IML workshop: A hybrid deep learning approach to vertexing2019 IML workshop: A hybrid deep learning approach to vertexing
2019 IML workshop: A hybrid deep learning approach to vertexing
 
CHEP 2019: Recent developments in histogram libraries
CHEP 2019: Recent developments in histogram librariesCHEP 2019: Recent developments in histogram libraries
CHEP 2019: Recent developments in histogram libraries
 
LHCb Computing Workshop 2018: PV finding with CNNs
LHCb Computing Workshop 2018: PV finding with CNNsLHCb Computing Workshop 2018: PV finding with CNNs
LHCb Computing Workshop 2018: PV finding with CNNs
 

Recently uploaded

Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...RohitNehra6
 
Orientation, design and principles of polyhouse
Orientation, design and principles of polyhouseOrientation, design and principles of polyhouse
Orientation, design and principles of polyhousejana861314
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoSérgio Sacani
 
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral AnalysisRaman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral AnalysisDiwakar Mishra
 
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptxanandsmhk
 
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡anilsa9823
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsSérgio Sacani
 
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCESTERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCEPRINCE C P
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bSérgio Sacani
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Lokesh Kothari
 
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfAnalytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfSwapnil Therkar
 
Types of different blotting techniques.pptx
Types of different blotting techniques.pptxTypes of different blotting techniques.pptx
Types of different blotting techniques.pptxkhadijarafiq2012
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
G9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.pptG9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.pptMAESTRELLAMesa2
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxgindu3009
 
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSpermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSarthak Sekhar Mondal
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​kaibalyasahoo82800
 
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...jana861314
 

Recently uploaded (20)

Biopesticide (2).pptx .This slides helps to know the different types of biop...
Biopesticide (2).pptx  .This slides helps to know the different types of biop...Biopesticide (2).pptx  .This slides helps to know the different types of biop...
Biopesticide (2).pptx .This slides helps to know the different types of biop...
 
Orientation, design and principles of polyhouse
Orientation, design and principles of polyhouseOrientation, design and principles of polyhouse
Orientation, design and principles of polyhouse
 
Isotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on IoIsotopic evidence of long-lived volcanism on Io
Isotopic evidence of long-lived volcanism on Io
 
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral AnalysisRaman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
Raman spectroscopy.pptx M Pharm, M Sc, Advanced Spectral Analysis
 
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
 
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
 
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCESTERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
STERILITY TESTING OF PHARMACEUTICALS ppt by DR.C.P.PRINCE
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
 
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdfAnalytical Profile of Coleus Forskohlii | Forskolin .pdf
Analytical Profile of Coleus Forskohlii | Forskolin .pdf
 
Types of different blotting techniques.pptx
Types of different blotting techniques.pptxTypes of different blotting techniques.pptx
Types of different blotting techniques.pptx
 
Engler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomyEngler and Prantl system of classification in plant taxonomy
Engler and Prantl system of classification in plant taxonomy
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
G9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.pptG9 Science Q4- Week 1-2 Projectile Motion.ppt
G9 Science Q4- Week 1-2 Projectile Motion.ppt
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
 
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatidSpermiogenesis or Spermateleosis or metamorphosis of spermatid
Spermiogenesis or Spermateleosis or metamorphosis of spermatid
 
CELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdfCELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdf
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
Traditional Agroforestry System in India- Shifting Cultivation, Taungya, Home...
 

CHEP 2018: A Python upgrade to the GooFit package for parallel fitting

  • 1. A Python upgrade to the GooFit package for parallel fitting Henry Schreiner1 Himadri Pandey1 Michael Sokoloff1 Hittle Bradley2 Karen Tomko2 Christoph Hasse3 July 9, 2018 1 University of Cincinnati 2 Ohio Supercomputer Center 3 CERN / Technische Universität Dortmund (DE)
  • 2. What is GooFit? GooFit Introduction GPU and OpenMP embarrassingly parallel function evaluation engine. • Designed to look like RooFit, but up to 1000x faster. • Great for fitting, toy samples, and more. Python • Inde (simpler functions) xing • Amp (amplitude grammar) Gen A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 1/16
  • 3. GooFit Performance [from ACAT 2017] GooFit Introduction 1 2 4 12 24 48 44 85 213 418 843 OpenMP threads on 24 core Xeon Time[s] πππ0 , 16 time-dependent amplitudes • Original RooFit code: 19,489 s single core 2 Cores Core 2 Duo 1,159 s GPU GeForce GTX 1050 Ti 86.4 s GPU Tesla K40 64.0 s MPI Tesla K40 ×2 39.3 s GPU Tesla P100 20.3 s 1 2 4 12 24 48 36 60 118 336 625 1,240 OpenMP threads on 24 core Xeon Time[s] ZachFit: M(D∗+ ) − M(D0 ) • 142,576 events in unbinned fit 2 Cores Core 2 Duo 738 s GPU GeForce GTX 1050 Ti 60.3 s GPU Tesla K40 96.6 s MPI Tesla K40 ×2 54.3 s GPU Tesla P100 23.5 s [Phys.Rev.Lett. 111 (2013) no.11, 111801] [Phys.Rev. D93 (2016) no.11, 112014] [Phys.Rev. D88 (2013) no.5, 052003] [CHEP 2013] A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 2/16
  • 4. How GooFit Works GooFit Introduction Indices Values 0 1 2 Function 1 How GooFit Works • CPU classes: Variable, Observable, DataSet, GooPdf • Functions in CUDA with pointers held by GooPdf • Function and variable arrays populated by GooFit • Evaluation runs through CUDA functions through pointers (one kernel) • Launching is handled by Thrust Compose PDFs Core A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 3/16
  • 5. How GooFit Works GooFit Introduction Indices Values 0 1 2 Function 1 0 2 3 Function 2 How GooFit Works • CPU classes: Variable, Observable, DataSet, GooPdf • Functions in CUDA with pointers held by GooPdf • Function and variable arrays populated by GooFit • Evaluation runs through CUDA functions through pointers (one kernel) • Launching is handled by Thrust Compose PDFs Core A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 3/16
  • 6. GooFit History GooFit Introduction Modernization 2013 2014 2015 2016 2017 2018 0.1 0.2 0.3 OpenMP 0.4 Work in forks Minor updates 1.0 CMake 2.0 Python 2.1 Indexing 2.2 Recent History • 2.0: New build system, C++11, and 4-body time dependent analyses support • 2.1: Python bindings using Pybind11 • 2.2: New indexing (and lots of Python improvements) A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 4/16
  • 7. Installation (Python) GooFit and Python Pip install • Pip always builds from source • Uses CUDA if found, otherwise OpenMP • It is possible to pass in CMake arguments Pip 9 • pip install skbuild cmake • pip install -v goofit Pip 10 • pip install -v goofit • Note: not a formal endorsement of Pip 10 CMake and normal directory • Use GOOFIT_PYTHON=ON (Auto) • Build directory should be in path Also available in repository • 12 of 13 C++ examples converted • Interactive notebook examples • Can be built ROOTless A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 5/16
  • 8. Comparison GooFit and Python #include <goofit/...> using namespace GooFit; Observable x{"x", 0, 10}; Variable mu{"mu", 1}; Variable sigma{"sigma", 1, 0, 10}; GaussianPdf gauss{"gauss", &x, &mu, &sigma}; UnbinnedDataSet ds{x}; std::mt19937 gen; std::normal_distribution<double> d{1, 2.5}; for(size_t i=0; i<100000; i++) ds.addEvent(d(gen)); gauss.fitTo(&ds); std::cout << mu << std::endl; from goofit import * import numpy as np x = Observable("x", 0, 10) mu = Variable("mu", 1) sigma = Variable("sigma", 1, 0, 10) gauss = GaussianPdf("gauss", x, mu, sigma) ds = UnbinnedDataSet(x) data = np.random.normal(1, 2.5, (100000,1)) ds.from_matrix(data, filter=True) gauss.fitTo(ds) print(mu) A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 6/16
  • 9. Pythonisms GooFit and Python mu.value = 2 print(mu) Variables • Variables provide property access • Variables can be printed • Getters and Setters supported too Memory • GooFit object memory handled transparently ds.from_matrix(numpydata, filter=True) DataSet: from/to Python • DataSets can be read in/out to 2D buffers • Option to filter invalid values ds = BinnedDataSet(x, y, z) ds.addEvent(xval, yval, zval) Arguments • Automatic conversion for lists • Variable length arguments supported A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 7/16
  • 10. Simulation and Evaluation GooFit and Python grid, pts = gauss.evaluatePdf(x) gauss.setData(grid) PDF evaluation • Evaluate on a grid • Can be rerun interactively gauss.fillMCDataSimple(1000000) 1D MC generation • Simple way to produce MC • Initial MC on CPU, evaluation on GPU dplt = DalitzPlotter(prod, dp) arr = dplt.make2D() Amp3Body (TD) • Can produce simple 3-body Toy MC • DalitzPlotter functionality planned for merge into Amp3Body aa.setGenerationOffset(0); aa.GenerateSig(1000000); Amp4Body (TD) • Full GPU Toy MC using MCBooster A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 8/16
  • 11. Evaluation Example GooFit and Python A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 9/16
  • 12. Evaluation Example GooFit and Python A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 9/16
  • 13. Documentation GooFit and Python Documentation • Documentation exported to Jupyter Implementation details • Generated by CMake from Doxygen style comments Conversion to Jupyter style markdown for math • Attached to class in PyBind11 A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 10/16
  • 14. New Indexing System Indexing Observable ID 1 0 1 1 Parameters 2 3.0 2.0 1 3.0 Constants 0 1 3.14 Normalization factors 1 1.0 1 1.0 ParameterContainer • Nice API for PDFs • Handles initialization/updates • Can work past unknown components πππ0 toy 1 πππ0 toy 5 Dalitz 0 100 200 Timeperiteration[ms] 2.0 GPU 2.2 GPU 2.0 CPU 2.2 CPU Dual Xeon E5-2680 28 2.4 Ghz NVIDIA P100 Performance: 2.0 to 2.2 • Faster on CUDA • A bit slower on OpenMP • Further optimizations possible A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 11/16
  • 15. Indexing in Device Functions Indexing __device__ fptype f_device(fptype* evt, ParameterContainer& pc) { int id = pc.getObservable(0); fptype x = evt[id]; fptype v = pc.getParameter(0); pc.incrementIndex(1, 1, 0, 1, 1); return x * v; } __device__ device_function_ptr ptr_to_Gaussian = device_Gaussian; Device functions • Simpler, easier than before A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 12/16
  • 16. Indexing in PDF Indexing __host__ MyPdf::MyPdf(std::string name, Observable x, Variable v,) : GooPdf("MyPdf", name, x, v) { registerFunction("ptr_to_f", ptr_to_f); initialize(); } Registration • Simply register the function (with debug name) • Observables, Variables can be registered in the constructor A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 13/16
  • 17. Introduction to AmpGen AmpGen AmpGen by Tim Evans • Successor to MINT3: JIT compiler for amplitudes • Includes easy to use and read grammar • Inside LHCb framework, but can build standalone • Includes pure Python ctypes interface D0[D]{K(892)~0{K-,pi+},rho(770)0{pi+,pi-}} D0 [D] K*(892)0~ ρ(770)0 K- π+ π+ π- A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 14/16
  • 18. DecayLanguage AmpGen DecayLanguage: BETA • Python package implementing AmpGen’s syntax • Powerful PDG particle class included • Reads in and understands decay chains • Still in beta: future potential • Expands lines, produces pictures • Can output GooFit code! • On PyPI and ReadTheDocs D0 → K π± π± π model [Eur.Phys.J. C78 (2018)] • AmpGen model: 222 lines • GooFit model: 1314 lines A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 15/16
  • 19. Summary Final Words GooFit Python • Easy to compose model • Easy to manipulate model • Pythonic interface GooFit Indexing • Simpler to add PDFs • Faster on GPU • More flexibility for developers AmpGen/DecayLanguage • Syntax for amplitudes • Beta Python package • Future potential Need help? Use GitHub issues, Gitter, or hschrein@cern.ch A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 16/16
  • 20. Status of 2.2 Backup GooFit 2.2 release delayed by critical bug in 4-body Amplitude calculation. A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 17/16
  • 21. New Features Since 2.1 Backup • CLI11 1.6 (2.2) • Better MPI testing (2.2) • Many new tests, in Catch2 (2.2) • Dropped max limits for indexes (2.2) • Large internal rename and new inheritance tree (2.2) • 3-body fit fractions (2.1.3) • Pip 10 support (2.1.3) • Live notebook examples and support (2.1.2) • DalitzPlotter (2.1.1) A Python upgrade to the GooFit package for parallel fitting Henry Schreiner July 9, 2018 18/16