Support FIPS enabled machines with MD5 hashing (#15299)

Signed-off-by: Matthew Vine <32849887+MattTheCuber@users.noreply.github.com>
This commit is contained in:
Matthew Vine
2025-03-26 20:19:46 -04:00
committed by GitHub
parent e74ff409e0
commit 7a6d45bc8a
4 changed files with 36 additions and 19 deletions

View File

@@ -139,7 +139,8 @@ class InductorAdaptor(CompilerInterface):
from torch._inductor.codecache import torch_key
torch_factors = torch_key()
factors.append(torch_factors)
hash_str = hashlib.md5(str(factors).encode()).hexdigest()[:10]
hash_str = hashlib.md5(str(factors).encode(),
usedforsecurity=False).hexdigest()[:10]
return hash_str
def initialize_cache(self, cache_dir: str, disable_cache: bool = False):