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

Adding HCal FB LUT to caloParams #41046

Closed
wants to merge 2 commits into from

Conversation

vshang
Copy link

@vshang vshang commented Mar 13, 2023

PR description:

This PR is to add a parameter to the latest caloParams file (caloParams_2022_v0_6_cfi.py) containing the HCal FB LUT for the LLP trigger as well as modifications to CaloL1 software to handle converting the HCal FB LUT from the caloParams file to the CaloL1 Algo settings key to upload to the DB.

PR validation:

Changes were tested locally by using the modified caloParams file to produce a CaloL1 Algo settings key containing the correct HCal FB LUT. This Algo settings key has been tested and validated during several P5 tests together with the new CaloLayer1 firmware and SWATCH software to upload the HCal FB LUT from DB to firmware.

… code to allow writing of LUT values to config file for uploading to DB.
@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41046/34606

  • This PR adds an extra 48KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-41046/34608

  • This PR adds an extra 48KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @vshang for master.

It involves the following packages:

  • CondFormats/L1TObjects (l1, db, alca)
  • L1Trigger/L1TCaloLayer1 (l1)
  • L1Trigger/L1TCalorimeter (l1)
  • L1TriggerConfig/L1TConfigProducers (l1)

@epalencia, @cmsbuild, @saumyaphor4252, @aloeliger, @francescobrivio, @cecilecaillol, @tvami can you please review it and eventually sign? Thanks.
@Martin-Grunewald, @missirol, @mmusich, @tocheng, @seemasharmafnal this is something you requested to watch as well.
@perrotta, @dpiparo, @rappoccio you are the release manager for this.

cms-bot commands are listed here

@aloeliger
Copy link
Contributor

@vshang thanks for the PR. Is this present already at P5? Are we just updating offline software to match? I recall some of the discussion from the offline software meeting, is this present in HCAL, or just at L1 side? Do we need to tag in anyone from HCAL, or ALCA and O2O?

@aloeliger
Copy link
Contributor

aloeliger commented Mar 14, 2023

The LUTs themselves seem pretty hard-coded. Is this seen as the solution for CaloL1 going forward?

@francescobrivio
Copy link
Contributor

Hi @vshang !
I'm afraid the changes you are proposing will break the schema evolution of CondFormats which is forbidden.
I took a look at the object you are modifying and it's used to define several Records:

using namespace l1t;
REGISTER_PLUGIN(L1TCaloParamsO2ORcd, CaloParams);
REGISTER_PLUGIN(L1TCaloParamsRcd, CaloParams);
REGISTER_PLUGIN(L1TCaloStage2ParamsRcd, CaloParams);
REGISTER_PLUGIN(L1TCaloConfigRcd, CaloConfig);

which are widely used in many GTs (including the online GTs), so introducing the change would break backward compatibility.
The only other option, as far as I know, is to create a new object/Rcd to add the new member std::vector<unsigned long long> u64params_. Or maybe other experts have other solutions in mind (tagging @mmusich for help)?

@mmusich
Copy link
Contributor

mmusich commented Mar 14, 2023

The only other option, as far as I know, is to create a new object/Rcd to add the new member

from a quick look, I don't see other options that formally comply with the "no schema evolution" policy.
From the PR description it's not clear to me if it was tested if reading old payloads data with the new data layout results in runtime misbehaviors.

@vshang
Copy link
Author

vshang commented Mar 14, 2023

@vshang thanks for the PR. Is this present already at P5? Are we just updating offline software to match? I recall some of the discussion from the offline software meeting, is this present in HCAL, or just at L1 side? Do we need to tag in anyone from HCAL, or ALCA and O2O?

Yes, the HCAL FB LUT has already been added to the DB and the new firmware and SWATCH code has been kept in production at P5. There is no change to the logic of the LLP trigger already present in both the L1T emulator and firmware as the caloParams file being added contains the default logic (i.e. entries are 0xBBBABBBABBBABBBA). I'm not sure about tagging HCAL or ALCA, but some of the changes might affect what O2O is doing.

The LUTs themselves seem pretty hard-coded. Is this seen as the solution for CaloL1 going forward?

Before this change, the LUTs were hard coded into the CaloL1 firmware, so this change was proposed to introduce flexibility in being able to change the LUTs through the DB instead by modifying the caloParams file in a new CMSSW release. This solution is what we want to use from the CaloL1 side moving forward.

