Skip to content
Snippets Groups Projects

Implementation of ONNX model score computation and decoration for Taus (GNTau)

Merged Nadav Michael Tamir requested to merge ntamir/athena:master into main

Add tools and wrappers to run ONNX-based models for Tau objects. Details can be found in FTag software meeting presentation, but in short: a new class and tool are added to tauRecTools along with some new variable calculator functionalities to run model inference and decorate TauJets and TauTracks, and DerivationFrameworkTau + tauRec are modified to call the tools and decorate the DAOD TauJets (if one also decorates the DeepSetID at the moment).

Merge request reports

Pipeline #7382317 passed

Pipeline passed for 2ed3a775 on ntamir:master

Approval is optional

Merged by Tadej NovakTadej Novak 10 months ago (May 14, 2024 1:35pm UTC)

Merge details

  • Changes merged into main with c82a2666 (commits were squashed).
  • Did not delete the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
639 639 return myTauWPDecorator
640 640
641 641
642 def getGNNEvaluator():
  • Antonio De Maria
    Antonio De Maria @ademaria started a thread on commit 5a23ba98
  • 144 144 allowedTypes=['string']
    145 145 StoredValue='CombinedTES_R22_Round2.5.root'
    146 146
    147 class tauRecTauGNNConfig(JobProperty):
  • Antonio De Maria
    Antonio De Maria @ademaria started a thread on commit 5a23ba98
  • 4 4
    5 5 TauJetsCPContent = [
    6 6 "TauJets",
    7 "TauJetsAux.pt.eta.phi.m.ptFinalCalib.etaFinalCalib.ptTauEnergyScale.etaTauEnergyScale.charge.nChargedTracks.nIsolatedTracks.nAllTracks.isTauFlags.PanTau_DecayMode.NNDecayMode.NNDecayModeProb_1p0n.NNDecayModeProb_1p1n.NNDecayModeProb_1pXn.NNDecayModeProb_3p0n.RNNJetScore.RNNJetScoreSigTrans.JetDeepSetScore.JetDeepSetScoreTrans.JetDeepSetVeryLoose.JetDeepSetLoose.JetDeepSetMedium.JetDeepSetTight.JetDeepSetScore_v2.JetDeepSetScoreTrans_v2.JetDeepSetVeryLoose_v2.JetDeepSetLoose_v2.JetDeepSetMedium_v2.JetDeepSetTight_v2.RNNEleScore.RNNEleScoreSigTrans_v1.EleRNNLoose_v1.EleRNNMedium_v1.EleRNNTight_v1.tauTrackLinks.vertexLink.secondaryVertexLink.neutralPFOLinks.pi0PFOLinks.truthParticleLink.truthJetLink.trackWidth.centFrac.etOverPtLeadTrk.innerTrkAvgDist.absipSigLeadTrk.SumPtTrkFrac.EMPOverTrkSysP.ptRatioEflowApprox.mEflowApprox.dRmax.trFlightPathSig.massTrkSys.leadTrackProbNNorHT.EMFracFixed.etHotShotWinOverPtLeadTrk.hadLeakFracFixed.PSFrac.ClustersMeanCenterLambda.ClustersMeanFirstEngDens.ClustersMeanPresamplerFrac",
    7 "TauJetsAux.pt.eta.phi.m.ptFinalCalib.etaFinalCalib.ptTauEnergyScale.etaTauEnergyScale.charge.nChargedTracks.nIsolatedTracks.nAllTracks.isTauFlags.PanTau_DecayMode.NNDecayMode.NNDecayModeProb_1p0n.NNDecayModeProb_1p1n.NNDecayModeProb_1pXn.NNDecayModeProb_3p0n.RNNJetScore.RNNJetScoreSigTrans.JetDeepSetScore.JetDeepSetScoreTrans.JetDeepSetVeryLoose.JetDeepSetLoose.JetDeepSetMedium.JetDeepSetTight.JetDeepSetScore_v2.JetDeepSetScoreTrans_v2.JetDeepSetVeryLoose_v2.JetDeepSetLoose_v2.JetDeepSetMedium_v2.JetDeepSetTight_v2.RNNEleScore.RNNEleScoreSigTrans_v1.EleRNNLoose_v1.EleRNNMedium_v1.EleRNNTight_v1.tauTrackLinks.vertexLink.secondaryVertexLink.neutralPFOLinks.pi0PFOLinks.truthParticleLink.truthJetLink.trackWidth.centFrac.etOverPtLeadTrk.innerTrkAvgDist.absipSigLeadTrk.SumPtTrkFrac.EMPOverTrkSysP.ptRatioEflowApprox.mEflowApprox.dRmax.trFlightPathSig.massTrkSys.leadTrackProbNNorHT.EMFracFixed.etHotShotWinOverPtLeadTrk.hadLeakFracFixed.PSFrac.ClustersMeanCenterLambda.ClustersMeanFirstEngDens.ClustersMeanPresamplerFrac.GNTauScore.GNTauProbTau.GNTauProbJet",
    • Ok, not for now, but we should also make some tests to compare by how much the derivation file size is going to increase when adding these new quantities. If people are going to complain, are all these variables mandatory to be added or for example we can drop the Prob? (probably yes looking at the next part of the code)

      Edited by Antonio De Maria
    • Probabilities dropped after salt-pt/salt-onnx/athena-onnx consistency checks passed.

    • Please register or sign in to reply
  • Antonio De Maria
    Antonio De Maria @ademaria started a thread on commit 5a23ba98
  • 869 869 result.setPrivateTools(myTauWPDecorator)
    870 870 return result
    871 871
    872 def TauGNNEvaluatorCfg(flags):
    873 result = ComponentAccumulator()
    874 _name = flags.Tau.ActiveConfig.prefix + 'TauGNN'
    875
    876 TauGNNEvaluator = CompFactory.getComp("TauGNNEvaluator")
    877 GNNConf = flags.Tau.TauGNNConfig
    878 myTauGNNEvaluator = TauGNNEvaluator(name = _name,
    879 NetworkFile = GNNConf[0],
    880 OutputVarname = "GNTauScore",
    881 OutputPTau = "GNTauProbTau",
    882 OutputPJet = "GNTauProbJet",
    883 MaxTracks = 30,
    • Were this "MaxTracks", "MaxClusters" and "MaxClusterDR" also features used in the training or are these just dummy/large values?

    • MaxTracks and MaxClusters are indeed used in training (though the limit is very rarely reached). MaxClusterDR was left-over as legacy functionality from the TauJetRNNEvaluator setup, and isn't used in the training.

    • Please register or sign in to reply
  • Tagging @ademaria, @edreyer, @prieck, @bdong and @ligang to begin with :)

  • Jenkins please retry a build

  • This merge request affects 3 packages:

    • PhysicsAnalysis/DerivationFramework/DerivationFrameworkTau
    • Reconstruction/tauRec
    • Reconstruction/tauRecTools

    Affected files list will not be printed in this case

    Adding @jcatmore ,@martindl ,@goetz ,@emmat ,@adbailey ,@xiaozhon as watchers

  • Antonio De Maria
  • :x: CI Result FAILURE (hash a0996dcb)

    Athena AnalysisBase AthAnalysis
    externals :white_check_mark: :white_check_mark: :white_check_mark:
    cmake :white_check_mark: :white_check_mark: :white_check_mark:
    make :warning: :warning: :warning:
    tests :o: :white_check_mark: :white_check_mark:

    Full details available on this CI monitor view. Check the JIRA CI status board for known problems
    :warning: Athena: number of compilation errors 0, warnings 1
    :warning: AnalysisBase: number of compilation errors 0, warnings 1
    :warning: AthAnalysis: number of compilation errors 0, warnings 1
    :pencil: For experts only: Jenkins output [CI-MERGE-REQUEST-EL9 4194]

  • Antonio De Maria
  • added 1 commit

    • 3da582e9 - Changes following GitLab comments

    Compare with previous version

  • added 1 commit

    • a0b6412f - Add noAux model to ConfigFlags

    Compare with previous version

  • added 1 commit

    • 2a8bb49e - Remove else{} block with evtStore call from VarCalc

    Compare with previous version

  • General question: now that we have two models in place, can we put both in the DAOD PHYS to test them? Otherwise I would prefer to give the priority to the TauID only model without aux task

    Edited by Antonio De Maria
  • added 2 commits

    • 12e7cb70 - Resolve conflicts and rebase on current athena version
    • 9a02ea25 - Merge branch 'GNTau_update' into 'master'

    Compare with previous version

  • Nadav Michael Tamir added 1279 commits

    added 1279 commits

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • 128 128
    129 129 //Prepare input variables
    130 130 if (!calculateInputVariables(tau, tracks, clusters, scalarInputs, vectorInputs)) {
    131 ATH_MSG_WARNING("Failed calculateInputVariables");
    131 ATH_MSG_FATAL("Failed calculateInputVariables");
    • Resolved by Nadav Michael Tamir

      Hi @ntamir! Just to let you know !68579 (merged) is now merged! I would highlight the new ConstituentsLoader interface, it might be possible for you to also reuse part of this.

      From the FTAG side, we would like to be able to input clusters (as you do), so if you implemented the cluster loader as a ConstituentsLoader, FTAG would also be able to make use of this, which would be a great bonus :grinning:

  • added 1865 commits

    Compare with previous version

  • Jenkins please retry a build

  • This merge request affects 3 packages:

    • PhysicsAnalysis/DerivationFramework/DerivationFrameworkTau
    • Reconstruction/tauRec
    • Reconstruction/tauRecTools

    Affected files list will not be printed in this case

    Adding @goetz ,@xiaozhon ,@jcatmore ,@martindl ,@emmat ,@adbailey as watchers

  • :x: CI Result FAILURE (hash e30c1d3c)

    Athena AnalysisBase AthAnalysis
    externals :white_check_mark: :white_check_mark: :white_check_mark:
    cmake :white_check_mark: :white_check_mark: :white_check_mark:
    make :white_check_mark: :white_check_mark: :white_check_mark:
    tests :o: :white_check_mark: :white_check_mark:

    Full details available on this CI monitor view. Check the JIRA CI status board for known problems
    :white_check_mark: Athena: number of compilation errors 0, warnings 0
    :white_check_mark: AnalysisBase: number of compilation errors 0, warnings 0
    :white_check_mark: AthAnalysis: number of compilation errors 0, warnings 0
    :pencil: For experts only: Jenkins output [CI-MERGE-REQUEST-EL9 7264] (remote access info)

  • added 3481 commits

    Compare with previous version

  • tagging also @gwatts and @ekourlit, as we would like to have this MR for the imminent PHYS production and this is adding some new variables in DAOD PHYS (not yet for PHYSLITE)

  • Link to the jira ticket for the PHYS production: ATLASDPD-2084

    Edited by Dan Guest
  • added 102 commits

    Compare with previous version

  • Nadav Michael Tamir resolved all threads

    resolved all threads

  • added 1 commit

    • be97ff64 - Final touch-ups for MR deployment, all issues resolved

    Compare with previous version

  • added 1 commit

    • f8ba7133 - Only run inference for taus with pT>13GeV, remove explicit future model reference from flags

    Compare with previous version

  • Nadav Michael Tamir marked this merge request as ready

    marked this merge request as ready

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading