feat(hpt): trunk primitives and tensor helpers - #42
Open
AnikethCheluva wants to merge 1 commit into
Open
Conversation
This was referenced Sep 8, 2026
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Sep 8, 2026
AnikethCheluva
marked this pull request as ready for review
September 8, 2026 05:02
AnikethCheluva
force-pushed
the
graph-nested-val
branch
from
September 9, 2026 22:21
d441759 to
3f84aac
Compare
AnikethCheluva
force-pushed
the
graph-hpt-deps
branch
from
September 9, 2026 22:21
ef882c9 to
4f15d96
Compare
AnikethCheluva
force-pushed
the
graph-hpt-deps
branch
from
September 10, 2026 17:56
4f15d96 to
8f8eee3
Compare
AnikethCheluva
force-pushed
the
graph-nested-val
branch
from
September 10, 2026 17:56
3f84aac to
59bb024
Compare
This was referenced Sep 10, 2026
First step of decomposing HPT into graph stages. Vendors the transformer trunk the HPT architecture is built on -- SimpleTransformer, MultiheadAttention, CrossAttention and their blocks -- from the main repo's arc branch. CrossAttention is what the stems use to compress a variable-length modality into a fixed latent count before the trunk sees it, so it lands here rather than with the stems. Also re-adds get_sinusoid_encoding_table and EinOpsRearrange, which HPT needs and which this fork dropped along with egomimic/utils/tensor_utils.py during the graph consolidation. They live in models/cores/hpt_utils.py, scoped to the callers that want them, rather than resurrecting a 996-line module the fork deliberately removed. Two fixes on the way in: the timm import moves off the deprecated timm.models.layers path so it stops warning on every import, and the helpers now validate their arguments instead of failing later with a shape error. Tests cover what the later stages depend on: the trunk preserves token shape, returns per-block outputs, mixes across positions, matches its own gradient-checkpointed path, honours an attention mask, and the sinusoid table handles an odd hidden size and a nonzero start offset. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AnikethCheluva
force-pushed
the
graph-nested-val
branch
from
September 10, 2026 22:20
59bb024 to
cdfd427
Compare
AnikethCheluva
force-pushed
the
graph-hpt-deps
branch
from
September 10, 2026 22:20
8f8eee3 to
1003152
Compare
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.

First step of decomposing HPT into graph stages. Vendors the transformer trunk
the HPT architecture is built on -- SimpleTransformer, MultiheadAttention,
CrossAttention and their blocks -- from the main repo's arc branch.
CrossAttention is what the stems use to compress a variable-length modality
into a fixed latent count before the trunk sees it, so it lands here rather
than with the stems.
Also re-adds get_sinusoid_encoding_table and EinOpsRearrange, which HPT needs
and which this fork dropped along with egomimic/utils/tensor_utils.py during
the graph consolidation. They live in models/cores/hpt_utils.py, scoped to the
callers that want them, rather than resurrecting a 996-line module the fork
deliberately removed.
Two fixes on the way in: the timm import moves off the deprecated
timm.models.layers path so it stops warning on every import, and the helpers
now validate their arguments instead of failing later with a shape error.
Tests cover what the later stages depend on: the trunk preserves token shape,
returns per-block outputs, mixes across positions, matches its own
gradient-checkpointed path, honours an attention mask, and the sinusoid table
handles an odd hidden size and a nonzero start offset.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com