Update StableLM-2-1.6B with partial RoPE and LayerNorm#40
Open
sdeeptan-aws wants to merge 1 commit intoaws-neuron:mainfrom
Open
Update StableLM-2-1.6B with partial RoPE and LayerNorm#40sdeeptan-aws wants to merge 1 commit intoaws-neuron:mainfrom
sdeeptan-aws wants to merge 1 commit intoaws-neuron:mainfrom
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.
Description
Updated StableLM-2-1.6B contrib model with partial RoPE implementation (partial_rotary_factor=0.25), standard LayerNorm support (not RMSNorm), QKV bias handling, validated modeling code, tests, and README. The model applies RoPE to only 25% of the head dimension (16 out of 64), uses standard
nn.LayerNormwith bias, and has QKV bias enabled. Validation achieves 100% token match on deterministic prompts.Model Information
Model Name: StableLM-2-1.6B
Model Architecture: Decoder-only transformer (StableLM with partial RoPE, LayerNorm, QKV bias)
Purpose: Text generation
Checklist
Required Components
test/integration/test_model.py)src/)Optional Components
Folder Structure
Testing
Model was compiled and tested with TP=2, batch_size=1, seq_len=128, bfloat16. Key architectural features validated against HuggingFace reference:
nn.LayerNorm(not RMSNorm) with eps=1e-5Test Results:
Multi-Prompt Accuracy:
The 0% on "capital of France" is due to BF16 precision: HF top-1 "a" (14.67) vs top-2 "Paris" (14.61) — scores within 0.06, so rounding flips the prediction. Both outputs are coherent and correct.
Compatibility
Tested with:
Additional Information
use_qkv_bias=True— bias terms in all Q, K, V projectionsqk_layernorm=Falseuse_parallel_residual=False— sequential attention then MLP, not parallelRelated Issues
N/A
vLLM Integration
By submitting this PR, I confirm that: