Fix scalar-state hashing for PyTorch 1.12 in state hashing utilities - #61
Merged
InsightofSPb merged 1 commit intoAug 26, 2026
Conversation
InsightofSPb
merged commit Aug 26, 2026
6bf8fbe
into
codex/integrate-genuine-lposs-inference-in-repository
1 check passed
InsightofSPb
deleted the
codex/apply-minimal-scalar-state-hashing-fix-to-pr-#58
branch
August 26, 2026 19:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
cpu.view(torch.uint8).numpy().tobytes()usage could mis-hash or fail for scalar parameters.Description
cpu.view(torch.uint8).numpy().tobytes()withcpu.reshape(-1).view(torch.uint8).numpy().tobytes()at the three raw-byte hashing sites to ensure scalars are flattened before byte-viewing inovs_heritage/stock_features.pyandtools/run_official_lposs_parity.py.module_state_fingerprintto flatten the tensor bytes withreshape(-1).view(...)prior to hashing inovs_heritage/stock_features.py.test_scalar_state_hashing_is_deterministic_and_sensitivetoovs_heritage/tests/test_stock_lposs.pythat registers a scalar parameter and a multidimensional buffer, verifies deterministic fingerprints, and verifies hashes change when the scalar changes.Testing
python -m compileall -q ovs_heritage segmentation/evaluation/lposs_eval.py tools/check_stock_lposs_gpu.py tools/run_official_lposs_parity.pyexecuted and succeeded.pytest -q ovs_heritage/testscould not complete collection due to missing runtime dependencies in the environment (errors loadingnumpy,torch, andyaml).ruff checkon the modified modules completed successfully andgitworking-tree checks show the changes staged and committed locally.Codex Task