Skip to content

Add optional sinusoidal history position encoding - #18

Merged
KunYing-Lee merged 1 commit into
mainfrom
agent/history-sinusoidal-position-encoding
Aug 10, 2026
Merged

Add optional sinusoidal history position encoding#18
KunYing-Lee merged 1 commit into
mainfrom
agent/history-sinusoidal-position-encoding

Conversation

@KunYing-Lee

@KunYing-Lee KunYing-Lee commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add fixed sinusoidal positional encoding for history motion frames
  • make sinusoidal history encoding the default in every exp/* preset while keeping the global model default as none for backward compatibility
  • align every experiment preset with the validated four-A100 training protocol:
    • four-GPU trainer
    • materialized omnimodal data
    • diffusion-only objective
    • audio and human-motion conditioning enabled
    • self- and cross-attention Q/K normalization enabled
    • 180k-step cosine schedule with a 2k-step warmup
    • train dataloader workers/prefetch set to 2/2
  • retain scale-specific micro-batches and gradient accumulation so larger presets fit GPU memory:
    • base/50M/100M: 192 × 1
    • 300M: 128 × 1
    • 500M: 64 × 3
    • 1B: 32 × 6
  • remove the redundant 100m_omnimodal preset; 100m now provides the same omnimodal protocol
  • record the history-position setting in the checkpoint architecture contract (v2), while continuing to accept v1 checkpoints
  • add regression coverage for all experiment presets and checkpoint compatibility

This PR makes no performance claim; it makes the validated architecture and training protocol explicit and reproducible.

Validation

  • all six Hydra experiment presets composed and checked against the shared protocol
  • generation test suite: 117 passed
  • git diff --check passed

@KunYing-Lee
KunYing-Lee force-pushed the agent/history-sinusoidal-position-encoding branch 3 times, most recently from 6333f31 to 9731633 Compare August 10, 2026 18:04
@KunYing-Lee
KunYing-Lee force-pushed the agent/history-sinusoidal-position-encoding branch from 9731633 to 70e1d00 Compare August 10, 2026 18:06
@KunYing-Lee
KunYing-Lee marked this pull request as ready for review August 10, 2026 18:07
Copilot AI lite review requested due to automatic review settings August 10, 2026 18:07
@KunYing-Lee
KunYing-Lee merged commit 87a3434 into main Aug 10, 2026
@KunYing-Lee
KunYing-Lee deleted the agent/history-sinusoidal-position-encoding branch August 10, 2026 18:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional fixed sinusoidal positional encoding for history tokens in the motion generation model, propagates it through experiment presets, and records it in the checkpoint architecture contract while maintaining legacy contract compatibility.

Changes:

  • Introduce SinusoidalPositionEncoding and an optional history_pos_encoding path in MotionGenerator history conditioning.
  • Bump checkpoint architecture contract to v2, adding history_pos_encoding recording + validation while continuing to accept v1.
  • Align all configs/generation/exp/* presets to the shared omnimodal + 4-GPU training protocol and update tests/docs accordingly (including removing 100m_omnimodal).

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/generation/test_train_config.py Adds regression test asserting all exp presets share the same omnimodal + sinusoidal protocol settings.
tests/generation/test_hydra_compose.py Updates Hydra compose coverage to use exp=100m instead of removed 100m_omnimodal.
tests/generation/test_guided_conditions.py Adds unit tests for sinusoidal history encoding behavior and validation.
tests/generation/test_checkpoint_architecture.py Adds tests for recording/validating history_pos_encoding and v1/v2 compatibility behavior.
src/omg/generation/models/motion_generator.py Adds history_pos_encoding option and applies sinusoidal encoding to history tokens when enabled.
src/omg/generation/conditions/position.py Introduces fixed sinusoidal position encoding module.
src/omg/generation/architecture.py Bumps architecture contract to v2, supports v1/v2, and validates history_pos_encoding.
README.md Updates CLI example to use --exp 100m.
docs/generation.md Updates export example to use --exp 100m.
configs/generation/model/motion_generator.yaml Adds history_pos_encoding: none to global model config for explicit default behavior.
configs/generation/exp/base.yaml Switches base preset to the shared validated protocol (incl. history_pos_encoding: sinusoidal).
configs/generation/exp/50m.yaml Aligns 50m preset with shared protocol and enables sinusoidal history encoding.
configs/generation/exp/100m.yaml Aligns 100m preset with shared protocol and enables sinusoidal history encoding.
configs/generation/exp/300m.yaml Aligns 300m preset with shared protocol and enables sinusoidal history encoding.
configs/generation/exp/500m.yaml Aligns 500m preset with shared protocol and enables sinusoidal history encoding.
configs/generation/exp/1b.yaml Aligns 1b preset with shared protocol and enables sinusoidal history encoding.
configs/generation/exp/100m_omnimodal.yaml Removes redundant preset in favor of the updated 100m preset.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 44 to 48
text_mask_prob: float = 0.1,
history_mask_prob: float = 0.1,
history_pos_encoding: str = "none",
use_audio: bool = False,
audio_dim: int = 35,
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.

2 participants