-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
DQM modules to monitor Pixel RecHits for heterogenous workflows #37174
Conversation
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37174/28739
|
A new Pull Request was created by @sroychow (Suvankar Roy Chowdhury) for master. It involves the following packages:
@emanueleusai, @ahmad3213, @cmsbuild, @jfernan2, @pmandrik, @pbo0, @rvenditti can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
enable gpu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some quick preliminary comments.
DQM/SiPixelPhase1Heterogeneous/plugins/SiPixelPhase1MonitorRecHitsSoABase.cc
Outdated
Show resolved
Hide resolved
DQM/SiPixelPhase1Heterogeneous/plugins/SiPixelPhase1MonitorRecHitsSoABase.cc
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
void SiPixelPhase1MonitorRecHitsSoABase::fillHistosForRecHit(const DetId& id, const float xG, const float yG, const float zG, const float rG, const float fphi, const uint32_t charge, const int16_t sizeX, const int16_t sizeY) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of having a large set of arguments passed, wouldn't it be more elegant to store them in a POD struct
or something to that effect?
urgent |
DQM/SiPixelPhase1Heterogeneous/plugins/SiPixelPhase1MonitorRecHitsSoABase.cc
Outdated
Show resolved
Hide resolved
DQM/SiPixelPhase1Heterogeneous/plugins/SiPixelPhase1MonitorRecHitsSoABase.cc
Outdated
Show resolved
Hide resolved
// | ||
#ifndef DQM_SiPixelPhase1Heterogeneous_SiPixelPhase1MonitorRecHitsSoABase_h | ||
#define DQM_SiPixelPhase1Heterogeneous_SiPixelPhase1MonitorRecHitsSoABase_h | ||
#include "FWCore/Framework/interface/ESHandle.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed?
DQM/SiPixelPhase1Heterogeneous/plugins/SiPixelPhase1MonitorRecHitsSoABase.cc
Outdated
Show resolved
Hide resolved
// | ||
// Author: Alessandro Rossi, Suvankar Roy Chowdhury | ||
// | ||
#include "DataFormats/Math/interface/approx_atan2.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this needed for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for phi conversion from short to float (short2phi) on line 55
assign heterogeneous |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this other set is minor and I guess it could go into a follow-up.
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); | ||
|
||
private: | ||
edm::EDGetTokenT<TrackingRecHit2DCPU> tokenSoAHitsCPU_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be const
(if then put into the initializer list)
edm::EDGetTokenT<cms::cuda::Product<TrackingRecHit2DGPU>> tokenHitsGPU_; | ||
edm::EDGetTokenT<SiPixelClusterCollectionNew> clusterToken_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edm::EDGetTokenT<cms::cuda::Product<TrackingRecHit2DGPU>> tokenHitsGPU_; | |
edm::EDGetTokenT<SiPixelClusterCollectionNew> clusterToken_; | |
const edm::EDGetTokenT<cms::cuda::Product<TrackingRecHit2DGPU>> tokenHitsGPU_; | |
const edm::EDGetTokenT<SiPixelClusterCollectionNew> clusterToken_; |
if they're put into the initializer's list at line 40-41.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also the convention for the member data is inconsistent (either use leading m_
or trailing _
)
DQM/SiPixelPhase1Heterogeneous/plugins/SiPixelPhase1MonitorRecHitsSoAGPU.cc
Outdated
Show resolved
Hide resolved
: geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()), | ||
topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) { | ||
topFolderName_ = iConfig.getParameter<std::string>("TopFolderName"); //"SiPixelHeterogeneous/PixelRecHitsSoA"; | ||
onGPU_ = iConfig.getParameter<bool>("onGPU"); //unused now, but may be needed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not to have a parameter without any effect, because setting it to True
or False
will be misleading :-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead, better add it later, if it becomes needed.
@sroychow @arossi83 if you haven't already, could you check that the new module works correctly
and that the plots look OK in the three cases ? |
-1 Failed Tests: UnitTests Unit TestsI found errors in the following unit tests: ---> test test-das-selected-lumis had ERRORS GPU Comparison SummarySummary:
Comparison SummarySummary:
|
@@ -0,0 +1,3 @@ | |||
<export> | |||
<lib name="1"/> | |||
</export> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't be needed.
static void fillPSetDescription(edm::ParameterSetDescription& desc); | ||
|
||
protected: | ||
edm::ParameterSet config_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appears to be unused
edm::ParameterSet config_; |
const auto& rhsoaHandle = iEvent.getHandle(tokenSoAHitsCPU_); | ||
if (!rhsoaHandle.isValid()) | ||
return; | ||
auto const& rhsoa = iEvent.get(tokenSoAHitsCPU_); //*((rhsoaHandle.product())->get()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto const& rhsoa = iEvent.get(tokenSoAHitsCPU_); //*((rhsoaHandle.product())->get()); | |
auto const& rhsoa = *rhsoaHandle; |
would be cheaper and more idiomatic.
const auto& rhsoaHandle = iEvent.getHandle(tokenHitsGPU_); | ||
if (!rhsoaHandle.isValid()) | ||
return; | ||
const auto& rho = iEvent.get(tokenHitsGPU_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const auto& rho = iEvent.get(tokenHitsGPU_); | |
const auto& rho = *rhsoaHandle; |
m_store32 = rhsoa.localCoordToHostAsync(ctx.stream()); | ||
m_hitsModuleStart = rhsoa.hitsModuleStartToHostAsync(ctx.stream()); | ||
auto xl = m_store32.get(); | ||
auto yl = xl + m_nHits; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no synchronization between these lines and where xl
, yl
, or m_hitsModuleStart
are used.
The preferred solution would be to use ExternalWork
, but apparently the DQMEDAnalyzer
base class does not support additional extensions.
In general the next best solution would be to add an additional ExternalWork-EDProducer to do the transfer. (hopefully in the near future we'd find a way to avoid the explicit transfer-EDProducers, but it's possible that will be only for Alpaka-based code)
At minimum cudaCheck(cudaStreamSynchronize(ctx.stream()));
would be needed (guarantees safety, but is not necessarily as efficient).
cms::cuda::host::unique_ptr<float[]> m_store32; | ||
cms::cuda::host::unique_ptr<uint32_t[]> m_hitsModuleStart; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These would be better as local variables (because they are used in only one member function).
@fwyzard the module works correctly in |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-37174/28926
|
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-5c87f9/23258/summary.html GPU Comparison SummarySummary:
Comparison Summary@slava77 comparisons for the following workflows were not done due to missing matrix map:
Summary:
|
+1 |
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
Yes, that seems a reasonable approach.
|
PR description:
This PR introduces Rechi monitoring modules for pixels for CPU and GPU workflows. There is a base class where the histo booking, filling are done. Related talk
PR validation:
Checks done with 11634.501, 11634.506
if this PR is a backport please specify the original PR and why you need to backport that PR: