Commit bb308da
authored
fix set_determinism on single gpu (#1983)
**Summary**
Currently, running
`CONFIG_FILE="./torchtitan/models/llama3/train_configs/debug_model.toml"
NGPU=1 CUDA_VISIBLE_DEVICES=0 ./run_train.sh` returns
```
dim for dim in distinct_seed_mesh_dims if dim in world_mesh.mesh_dim_names
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable
```
This PR fixes the case for a single GPU or when
world_mesh.mesh_dim_names is None
**Testing**
Added unit test to `tests/unit_tests/test_set_determinism.py`1 parent 8659543 commit bb308da
File tree
2 files changed
+24
-1
lines changed- tests/unit_tests
- torchtitan/distributed
2 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
211 | 232 | | |
212 | 233 | | |
213 | 234 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
149 | 151 | | |
150 | 152 | | |
151 | 153 | | |
| |||
0 commit comments