Open
Conversation
Port microsoft/git-base text decoder for NeuronX Distributed Inference. BERT-style architecture with post-LN residual blocks, absolute position embeddings, and embedding LayerNorm. Vision encoder runs on CPU. Validated: 100% token match, TTFT 1.28ms, 728 tok/s throughput. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Not needed — validation instructions are in README. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Both CLIP vision encoder and text decoder now compile on Neuron via NeuronBaseForImageToText. Key fix: text position embeddings are offset by num_image_tokens to match HF behavior where text positions start from 0 regardless of vision token count. Token match: 95.13% teacher-forced (5 random images, 20 tokens each). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tested with real COCO val2017 photos (cats, skateboarding, bus, kitchen) plus synthetic images. Neuron captions match or closely track HF golden model on all test images. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove text-only validation section (not the real use case) - Keep vision+text results: 95.13% TF / 46.41% greedy on 5 COCO images - Remove token_match_vision_results.json data artifact Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Model Details
Validation (Vision+Text)
Files
contrib/models/git-base/src/modeling_git.py— Text-only decoder implementationcontrib/models/git-base/src/modeling_git_vision.py— Full vision+text implementationcontrib/models/git-base/test/— Integration testscontrib/models/git-base/README.md— Documentation with COCO captioning demo🤖 Generated with Claude Code