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

Solve name conflict in TensorRT engine caching #5128

Merged
merged 6 commits into from
Sep 11, 2020
Merged

Conversation

stevenlix
Copy link
Contributor

  1. Fix hash conflict issue in engine cache naming
  2. Add more verbose log in engine caching
  3. Move engine/context release to right location
  4. Update onnx-tensorrt parser to include latest fix

@stevenlix stevenlix requested a review from a team as a code owner September 11, 2020 06:37
for (auto& i : vec) {
ret ^= std::hash<uint32_t>()(i);
ret ^= i + 0x9e3779b9 + (ret << 6) + (ret >> 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any comments on how this hash function was chosen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constant number and shifting are used to increase the distance of consecutive hash values and reduce hash conflicts.
Here is a good explanation, https://stackoverflow.com/questions/4948780/magic-number-in-boosthash-combine.

@stevenlix stevenlix merged commit c794c88 into master Sep 11, 2020
@stevenlix stevenlix deleted the stevenlix/hash branch September 11, 2020 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants