Skip to content

Merging implementations, adding logging#29

Open
AaravG42 wants to merge 5 commits intofacebookresearch:mainfrom
Planning-for-WMs:token-pooling
Open

Merging implementations, adding logging#29
AaravG42 wants to merge 5 commits intofacebookresearch:mainfrom
Planning-for-WMs:token-pooling

Conversation

@AaravG42
Copy link
Copy Markdown

This pull request introduces several significant improvements to the codebase, primarily focusing on adding support for Token Merging (ToMe) in the AdaLN Vision Transformer model, enhancing dataset utility functions, and improving experiment management and reproducibility. The changes include new ToMe functionality for efficient token processing, updates to dataset loading for precomputed features, and improved handling of experiment directories and run metadata.

Model architecture and efficiency improvements:

  • Added Token Merging (ToMe) support to AdaLN_vit.py, including new arguments (tome_r, tome_mode) and logic for bipartite soft matching, token merging/unmerging, and efficient attention/MLP processing. This enables more efficient and flexible handling of long token sequences in transformer blocks. [1] [2] [3] [4] [5]

Dataset utilities and loading enhancements:

  • Updated app/plan_common/datasets/utils.py to support loading of precomputed encoder feature datasets via the new load_precomputed_slice_train_val function, including argument handling and error checking for required paths. [1] [2]
  • Added missing import of os to app/plan_common/datasets/utils.py to support environment variable expansion.

Experiment management and reproducibility:

  • Improved experiment directory and run metadata management in app/main.py by generating unique run IDs, creating run directories, saving resolved configs and metadata, and creating symlinks to latest runs. This ensures better tracking and reproducibility of experiments. [1] [2]
  • Updated .env.template to document required environment variables for logs, datasets, and checkpoints, improving onboarding and reproducibility.

Training script updates:

  • Modified app/vjepa_wm/train.py to use new run_dir and run_id parameters for log and checkpoint file management, ensuring outputs are saved in the correct experiment-specific directories. [1] [2]## Describe your changes

Does this PR touch common code? [ ] YES [ ] NO

Test Plan (optional if not touching common code)

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Apr 22, 2026

Hi @AaravG42!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant