Winner-seed persistence shifts a reloaded multi-restart refit's seed range

Open
#307 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python, pytorch

Research direction

Start in torch_impl/core.py at state_dict(), config["seed"], and the restart loop; locate the corresponding AMICAMLXNG implementation as well. Run the existing round-trip tests, then add a multi-restart refit case with restart_seeds=None and verify that from_state_dict(...) reproduces the original seed range and search in both backends.

Written by the indexing model from the issue text.

Description

From the PR #305 review (epic #278 Phase 1); the pattern is identical in AMICATorchNG (torch_impl/core.py state_dict, config["seed"]) and AMICAMLXNG, so this is a shared-backend issue.

Under n_restarts > 1 with restart_seeds=None, seeds are derived as seed, seed+1, ..., seed+N-1 and the restart loop leaves self.seed on the WINNING restart's seed. state_dict() persists that winner as config["seed"], so from_state_dict(...) followed by a re-fit() derives a shifted seed range (winner, winner+1, ...) instead of the original search -- contradicting the adjacent comment's claim that a reloaded model "reconstructs its exact configuration" and "re-runs the same search". Fitted parameters, transform output and accessors are unaffected (bit-identical round trips); only the reproducibility of a subsequent refit on a reloaded multi-restart model is wrong.

Candidate fix: persist the original constructor seed separately from the winner's (e.g. keep config["seed"] as the master seed and record the winner in extra), in both backends in one PR, with a round-trip-plus-refit test using implicit seeds.

Dominant language
Python
Stars
8
Forks
3
Avg merge
5h 37m
Merged PRs (30d)
36

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sccn/pAMICA

All issues in sccn/pAMICA

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.