-
Notifications
You must be signed in to change notification settings - Fork 36
Move from an epoch-based optimization to a step-based optimization #442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nto jp_20250826_stepopt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves the training from an epoch-based formulation to a step-based formulation. The advantage is that very long trainings can be continued directly where they left off, as soon as they finish, rather than having to restart at the epoch boundary.
Technically, this is done by keeping track of the dataset and sampler state across multiple workers.
As validation, I trained a model (light blue) for a very long time (500k steps, ~20 days) on 8x AMD MI200X cards. It can be compared to the previous model freeze at #437 or https://huggingface.co/jpata/particleflow/tree/main/cms/v2.6.0pre1/pyg-cms_20250722_101813_274478 (dark blue). The
cms_pf_qcd_nopudataset size was also increased in this run from 5M events to 20M events. Overall, this corresponds to about 10 epochs over the full set of concatenated data, but the epochs between these two runs are not exactly the same. We see that the jet resolution metric (IQR) and the jet reco-gen matching fraction metric keep improving throughout the training.The training loss is stable across ~20x 24-hour restarts. The regression loss fluctuates somewhat, and potentially a more stable solution could be better for optimization.

The validation loss is computed over a subset of the data (to avoid wasting a lot of time not training) at a regular interval and shows convergence.
