Refactor GPT-Neo output tracing to use capture_outputs/can_return_tuple#44018
Open
yashbora9 wants to merge 2 commits intohuggingface:mainfrom
Open
Refactor GPT-Neo output tracing to use capture_outputs/can_return_tuple#44018yashbora9 wants to merge 2 commits intohuggingface:mainfrom
yashbora9 wants to merge 2 commits intohuggingface:mainfrom
Conversation
…tors Migrates GPT-Neo to the standardized output collection interface as part of huggingface#43979. Removes manual output_attentions/output_hidden_states/return_dict handling in favor of hook-based output capturing via decorators. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…moval - Added @merge_with_config_defaults to resolve use_cache from config - Removed output_attentions=True from test_local_attn_probs (attention layer always returns weights, no longer accepts this param) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: gpt_neo |
This was referenced Apr 23, 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.
Summary
gpt_neoto the standardized output collection interface as part of Call to contributions: refactor output tracing in transformers #43979@capture_outputsdecorator onGPTNeoModel.forward(base model)@can_return_tupledecorator on all wrapper model forwards (ForCausalLM,ForSequenceClassification,ForTokenClassification,ForQuestionAnswering)_can_record_outputsmapping onGPTNeoPreTrainedModelpointing toGPTNeoBlock(hidden_states) andGPTNeoAttention(attentions)output_attentions,output_hidden_states,return_dictparameter handling and collection loopsGPTNeoBlocknow returnshidden_statesdirectly instead of(hidden_states, attn_weights)tupleTest plan
tests/models/gpt_neo/)output_attentions=Truestill returns attention weights via hooksoutput_hidden_states=Truestill returns per-layer hidden states via hooksreturn_dict=Falsestill returns tuples via@can_return_tuple🤖 Generated with Claude Code