-
Notifications
You must be signed in to change notification settings - Fork 602
Test Fused GDN Backward Pass Kernel w/ MaxText #5098
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
Draft
Rohan-Bierneni
wants to merge
13
commits into
main
Choose a base branch
from
rbierneni-gdnv3-bwd
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.
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6748e50
Port analytical GDN kernel and integrate into Qwen3/Qwen3.5 models
Rohan-Bierneni 9bfc01c
Add GMM v2 Qwen3.5 compatibility fix and GDN kernel AOT train compile…
Rohan-Bierneni 7c45d36
Add qwen3.5-tiny model configuration and registration
Rohan-Bierneni f5606a5
Dynamically compute VMEM limit from TPU capacity in GDN analytical ba…
Rohan-Bierneni c860160
Implement VMEM optimizations: z_c remat, 128 padded heads, 32-head ti…
Rohan-Bierneni cadfb10
Optimize GDN backward VMEM via Conv1D decoupling and vectorized head …
Rohan-Bierneni c5861c3
Align on canonical Decoupled GDN v1.5 kernel and remove monolithic code
Rohan-Bierneni b12d49a
Adjust head-tile tolerance in hybrid_bwd_analytical_pipeline_test for…
Rohan-Bierneni 8212308
Align test suite naming on Canonical GDN Kernel and update benchmark …
Rohan-Bierneni 2961748
Adjust head tile test tolerance and eliminate duplicate test method a…
Rohan-Bierneni 5753e36
Update test aliases and set full Qwen3.5-397B dimensions as default
Rohan-Bierneni 93e6b26
Support remat policy cross-comparison in hybrid_gdn_analytical_benchm…
Rohan-Bierneni 76bfd89
Add structured 3-mode XProf profiling with named scopes and gap inter…
Rohan-Bierneni 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
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,72 @@ | ||
| # Copyright 2026 Google LLC | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| # Tiny version of Qwen3.5 for fast testing and execution. | ||
|
|
||
| decoder_block: "qwen3_5" | ||
|
|
||
| # Core Architectural Parameters | ||
| base_emb_dim: 256 | ||
| base_num_decoder_layers: 2 | ||
| base_num_query_heads: 4 | ||
| base_num_kv_heads: 2 | ||
| head_dim: 256 | ||
| vocab_size: 248320 | ||
| normalization_layer_epsilon: 1.0e-6 | ||
|
|
||
| # MoE Specific Parameters | ||
| # Set base_mlp_dim to match base_moe_mlp_dim to pass validation for fully MoE models. | ||
| base_mlp_dim: 256 | ||
| base_moe_mlp_dim: 256 | ||
| num_experts: 8 | ||
| shared_experts: 1 | ||
| num_experts_per_tok: 2 | ||
| norm_topk_prob: true | ||
|
|
||
| # GatedDeltaNet Specific Parameters for Linear Attention (GDN) | ||
| inhomogeneous_layer_cycle_interval: 2 | ||
| gdn_conv_kernel_dim: 4 | ||
| gdn_key_head_dim: 128 | ||
| gdn_value_head_dim: 128 | ||
| gdn_num_key_heads: 2 | ||
| gdn_num_value_heads: 4 | ||
| gdn_chunk_size: 64 | ||
|
|
||
| # RoPE Settings | ||
| rope_max_timescale: 10000000 | ||
| partial_rotary_factor: 0.25 | ||
|
|
||
| # General Model Settings | ||
| enable_dropout: false | ||
|
|
||
| # Vision Encoder Configuration (need to set use_multimodal=true) | ||
| vision_encoder_block: "qwen3_5" | ||
| # Based on Qwen3.5 MoE Vision Model Config | ||
| image_size_for_vit: 768 | ||
| hidden_size_for_vit: 1152 | ||
| intermediate_size_for_vit: 4304 | ||
| num_attention_heads_for_vit: 16 | ||
| num_hidden_layers_for_vit: 27 | ||
| num_channels_for_vit: 3 | ||
| patch_size_for_vit: 16 | ||
| temporal_patch_size_for_vit: 2 | ||
| spatial_merge_size_for_vit: 2 | ||
| out_hidden_size_for_vit: 256 # Projects to decoder emb_dim (256) | ||
| num_position_embeddings_for_vit: 2304 | ||
| deepstack_visual_indexes_for_vit: [] # No deepstack for Qwen3.5 VL | ||
| rope_theta_for_vit: 10000 | ||
|
|
||
| # MRoPE Settings (Multi-dimensional RoPE for multimodal) | ||
| use_mrope: true | ||
| mrope_section: [11, 11, 10] |
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
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
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
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
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
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.
The logic to ensure
size_lhs_sublaneandsize_rhs_sublaneare equal can be simplified into a single line, improving readability.