-
Notifications
You must be signed in to change notification settings - Fork 2
Add cross-attention fusion to cookbook config #28
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
Merged
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
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
for sequence_append, need to add `top_k_experts` param in modalities in config_alignment.yaml
2 fusion strategies: avg=weighted average, cat=sequence_append 2 types of projections: shared= 1 projection for all experts, pep=Per-Expert-Projection, one projection per expert
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.
This PR updates the cookbook to reflect the new cross-attention fusion pipeline and routing configuration for the MoE experts.
fusion_method: cross_attn) as the fusion strategy in the multimodal cookbook.generalist_idxfor expert routing in the MoE vision encoder.image_modality_moe_pep.pyDetails
Base LLM & model
base_llm: meta-llama/Llama-3.1-8B-Instructbase_model for end2end: /capstor/store/cscs/swissai/a127/homes/meditron/models/multimeditron/freeze/attn_pep/MultiMeditron-8B-attn-pep-alignment/checkpoint-...resume_from_checkpoint: trueMoE vision stack
fusion_method: cross_attnformoe_meditron_clip_pepAdded
generalist_idx: -1to allow selection of generalist expert (by default put at the end of the list)Kept existing experts:
ClosedMeditron/MedExpert-CTClosedMeditron/MedExpert-MRIClosedMeditron/MedExpert-UltrasoundClosedMeditron/MedExpert-XrayClosedMeditron/clip-vit-base-patch32Training / cookbook updates
output_dirandrun_nameaccordingly (e.gMultiMeditron-8B-attn-pep-end2end)tokenizer_type: llama,max_sequence_length: 4096,truncation: true).