mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-07-16 23:24:55 -05:00
[PR #1939] [MERGED] fix(mlperf-edu): NameError masks real model-load failure in auto_trainer #34663
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/harvard-edge/cs249r_book/pull/1939
Author: @Shashank-Tripathi-07
Created: 7/7/2026
Status: ✅ Merged
Merged: 7/10/2026
Merged by: @profvjreddi
Base:
dev← Head:fix/auto-trainer-load-failure-nameerror📝 Commits (1)
eb0145dfix(mlperf-edu): NameError masks real model-load failure in auto_trainer📊 Changes
1 file changed (+5 additions, -0 deletions)
View changed files
📝
mlperf-edu/scripts/orchestration/auto_trainer.py(+5 -0)📄 Description
Summary
_load_model()raised on the very first NAS attempt (nas_attempt=0), theexceptblock printed the error andbreakd out of the outerwhileloop beforemodelwas ever bound.torch.save(model.state_dict(), save_path), raisingNameError: name 'model' is not definedand hiding the real load failure behind an unrelated crash.Fix
Initialize
model = Nonebefore the loop and check it after, returning early with a clear log message instead of crashing if the model never loaded successfully.Test plan
model.state_dict()after a load failure; with the fix, it logsAborting: model never loaded successfully, nothing to save.and returns cleanly.python -m py_compilepasses on the edited file.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.