Skip to content

Refactor trainer rank package API#777

Merged
bradhilton merged 2 commits into
mainfrom
agent/refactor-trainer-rank-package
Jul 25, 2026
Merged

Refactor trainer rank package API#777
bradhilton merged 2 commits into
mainfrom
agent/refactor-trainer-rank-package

Conversation

@bradhilton

Copy link
Copy Markdown
Collaborator

Summary

  • make art.trainer_rank.__init__ a readable public API facade and move implementation details into _impl.py
  • preserve the existing TrainerRank surface while exporting AdapterSelection, Unset, and typed optimizer state/layout schemas
  • replace avoidable Any usage with concrete adapter, autograd, distributed, and forward-path types
  • update focused tests to use private implementation imports only where appropriate

Why

art.trainer_rank had its complete implementation and public API interleaved in a single large __init__.py. Separating the implementation makes the supported surface easier to understand and review while retaining canonical public module paths.

Validation

  • uv run ruff format --check .
  • uv run ruff check .
  • uv run ty check src/art/trainer_rank tests/unit/test_trainer_rank_validation.py tests/unit/test_trainer_rank_weird_shapes.py
  • TrainerRank unit tests: 68 passed, 4 skipped

@bradhilton
bradhilton marked this pull request as ready for review July 25, 2026 20:05
@bradhilton
bradhilton merged commit 3bdbf22 into main Jul 25, 2026
8 checks passed
@bradhilton
bradhilton deleted the agent/refactor-trainer-rank-package branch July 25, 2026 20:05
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