Skip to content

Verify model supports segment-ids#1632

Open
yatlas20098 wants to merge 2 commits into
mainfrom
yatlas-fix-seg-ids
Open

Verify model supports segment-ids#1632
yatlas20098 wants to merge 2 commits into
mainfrom
yatlas-fix-seg-ids

Conversation

@yatlas20098

Copy link
Copy Markdown
Collaborator
  • I have added all the necessary unit tests for my change.
  • I have verified that my change does not break existing code and all unit tests pass.
  • I have added all appropriate doc-strings/documentation.
  • My PR is based on the latest changes of the main branch (if unsure, rebase the code).
  • I have signed the Contributor License Agreement.
  • I have followed Contribution Guidelines.

Comment thread tunix/rl/common.py Outdated
segment_positions,
)

try:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

worth to move it out as a helper function and cache it? so it's not part of the core logic.

e.g.

@functools.cache
def call_contains(model, target_arg):
  ...

@yatlas20098 yatlas20098 Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've implemented caching but key'd it based on the model type instead of the model instance. Since nnx.merge constructs the model instance during each computation step, caching the model instance directly would result in zero hits.

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