Skip to content

[Orbit] Add PeriodicAction utility - #13596

Open
LINYV0719 wants to merge 1 commit into
tensorflow:masterfrom
LINYV0719:feat/periodic-action
Open

[Orbit] Add PeriodicAction utility#13596
LINYV0719 wants to merge 1 commit into
tensorflow:masterfrom
LINYV0719:feat/periodic-action

Conversation

@LINYV0719

Copy link
Copy Markdown

Description

This PR adds a new utility class PeriodicAction to orbit/actions.

Motivation:
Currently, actions in Orbit are typically executed every time the Controller loop completes (steps_per_loop). Users often need to execute certain actions at a different, less frequent interval without changing the steps_per_loop setting which might affect preemption granularity

Changes:

  • Added PeriodicAction class which wraps any callable Action
  • It checks global_step % interval == 0 to decide whether to execute the wrapped action
  • Added orbit/actions/periodic_action_test.py to verify the execution

actions/init Changes:

  • Exported PeriodicAction in orbit/actions/__init__.py for easier access

Type of change

  • New feature

Tests

I added a new test suite orbit.actions.periodic_action_test to verify the logic.

Test Configuration:

  • OS: Windows 11
  • Python Version: 3.10
  • Command: python -m orbit.actions.periodic_action_test
  • Result: Passed (OK). Verified that the action is triggered exactly when global_step matches the interval.

Checklist

@LINYV0719
LINYV0719 requested a review from a team as a code owner December 30, 2025 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant