Skip to content

Rename pretext to pretrain - #14

Merged
sevmag merged 2 commits into
mainfrom
rename-pretext-to-pretrain
Aug 15, 2026
Merged

Rename pretext to pretrain#14
sevmag merged 2 commits into
mainfrom
rename-pretext-to-pretrain

Conversation

@sevmag

@sevmag sevmag commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Renames the pretext package and its identifiers so the naming matches how the
code is used.

  • src/spine/pretext/ -> src/spine/pretrain/, so module paths and the config
    _target_ strings become spine.pretrain.*
  • PretextTask -> PretrainTask, PretextDataset -> PretrainDataset, and the
    surrounding prose in docstrings, README and DESIGN

Existing checkpoints still load

Every TransferCheckpoint stores its task target as the string
spine.pretext.curtain.task.CurtainTask. Nothing re-instantiates that string --
only backbone._target_ is read, for backbone detection -- so encoders trained
before this change keep loading unchanged. Verified against the current
IceCube encoders.

Breaking change for downstream branches

This changes the public API. dev/unstable, gpt-domid and graphnet-split
all import PretextTask / spine.pretext.* and will need the same rename
applied when they merge or rebase. dev/unstable additionally carries modules
that do not exist here (spine/pretext/mpm/), so it is cleaner to re-apply the
rename there than to merge a diverged package tree.

Verification

Imported on a compute node against the project env: spine.pretrain.base,
spine.pretrain.curtain.task, spine.pretrain.curtain.objectives,
spine.data.datamodule, spine.train, spine.ssl_module all resolve, and no
occurrence of "pretext" remains anywhere in the repo.

🤖 Generated with Claude Code

sevmag and others added 2 commits August 15, 2026 14:40
The directory now matches what it is used for; module paths become
spine.pretrain.*, including the config _target_ strings.

Existing TransferCheckpoints store the old spine.pretext.* target as a
string but never re-instantiate it (only backbone._target_ is read, for
backbone detection), so previously trained encoders keep loading.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Follows the package move: PretextTask -> PretrainTask, PretextDataset ->
PretrainDataset, and the surrounding prose. This is a public API change --
downstream code importing PretextTask must be updated with it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sevmag
sevmag merged commit ee37270 into main Aug 15, 2026
1 check passed
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