Repository navigation
Avoid warning contexts for verified native tensor method bindings - #162
Merged
Merged
Conversation
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.
Tensor metadata conversion repeatedly enters a warning-suppression context to read methods whose native binding cannot emit application warnings. This PR bypasses that guarded getter for verified native Tensor/Parameter methods, reducing metadata-conversion and traced-training time while retaining real bound objects and the original metadata classifier.
The shortcut requires exact receiver types, ordinary lookup, native descriptor ownership, unchanged inheritance and empty native instance storage. Properties, custom lookup, subclasses, shadowed state and unsupported descriptors keep the original path. It reads live namespaces/storage, caches no mutable values, and uses the descriptor type’s native
__get__. Required contracts and assertions remain explicit. Native allocation failure retains NOT_FOUND/backoff; internal assertion failures propagate. No global warning suppression, hashing change, serialization change or checker change is introduced.Fresh ordinary measurements of signed implementation
37f22e58954da403105c2c5510b7c7b6b3162ee6:CPU figures use four fresh processes per variant in ABBA order twice. H100 has three AB/BA/AB pairs; its median paired steady-step reduction is 15.738% (1.1868x). All percentages use baseline time as denominator. H100 is a single GPU, native FSDP, 6.2M-parameter TorchTitan Llama debug model, batch 1 / sequence 256, selective API collection from the same frozen policy. No model tracker or concurrent online checker runs. The single plain-control comparison remains expensive: 22.49x→18.96x; these small workloads do not establish generally low overhead or multi-GPU scaling. Component timing is separate from training and excludes hashing.
A separate H100 diagnostic finds 1,698,000/1,940,048 native bindings (87.52%) bypass the guarded getter, leaving 242,048 guarded reads over steps 3–10. Binding and classification still execute. Its timing is perturbed 1.39489x and excluded from performance estimates. Counts are not runtime attribution percentages.
Validation:
test_traincheck_internal_attr_hiddenandtest_inject_eval_loop. Pinned changed-file pre-commit, explicit test lint/format and strict scoped mypy pass. Documented pre-existing all-files Black whitespace failures remain excluded.__get__shadow, allocation-failure backoff and assertion propagation.The PR targets main directly and has no production dependency on other open PRs. CPU baseline is
6dccb47; H100 separately composes study baseline8cc73aband changes only the two metadata production files. CUDA hashing/policy/workload remain identical across H100 variants. No isolated memory saving is claimed. Large traces, frozen packages and all 98 validation report files are saved outside Git with verified hashes.Full methods, exact revisions, environments, commands, timing scope, checksums and limitations: final measurement report. Earlier skip-based measurement reports are explicitly historical; none of their numbers is relabeled as a result for this final implementation.