-
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
DeepTau - Do not call TF inference with empty grid #44455
Conversation
cms-bot internal usage |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44455/39530
|
A new Pull Request was created by @valsdav for master. It involves the following packages:
@Martin-Grunewald, @mandrenguyen, @mmusich, @cmsbuild, @jfernan2 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
assign ml |
New categories assigned: ml @valsdav,@wpmccormack you have been requested to review this Pull request/Issue and eventually sign? Thanks |
please test |
+1 |
@@ -732,7 +732,10 @@ void L2TauNNProducer::fillPatatracks(tensorflow::Tensor& cellGridMatrix, | |||
|
|||
std::vector<float> L2TauNNProducer::getTauScore(const tensorflow::Tensor& cellGridMatrix) { | |||
std::vector<tensorflow::Tensor> pred_tensor; | |||
tensorflow::run(L2cacheData_->session, {{inputTensorName_, cellGridMatrix}}, {outputTensorName_}, &pred_tensor); | |||
// Check for empty input | |||
if (cellGridMatrix.NumElements() != 0) { |
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.
does cellGridMatrix.NumElements() == 0
guarantee that nTau
is also 0, such that accessing pred_tensor[0]
doesn't result in undefined behaviour?
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.
It is guaranteed because nTaus = cellGridMatrix.shape().dim_size(0)
, which is the same check, but I agree that it can be improved by wrapping all the snippet around a if (nTaus > 0)
.
If you wish I can rework it quickly
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.
If you wish I can rework it quickly
perhaps leave a comment, if it's guaranteed let's not add more if branches.
Thank you.
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.
@valsdav will you apply the suggestion above?
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.
yes, I'm about to push a commit with improvements 👍
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-e9b7b8/38263/summary.html Comparison SummarySummary:
|
+1 |
+hlt |
+ml |
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. @rappoccio, @antoniovilela, @sextonkennedy (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
Fix DeepTau issue #44333
The number of
valid_grid_cells
here is 0 for some events and this is creating aTF::Tensor
with shape [0, 1, 1, N].When this input is passed to a TF model executed on a CPU without
AVX512F AVX512_VNNI
, the model is executed and returns an empty output without complaining. WhenAVX512F AVX512_VNNI
instructions are present, the TF executor complains.This PR avoids calling the TF inference if empty inputs are detected.
The grid should never be empty. The issue will be followed up with Tau experts (enter here issue number..)
PR validation:
Works on the issue reproducer from #44333 (comment)