MiniMax-AI / MiniMax-AI/MiniMax-H3
Question: Can modality row selection be moved before the output projections?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9k
- Forks
- 643
- PR merge metrics
- No merged PRs in 30d
Description
Question
In MiniMaxH3Transformer3DModel.forward, the output heads are currently applied to the entire packed sequence before selecting the video and audio rows:
hidden_states = self.norm_out(hidden_states, temb, timestep_indices)
video_output = self.proj_out(hidden_states).index_select(1, video_indices)
audio_output = self.audio_proj_out(hidden_states).index_select(1, audio_indices)
Since both output projections operate independently on the last feature dimension, would the following be mathematically equivalent?
hidden_states = self.norm_out(hidden_states, temb, timestep_indices)
video_hidden_states = hidden_states.index_select(1, video_indices)
audio_hidden_states = hidden_states.index_select(1, audio_indices)
video_output = self.proj_out(video_hidden_states)
audio_output = self.audio_proj_out(audio_hidden_states)
In other words:
index_select(Linear(H), I) = Linear(index_select(H, I))
This would avoid applying proj_out and audio_proj_out to rows that are not needed by the corresponding output head.
Is there any reason why the current order is required, such as:
- context-parallel output gathering;
- global versus local sequence indices;
- distributed inference constraints;
- numerical or checkpoint compatibility;
- or the need to preserve predictions for all reference rows?
I would appreciate any clarification about whether selecting the rows before the modality-specific output projections is a valid optimization.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at MiniMaxH3Transformer3DModel.forward and trace how norm_out, proj_out, audio_proj_out, video_indices, and audio_indices interact with context-parallel output gathering. Check whether indices are local or global and whether distributed inference or reference-row predictions depend on the current order; done means establishing the optimization's validity and documenting any constraints.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems, machine-learning
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 42/100