Commit 7554afb
Fix mutable default in Megatron init and IndexError on empty ModuleList (#3944)
* Fix mutable default argument in Megatron init and IndexError on empty ModuleList
In megatron_lm.py, initialize() used args_defaults={} as a default
parameter, which is shared across calls and can cause unexpected
state persistence.
In other.py, is_repeated_block() accessed module[0] without checking
if the ModuleList was empty, causing IndexError for empty ModuleLists.
* Apply style fixes
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>1 parent 23f2ab3 commit 7554afb
2 files changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
876 | | - | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
877 | 879 | | |
878 | 880 | | |
879 | 881 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
| |||
0 commit comments