@francescobrivio Thanks for the heads up. Can you clarify what you mean by "break the schema evolution of CondFormats which is forbidden"? I simply want to add a parameter to allow the use of 64b vectors instead of just 32b. Is this not possible?

@aloeliger
Copy link
Contributor

Sorry @vshang, one more question. Right now @hftsoi has #41028 open. Are these PRs interdependent at all? He has this LUT present as well, but hardcoded in. Nothing here is necessary for unpacker or DQM changes is it?

@tvami
Copy link
Contributor

tvami commented Mar 14, 2023

Thanks for the heads up. Can you clarify what you mean by "break the schema evolution of CondFormats which is forbidden"? I simply want to add a parameter to allow the use of 64b vectors instead of just 32b. Is this not possible?

Correct, adding new members to CondFormats is not possible as it breaks already existing tags that were made in the past. That is actually the reason why the rest of them are not called something specific but are called uparams_ or dparams_, that is a trick so you dont need to add more members, but you can expand the vector with any new integer or double. It seems nobody thought of the possibility of the need for long longs.

Can you explain to me why what you are doing couldnt be done with double-s?

@vshang
Copy link
Author

vshang commented Mar 14, 2023

Sorry @vshang, one more question. Right now @hftsoi has #41028 open. Are these PRs interdependent at all? He has this LUT present as well, but hardcoded in. Nothing here is necessary for unpacker or DQM changes is it?

These PRs should be completely independent as the changes in this PR do not depend on any of the changes for the unpacker/DQM, and vice versa.

Can you explain to me why what you are doing couldnt be done with double-s?

We want to store 64b hexadecimal values in the LUT in the caloParams file, and I was under the impression that the 'double' type was not sufficient for this purpose in C++. Is this not correct?

@tvami
Copy link
Contributor

tvami commented Mar 14, 2023

It depends on how high you go with your LUT values. Anyway, if you really need a long long, that unfortunately means a need for a new record definition

@aloeliger
Copy link
Contributor

A double and a long long can both be up to 8 bytes of information I believe (depending on CPU/compiler allocation). @vshang I don't suppose you can do some cast from one to the other as necessary? It's admittedly not a great solution.

@vshang
Copy link
Author

vshang commented Mar 14, 2023

It depends on how high you go with your LUT values. Anyway, if you really need a long long, that unfortunately means a need for a new record definition

Ideally we would have the flexibility to use all possible 64b values for the LUT, so I think an unsigned long log is required.

Can the changes to CondFormats/L1TObjects/interface/CaloParams.h be backported to whatever the GTs are running on? Othwerise, the simplest change would be to store the 64b LUT values as two 32b entries instead. However, this would also require modifying the SWATCH code and testing the new CaloL1 config key at P5 to ensure the HCal FB LUT values can be properly loaded into firmware.

@tvami
Copy link
Contributor

tvami commented Mar 14, 2023

Can the changes to CondFormats/L1TObjects/interface/CaloParams.h be backported to whatever the GTs are running on?

This would mean backporting to each release back to at least the releases in 2017. (1) I'm pretty sure you dont wanna do that, seems like a huge pain, (2) and it wouldn't matter, it's not the software that matters, but the fact that the DB has entries with this format. And no, we cannot remove those from the DB.

@vshang
Copy link
Author

vshang commented Mar 15, 2023

In that case, what we can do is instead split the HCal FB LUT in the caloParams file into two parameters, each containing 32b words corresponding to the upper/lower half of the 64b entries for the LUT. This way there would be no need make any changes to CondFormats. The config key for uploading to the DB will remain the same, containing the LUT with the full 64b words as each entry, so there would be no need to change anything with respect to SWATCH or DB. Does this solution sound ok?

@tvami
Copy link
Contributor

tvami commented Mar 15, 2023

Does this solution sound ok?

sounds good for alca

@vshang
Copy link
Author

vshang commented Mar 15, 2023

Ok, should I leave this PR open and update with another commit, or do you want to close this PR and open a new one once the changes are ready?

@tvami
Copy link
Contributor

tvami commented Mar 15, 2023

I think it makes sense to close this one, and open another, since there is a bit of a shift in the approach

@vshang
Copy link
Author

vshang commented Mar 16, 2023

I will close this PR and open a new one once the changes are ready then.

@vshang vshang closed this Mar 16, 2023
@tvami
Copy link
Contributor

tvami commented Mar 16, 2023

-1

  • will be redone in another PR, this would have broken the schema evolution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants