Enable OnDeviceSamplingConfig for compiler accuracy fix#37
Open
sdeeptan-aws wants to merge 1 commit intoaws-neuron:mainfrom
Open
Enable OnDeviceSamplingConfig for compiler accuracy fix#37sdeeptan-aws wants to merge 1 commit intoaws-neuron:mainfrom
sdeeptan-aws wants to merge 1 commit intoaws-neuron:mainfrom
Conversation
aws-yishanm
approved these changes
Feb 17, 2026
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.
Description
Updated VaultGemma-1B contrib model with compiler accuracy fix, validated modeling code, and updated README. The model initially had 0% accuracy due to Neuron compiler optimizations causing numerical divergence. Pure PyTorch matched HuggingFace perfectly — the fix was enabling
OnDeviceSamplingConfigwhich changes the XLA graph structure and prevents aggressive kernel fusions that destroyed numerical accuracy. Validation now achieves 100% token match.Model Information
Model Name: VaultGemma-1B
Model Architecture: Decoder-only transformer (Gemma-style with (1+w) RMSNorm)
Purpose: Text generation
Checklist
Required Components
test/integration/test_model.py)src/)Optional Components
Folder Structure
Confirm your contribution follows this structure:
Testing
Model was compiled and tested end-to-end. Key debugging finding: pure PyTorch implementation matched HF with 0.99 correlation, but compiled Neuron model diverged to 0.61 correlation. Enabling
OnDeviceSamplingConfigresolved the compiler optimization issue.Test Results:
Compatibility
Tested with:
Additional Information
output = self._norm(x) * (1.0 + self.weight)OnDeviceSamplingConfigis required for correct compiled model accuracy — without it, XLA kernel fusions cause numerical divergenceRelated Issues
N/A
vLLM Integration
By submitting this PR, I confirm that: