-
Notifications
You must be signed in to change notification settings - Fork 28
Add Aria text decoder (MoE) contrib model port #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dhwanw
wants to merge
3
commits into
main
Choose a base branch
from
contrib/Aria
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Contrib Model: Aria (Text Decoder) | ||
|
|
||
| NeuronX Distributed Inference implementation of the Aria text decoder model. | ||
|
|
||
| ## Model Information | ||
|
|
||
| - **HuggingFace ID:** `rhymes-ai/Aria` | ||
| - **Architecture:** MoE Decoder-only transformer (LLaMA-based) | ||
| - **Parameters:** ~3.9B total (text decoder) | ||
| - **MoE Configuration:** 64 routed experts, top-6 routing, 2 shared experts | ||
| - **Attention:** 20 Q heads, 20 KV heads (MHA), RoPE | ||
| - **Layers:** 28 decoder layers | ||
| - **License:** Check HuggingFace model card | ||
|
|
||
| ## Implementation Notes | ||
|
|
||
| This port implements only the text decoder component of Aria. | ||
| The vision tower and multi-modal projector are not included. | ||
|
|
||
| The implementation reuses NXDI's standard MoE infrastructure (`initialize_moe_module` | ||
| from `moe_v2`) which handles both routed and shared experts, following the same | ||
| pattern as built-in Mixtral and Qwen3-MoE models. | ||
|
|
||
| ## Validation Results | ||
|
|
||
| **Validated:** 2026-03-17 | ||
|
|
||
| | Metric | Value | | ||
| |--------|-------| | ||
| | Teacher-forced match | **98.12%** (PASSED) | | ||
| | Greedy match | 72.81% | | ||
| | Throughput (TKG) | 4.2 tokens/sec | | ||
| | Config | tp=8, batch=1, seq_len=512, bf16 | | ||
| | Instance | trn1.32xlarge | | ||
| | HF golden reference | `AriaForConditionalGeneration` (text-only input) | | ||
|
|
||
| ### Token Match Details (10 prompts, 32 tokens each) | ||
|
|
||
| | Prompt | Greedy | Teacher-Forced | | ||
| |--------|--------|----------------| | ||
| | "The theory of general relativity..." | 90.6% | 96.9% | | ||
| | "The French Revolution began in..." | 100.0% | 100.0% | | ||
| | "To solve a quadratic equation..." | 100.0% | 100.0% | | ||
| | "Once upon a time in a distant galaxy..." | 12.5% | 96.9% | | ||
| | "def fibonacci(n):..." | 100.0% | 100.0% | | ||
| | "The Amazon River flows through..." | 96.9% | 93.8% | | ||
| | "The concept of free will..." | 28.1% | 96.9% | | ||
| | "To make a cup of coffee, first..." | 0.0% | 96.9% | | ||
| | "List three benefits of regular exercise..." | 100.0% | 100.0% | | ||
| | "If all roses are flowers..." | 100.0% | 100.0% | | ||
|
|
||
| Note: HF golden uses full `AriaForConditionalGeneration` with text-only input | ||
| (no pixel_values). `AriaTextForCausalLM` cannot be loaded directly due to | ||
| weight prefix mismatch (`language_model.*` in checkpoint). Greedy divergence | ||
| is expected for MoE models in bf16 due to cascading expert routing differences. | ||
|
|
||
| ## Compatibility Matrix | ||
|
|
||
| | Instance/Version | 2.20+ | 2.19 and earlier | | ||
| |------------------|-------|------------------| | ||
| | Trn1 | Working | Not tested | | ||
| | Inf2 | Not tested | Not tested | | ||
|
|
||
| ## Performance | ||
|
|
||
| Profiled on trn1.32xlarge (single NeuronCore utilization): | ||
|
|
||
| | Metric | Context Encoding | Token Generation | | ||
| |--------|-----------------|------------------| | ||
| | Throughput | - | 4.2 tok/s | | ||
| | MBU (Memory) | 1.4% | 2.8% | | ||
| | MFU (Compute) | 0.9% | 0.0% | | ||
|
|
||
| *Batch size 1, sequence length 512, BF16 precision, TP=8* | ||
|
|
||
| ## Maintainer | ||
|
|
||
| Neuroboros Team - Annapurna Labs | ||
|
|
||
| **Last Updated:** 2026-03-17 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from .modeling_aria_text import NeuronAriaTextForCausalLM, AriaTextInferenceConfig |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to "Annapurna Labs"