Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACAT2021 benchmark #92

Merged
merged 8 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:
tensorflow-probability==0.12.2 tensorflow-addons==0.13.0 \
tqdm click tensorflow-datasets 'ray[default]' 'ray[tune]' \
tf-models-official tensorflow-text \
tf2onnx onnxruntime zenodo_get seaborn scikit-optimize nevergrad
tf2onnx onnxruntime zenodo_get seaborn scikit-optimize nevergrad \
tensorflow-estimator==2.6.0 keras==2.6.0
git submodule init
git submodule update
- name: Run delphes TF model
Expand All @@ -45,7 +46,8 @@ jobs:
tensorflow-probability==0.12.2 tensorflow-addons==0.13.0 \
tqdm click tensorflow-datasets 'ray[default]' 'ray[tune]' \
tf-models-official tensorflow-text \
tf2onnx onnxruntime zenodo_get seaborn scikit-optimize nevergrad
tf2onnx onnxruntime zenodo_get seaborn scikit-optimize nevergrad \
tensorflow-estimator==2.6.0 keras==2.6.0
git submodule init
git submodule update
- name: Run CMS TF model using the pipeline
Expand Down
1 change: 1 addition & 0 deletions mlpf/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def customize_pipeline_test(config):
if "physical" in config["train_test_datasets"]:
config["train_test_datasets"]["physical"]["datasets"] = ["cms_pf_ttbar"]
config["train_test_datasets"] = {"physical": config["train_test_datasets"]["physical"]}
config["train_test_datasets"]["physical"]["batch_per_gpu"] = 5

return config

Expand Down
26 changes: 26 additions & 0 deletions mlpf/plotting/cms_fwlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@ def get(self, event):
("energy", "[o.energy() for o in obj]"),
]
))
expressions.append(Expression(
"ak4PFJetsPuppi",
"vector<reco::PFJet>",
[
("pt", "[o.pt() for o in obj]"),
("eta", "[o.eta() for o in obj]"),
("phi", "[o.phi() for o in obj]"),
("energy", "[o.energy() for o in obj]"),
]
))
expressions.append(Expression(
"pfMet",
"vector<reco::PFMET>",
[
("pt", "[o.pt() for o in obj]"),
("phi", "[o.phi() for o in obj]"),
]
))
expressions.append(Expression(
"pfMetPuppi",
"vector<reco::PFMET>",
[
("pt", "[o.pt() for o in obj]"),
("phi", "[o.phi() for o in obj]"),
]
))
expressions.append(Expression(
"particleFlow",
"vector<reco::PFCandidate>",
Expand Down
5 changes: 3 additions & 2 deletions mlpf/tfmodel/timing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import time
import pynvml
import sys

#pip install only onnxruntime_gpu, not onnxruntime!
import onnxruntime
Expand All @@ -17,7 +18,7 @@
mem_initial = mem.used/1000/1000
print("mem_initial", mem_initial)

onnx_sess = onnxruntime.InferenceSession("model.onnx", providers=EP_list)
onnx_sess = onnxruntime.InferenceSession(sys.argv[1], providers=EP_list)
time.sleep(5)

mem = pynvml.nvmlDeviceGetMemoryInfo(handle)
Expand All @@ -32,7 +33,7 @@
for i in range(100):

#allocate array in system RAM
X = np.array(np.random.randn(1, num_elems, 18), np.float32)
X = np.array(np.random.randn(1, num_elems, 25), np.float32)

#transfer data to GPU, run model, transfer data back
t0 = time.time()
Expand Down
Loading