Skip to content

feat: prefetch assets#44

Merged
Neonkraft merged 3 commits into
mainfrom
feat/prefetch-assets
Jul 3, 2026
Merged

feat: prefetch assets#44
Neonkraft merged 3 commits into
mainfrom
feat/prefetch-assets

Conversation

@Neonkraft

Copy link
Copy Markdown
Collaborator

Summary

Adds a prefetch_assets: bool = True field to PostTrainingConfig (src/post_training/config.py) and updates scripts/submit.py so the login-node prefetch step (HF cache env application + prefetch_assets(config)) runs whenever config.offline or config.prefetch_assets is true. Previously prefetching only ran under offline: true; it's now on by default independent of offline mode, with an opt-out via prefetch_assets: false.

Type of change

  • Bug fix
  • New feature
  • Refactor
  • Performance
  • Documentation
  • Maintenance

Validation

Describe how this change was verified.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new top-level configuration flag to control whether models/datasets are pre-fetched on the login node before SLURM submission, and updates the submission script + documentation so prefetching can run independently of offline mode (enabled by default, with opt-out).

Changes:

  • Add prefetch_assets: bool = True to PostTrainingConfig.
  • Update scripts/submit.py so the prefetch step runs when offline or prefetch_assets is true.
  • Document the new prefetch_assets flag and add it to the example config in README.md.

Reviewed changes

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

File Description
src/post_training/config.py Adds prefetch_assets flag (default True) to the root config schema.
scripts/submit.py Runs login-node prefetch when offline or prefetch_assets is enabled.
README.md Documents prefetch behavior and adds prefetch_assets to the sample config.
Comments suppressed due to low confidence (1)

scripts/submit.py:122

  • The prefetch log message is now misleading: this block runs when either offline or prefetch_assets is true, but it always logs offline=True. This will confuse users who have offline: false and are only using prefetching.
        logger.info(
            "offline=True: pre-fetching models and datasets on the login node "
            "before submitting the job."
        )

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Neonkraft Neonkraft merged commit b051f02 into main Jul 3, 2026
2 checks 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.

2 participants