Skip to content

Conversation

@hotcodemacha
Copy link
Contributor

@hotcodemacha hotcodemacha commented Aug 5, 2025

Summary

Closes #201

Introduced a new PyTorch-powered TorchSHA256 hashing engine that chooses a CUDA GPU when available and otherwise falls back to CPU, implementing the complete SHA256 algorithm with explicit 32-bit masking and standard round constants

Exposed a [gpu] optional dependency group to install torch for users who want GPU hashing support

Added tests verifying that the GPU-backed engine produces the same digest and algorithm name as the existing CPU SHA256 implementation

Checklist
  • All commits are signed-off, using DCO
  • All new code has docstrings and type annotations
  • All new code is covered by tests. Aim for at least 90% coverage. CI is configured to highlight lines not covered by tests.
  • Public facing changes are paired with documentation changes
  • Release note has been added to CHANGELOG.md if needed

Signed-off-by: Ashutosh Gupta <ashugpt@google.com>
@hotcodemacha hotcodemacha marked this pull request as ready for review August 5, 2025 21:11
@hotcodemacha hotcodemacha requested review from a team as code owners August 5, 2025 21:11
@hotcodemacha
Copy link
Contributor Author

@mihaimaruseac - Please help with review. Thanks

Copy link
Collaborator

@mihaimaruseac mihaimaruseac left a comment

Choose a reason for hiding this comment

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

I think we actually want the hashing itself to be via a C/C++ module that runs directly on GPU, not via a deep learning library. There is already some work being done by Purdue to hash models on GPU.

@hotcodemacha
Copy link
Contributor Author

I think we actually want the hashing itself to be via a C/C++ module that runs directly on GPU, not via a deep learning library. There is already some work being done by Purdue to hash models on GPU.

ack

@sandlbn
Copy link

sandlbn commented Oct 23, 2025

I think we actually want the hashing itself to be via a C/C++ module that runs directly on GPU, not via a deep learning library. There is already some work being done by Purdue to hash models on GPU.

ack

Agreed — using a C/C++ GPU module for hashing makes sense, especially if we want to stay vendor-agnostic and flexible with kernel integration. We’re already in touch with Purdue, but we’ll need a broader technical discussion and clear plan to move forward.

@mihaimaruseac
Copy link
Collaborator

I think we should close this to not confuse others. Thank you for this PR and the ones that got merged!

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.

Add support to hash via GPUs

3 participants