forked from karpathy/nanoGPT
-
Notifications
You must be signed in to change notification settings - Fork 28
Fix all gradient issue for Bit-Balanced Adaptive Learner, add quantization tools, analysis scripts with tensorboard integration #738
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
DonaldLucy
wants to merge
2
commits into
ReaLLMASIC:master
Choose a base branch
from
DonaldLucy:dev-env
base: master
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.
+822
−20
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
…ation tools, analysis scripts with tensorboard integration
gkielian
requested changes
Feb 5, 2026
Collaborator
gkielian
left a comment
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.
Generally looks great, have a few questions and minor edits -- was hoping too we can remove the LPE from the train_args.py section.
Collaborator
|
No worries, I think everything looks good -- just started the workflow
tests and will merge once it completes : )
…On Fri, Feb 6, 2026 at 12:59 PM DonaldLucy ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In train_args.py
<#738 (comment)>
:
> + ## Learned Position Embeddings
+ model_group.add_argument( '--n_lpe', type=int, default=0, help='Number of LearnedPositionEmbedding modules to instantiate (one per transformer block)')
+
+ model_group.add_argument('--lpe_block_size', default=256, type=int)
+ model_group.add_argument('--lpe_n_layer', default=3, type=int)
+ model_group.add_argument('--lpe_n_head', default=6, type=int)
+ model_group.add_argument('--lpe_n_kv_group', default=None, type=int)
+ model_group.add_argument('--lpe_use_abs_pos_embeddings', default=True, action=argparse.BooleanOptionalAction, help='Whether LPE modules add absolute position embeddings')
+ model_group.add_argument('--lpe_use_rotary_embeddings', default=True, action=argparse.BooleanOptionalAction, help='Whether LPE modules add absolute position embeddings')
+ model_group.add_argument('--lpe_n_qk_head_dim', default=None, type=int)
+ model_group.add_argument('--lpe_n_v_head_dim', default=None, type=int)
+ model_group.add_argument("--lpe_mlp_size", type=int, default=None, help="If not None, is used instead of mlp_expansion_factor")
+
+ model_group.add_argument('--target_layer_in_lpe', default=0, type=int)
+ model_group.add_argument('--target_layer_out_lpe', default=0, type=int)
+
+ model_group.add_argument(
+ "--lpe_attention_variant",
+ type=str,
+ default="causal",
+ choices=attention_variants,
+ help="Which attention variant to use for the Transformer blocks."
+ )
Didn't mean to, might be a version compatibility issue, it it removed
—
Reply to this email directly, view it on GitHub
<#738 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACTR6GM7G6DPVXEEIQN2NA34KT6D3AVCNFSM6AAAAACT5HNXHKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTONRVGEYDKNZRGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Gregory Kielian | Google Research | ***@***.***
|
Collaborator
|
@DonaldLucy Seems there might be a directory name change or additional file to add to the PR for the scripts to run (sharing screenshot): |
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.

Train (example)
TensorBoard:
Outputs
out/<run>/training outputs.If using
utils/bit_allocation_logger.py:out/<run>/bit_alloc/bit_*.csvPlotting
Bit allocation curves (layer-wise / type-wise):