Repository navigation
Conversation
This branch has not been deployed
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.
CUDA tensor dumps always passed
with_cuda=False, so they never used the existing CUDA hash implementation. Enabling that backend also exposed a scalar bug: unpacking a 0-D tensor's shape raisedValueError.This change represents scalars as one-element rows before CUDA hashing and routes CUDA tensor dumps to that backend. CPU and MPS tensors retain the CPU path. It preserves the existing quantization and hash recurrence, propagates backend failures, and adds explicit contracts to the changed functions.
dump_tensorreturnsobjectbecause its unchanged statistics path can return application-cached metadata without validating its type.Validation
Baseline:
6dccb47; candidate:b10876dd9610284b3c6defd87d081c4d12184d02.55324509, candidate55324590; NVIDIA H100 80GB HBM3, Python 3.12.3, PyTorch2.16.0.dev20261012+cu130, Numba 0.63.1. The scalartorch.tensor(1.0, device="cuda")changed from the shape-unpacking exception to the expected hash100000001. All 9 regression tests passed on the H100.with_cuda=False) and passes against the candidate. Local relevant suites: 53 passed, 4 CUDA-only tests skipped.Reproduce GPU validation on an allocated CUDA node:
Local validation also includes
tests/test_metadata_classification.py,tests/test_constructor_snapshot.py, andtests/test_trace_integrity.py. GPU logs and preflight JSON are under/home/yjiang21/traincheck-experiments/runs/checking-20261027/, with prefixespreflight-55324509andcuda-contracts-55324590.Scope and limitations
The historical algorithm returns only the first row's hash after flattening leading dimensions; this PR preserves that behavior. Empty vectors still hash to zero. Zero-row matrices remain unsupported. This is a correctness and backend-enablement change; no speedup is claimed.