Upload folder using huggingface_hub
Browse files- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/mp_rank_00_model_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/latest +1 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/zero_to_fp32.py +790 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/mp_rank_00_model_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/latest +1 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/zero_to_fp32.py +790 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/train.log +347 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/mp_rank_00_model_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/latest +1 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/zero_to_fp32.py +790 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/mp_rank_00_model_states.pt +3 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/latest +1 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/zero_to_fp32.py +790 -0
- joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/train.log +357 -0
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96540243aac93e49d9c00162b2a11b42054f5bd6d95581b5558ea5ae36ff4bbe
|
| 3 |
+
size 8066685992
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b003abd0da50c8a043127ea184f2e8e11e4bc6f9eb2e076ea7f71e955ff9f6dd
|
| 3 |
+
size 8066667688
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cc902074bedffc31bf7a124e736dd5e77842ae8c9e58dfb4f152cd7288ffff1e
|
| 3 |
+
size 8066672104
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:252b17a3fbab10314af735d95975050e55739e798adb1a32b02466bd7796ae6c
|
| 3 |
+
size 8066671208
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/mp_rank_00_model_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5302cf91a0d0a7763e31dd84e9e5261faf772cc1c15ce4051ce80b60664e8a38
|
| 3 |
+
size 5378167768
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/latest
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
global_step50000
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000/zero_to_fp32.py
ADDED
|
@@ -0,0 +1,790 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
|
| 3 |
+
# Copyright (c) Microsoft Corporation.
|
| 4 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 5 |
+
|
| 6 |
+
# DeepSpeed Team
|
| 7 |
+
|
| 8 |
+
# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
|
| 9 |
+
# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
|
| 10 |
+
# the future. Once extracted, the weights don't require DeepSpeed and can be used in any
|
| 11 |
+
# application.
|
| 12 |
+
#
|
| 13 |
+
# example:
|
| 14 |
+
# python zero_to_fp32.py . output_dir/
|
| 15 |
+
# or
|
| 16 |
+
# python zero_to_fp32.py . output_dir/ --safe_serialization
|
| 17 |
+
|
| 18 |
+
import argparse
|
| 19 |
+
import torch
|
| 20 |
+
import glob
|
| 21 |
+
import math
|
| 22 |
+
import os
|
| 23 |
+
import re
|
| 24 |
+
import gc
|
| 25 |
+
import json
|
| 26 |
+
import numpy as np
|
| 27 |
+
from tqdm import tqdm
|
| 28 |
+
from collections import OrderedDict
|
| 29 |
+
from dataclasses import dataclass
|
| 30 |
+
|
| 31 |
+
# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
|
| 32 |
+
# DeepSpeed data structures it has to be available in the current python environment.
|
| 33 |
+
from deepspeed.utils import logger
|
| 34 |
+
from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
|
| 35 |
+
FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
|
| 36 |
+
FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS, AUTOEP_LAYERS_KEY,
|
| 37 |
+
AUTOEP_LAYERS_KEY_LEGACY, AUTOEP_ZERO3_EXPERT_STATE_FORMAT_KEY,
|
| 38 |
+
AUTOEP_ZERO3_PARTITIONED_EXPERT_STATE_FORMAT)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
@dataclass
|
| 42 |
+
class zero_model_state:
|
| 43 |
+
buffers: dict()
|
| 44 |
+
param_shapes: dict()
|
| 45 |
+
shared_params: list
|
| 46 |
+
ds_version: int
|
| 47 |
+
frozen_param_shapes: dict()
|
| 48 |
+
frozen_param_fragments: dict()
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
debug = 0
|
| 52 |
+
|
| 53 |
+
# load to cpu
|
| 54 |
+
device = torch.device('cpu')
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def atoi(text):
|
| 58 |
+
return int(text) if text.isdigit() else text
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def natural_keys(text):
|
| 62 |
+
'''
|
| 63 |
+
alist.sort(key=natural_keys) sorts in human order
|
| 64 |
+
http://nedbatchelder.com/blog/200712/human_sorting.html
|
| 65 |
+
(See Toothy's implementation in the comments)
|
| 66 |
+
'''
|
| 67 |
+
return [atoi(c) for c in re.split(r'(\d+)', text)]
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def get_model_state_file(checkpoint_dir, zero_stage):
|
| 71 |
+
if not os.path.isdir(checkpoint_dir):
|
| 72 |
+
raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
|
| 73 |
+
|
| 74 |
+
# there should be only one file
|
| 75 |
+
if zero_stage <= 2:
|
| 76 |
+
file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
|
| 77 |
+
elif zero_stage == 3:
|
| 78 |
+
file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
|
| 79 |
+
|
| 80 |
+
if not os.path.exists(file):
|
| 81 |
+
raise FileNotFoundError(f"can't find model states file at '{file}'")
|
| 82 |
+
|
| 83 |
+
return file
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def get_checkpoint_files(checkpoint_dir, glob_pattern):
|
| 87 |
+
# XXX: need to test that this simple glob rule works for multi-node setup too
|
| 88 |
+
ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
|
| 89 |
+
|
| 90 |
+
if len(ckpt_files) == 0:
|
| 91 |
+
raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
|
| 92 |
+
|
| 93 |
+
return ckpt_files
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def get_optim_files(checkpoint_dir):
|
| 97 |
+
return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
def get_model_state_files(checkpoint_dir):
|
| 101 |
+
return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def _has_autoep_zero3_partitioned_metadata(state_dict):
|
| 105 |
+
autoep_layers = state_dict.get(AUTOEP_LAYERS_KEY)
|
| 106 |
+
if autoep_layers is None:
|
| 107 |
+
autoep_layers = state_dict.get(AUTOEP_LAYERS_KEY_LEGACY)
|
| 108 |
+
if not isinstance(autoep_layers, list):
|
| 109 |
+
return False
|
| 110 |
+
return any(
|
| 111 |
+
isinstance(entry, dict)
|
| 112 |
+
and entry.get(AUTOEP_ZERO3_EXPERT_STATE_FORMAT_KEY) == AUTOEP_ZERO3_PARTITIONED_EXPERT_STATE_FORMAT
|
| 113 |
+
for entry in autoep_layers)
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
def _raise_if_autoep_zero3_partitioned_state(state_dict):
|
| 117 |
+
if _has_autoep_zero3_partitioned_metadata(state_dict):
|
| 118 |
+
raise NotImplementedError("zero_to_fp32 does not support AutoEP ZeRO-3 partition-native checkpoints. "
|
| 119 |
+
"AutoEP expert parameters are partitioned over expert replica groups, so "
|
| 120 |
+
"global data-parallel consolidation would produce incomplete expert tensors. "
|
| 121 |
+
"Use ds_to_universal.py for expert-aware conversion.")
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
def _raise_if_autoep_zero3_partitioned_checkpoint(model_files):
|
| 125 |
+
for file in model_files:
|
| 126 |
+
state_dict = torch.load(file, map_location=device, weights_only=False)
|
| 127 |
+
_raise_if_autoep_zero3_partitioned_state(state_dict)
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
def parse_model_states(files):
|
| 131 |
+
zero_model_states = []
|
| 132 |
+
for file in files:
|
| 133 |
+
state_dict = torch.load(file, map_location=device, weights_only=False)
|
| 134 |
+
_raise_if_autoep_zero3_partitioned_state(state_dict)
|
| 135 |
+
|
| 136 |
+
if BUFFER_NAMES not in state_dict:
|
| 137 |
+
raise ValueError(f"{file} is not a model state checkpoint")
|
| 138 |
+
buffer_names = state_dict[BUFFER_NAMES]
|
| 139 |
+
if debug:
|
| 140 |
+
print("Found buffers:", buffer_names)
|
| 141 |
+
|
| 142 |
+
# recover just the buffers while restoring them to fp32 if they were saved in fp16
|
| 143 |
+
buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
|
| 144 |
+
param_shapes = state_dict[PARAM_SHAPES]
|
| 145 |
+
|
| 146 |
+
# collect parameters that are included in param_shapes
|
| 147 |
+
param_names = []
|
| 148 |
+
for s in param_shapes:
|
| 149 |
+
for name in s.keys():
|
| 150 |
+
param_names.append(name)
|
| 151 |
+
|
| 152 |
+
# update with frozen parameters
|
| 153 |
+
frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
|
| 154 |
+
if frozen_param_shapes is not None:
|
| 155 |
+
if debug:
|
| 156 |
+
print(f"Found frozen_param_shapes: {frozen_param_shapes}")
|
| 157 |
+
param_names += list(frozen_param_shapes.keys())
|
| 158 |
+
|
| 159 |
+
# handle shared params
|
| 160 |
+
shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
|
| 161 |
+
|
| 162 |
+
ds_version = state_dict.get(DS_VERSION, None)
|
| 163 |
+
|
| 164 |
+
frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
|
| 165 |
+
|
| 166 |
+
z_model_state = zero_model_state(buffers=buffers,
|
| 167 |
+
param_shapes=param_shapes,
|
| 168 |
+
shared_params=shared_params,
|
| 169 |
+
ds_version=ds_version,
|
| 170 |
+
frozen_param_shapes=frozen_param_shapes,
|
| 171 |
+
frozen_param_fragments=frozen_param_fragments)
|
| 172 |
+
zero_model_states.append(z_model_state)
|
| 173 |
+
|
| 174 |
+
return zero_model_states
|
| 175 |
+
|
| 176 |
+
|
| 177 |
+
def parse_optim_states(files, ds_checkpoint_dir):
|
| 178 |
+
total_files = len(files)
|
| 179 |
+
state_dicts = []
|
| 180 |
+
for f in tqdm(files, desc='Loading checkpoint shards'):
|
| 181 |
+
state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False)
|
| 182 |
+
# immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
|
| 183 |
+
# and also handle the case where it was already removed by another helper script
|
| 184 |
+
state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
|
| 185 |
+
state_dicts.append(state_dict)
|
| 186 |
+
|
| 187 |
+
if ZERO_STAGE not in state_dicts[0][OPTIMIZER_STATE_DICT]:
|
| 188 |
+
raise ValueError(f"{files[0]} is not a zero checkpoint")
|
| 189 |
+
zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
|
| 190 |
+
world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
|
| 191 |
+
|
| 192 |
+
# For ZeRO-2 each param group can have different partition_count as data parallelism for expert
|
| 193 |
+
# parameters can be different from data parallelism for non-expert parameters. So we can just
|
| 194 |
+
# use the max of the partition_count to get the dp world_size.
|
| 195 |
+
|
| 196 |
+
if type(world_size) is list:
|
| 197 |
+
world_size = max(world_size)
|
| 198 |
+
|
| 199 |
+
if world_size != total_files:
|
| 200 |
+
raise ValueError(
|
| 201 |
+
f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
|
| 202 |
+
"Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
|
| 203 |
+
)
|
| 204 |
+
|
| 205 |
+
# the groups are named differently in each stage
|
| 206 |
+
if zero_stage <= 2:
|
| 207 |
+
fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
|
| 208 |
+
elif zero_stage == 3:
|
| 209 |
+
fp32_groups_key = FP32_FLAT_GROUPS
|
| 210 |
+
else:
|
| 211 |
+
raise ValueError(f"unknown zero stage {zero_stage}")
|
| 212 |
+
|
| 213 |
+
fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
|
| 214 |
+
return zero_stage, world_size, fp32_flat_groups
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
|
| 218 |
+
"""
|
| 219 |
+
Returns fp32 state_dict reconstructed from ds checkpoint
|
| 220 |
+
|
| 221 |
+
Args:
|
| 222 |
+
- ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
|
| 223 |
+
|
| 224 |
+
"""
|
| 225 |
+
print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
|
| 226 |
+
|
| 227 |
+
# parse_model_states rejects AutoEP ZeRO-3 partition-native checkpoints
|
| 228 |
+
# before the expensive optimizer-shard load below.
|
| 229 |
+
model_files = get_model_state_files(ds_checkpoint_dir)
|
| 230 |
+
zero_model_states = parse_model_states(model_files)
|
| 231 |
+
print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
|
| 232 |
+
|
| 233 |
+
optim_files = get_optim_files(ds_checkpoint_dir)
|
| 234 |
+
zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
|
| 235 |
+
print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
|
| 236 |
+
|
| 237 |
+
if zero_stage <= 2:
|
| 238 |
+
return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 239 |
+
exclude_frozen_parameters)
|
| 240 |
+
elif zero_stage == 3:
|
| 241 |
+
return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 242 |
+
exclude_frozen_parameters)
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
def _zero2_merge_frozen_params(state_dict, zero_model_states):
|
| 246 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
| 247 |
+
return
|
| 248 |
+
|
| 249 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
| 250 |
+
frozen_param_fragments = zero_model_states[0].frozen_param_fragments
|
| 251 |
+
|
| 252 |
+
if debug:
|
| 253 |
+
num_elem = sum(s.numel() for s in frozen_param_shapes.values())
|
| 254 |
+
print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
| 255 |
+
|
| 256 |
+
wanted_params = len(frozen_param_shapes)
|
| 257 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
| 258 |
+
avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
|
| 259 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
| 260 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
| 261 |
+
|
| 262 |
+
total_params = 0
|
| 263 |
+
total_numel = 0
|
| 264 |
+
for name, shape in frozen_param_shapes.items():
|
| 265 |
+
total_params += 1
|
| 266 |
+
unpartitioned_numel = shape.numel()
|
| 267 |
+
total_numel += unpartitioned_numel
|
| 268 |
+
|
| 269 |
+
state_dict[name] = frozen_param_fragments[name]
|
| 270 |
+
|
| 271 |
+
if debug:
|
| 272 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
| 273 |
+
|
| 274 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
| 275 |
+
|
| 276 |
+
|
| 277 |
+
def _has_callable(obj, fn):
|
| 278 |
+
attr = getattr(obj, fn, None)
|
| 279 |
+
return callable(attr)
|
| 280 |
+
|
| 281 |
+
|
| 282 |
+
def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
| 283 |
+
param_shapes = zero_model_states[0].param_shapes
|
| 284 |
+
|
| 285 |
+
# Reconstruction protocol:
|
| 286 |
+
#
|
| 287 |
+
# XXX: document this
|
| 288 |
+
|
| 289 |
+
if debug:
|
| 290 |
+
for i in range(world_size):
|
| 291 |
+
for j in range(len(fp32_flat_groups[0])):
|
| 292 |
+
print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
|
| 293 |
+
|
| 294 |
+
# XXX: memory usage doubles here (zero2)
|
| 295 |
+
num_param_groups = len(fp32_flat_groups[0])
|
| 296 |
+
merged_single_partition_of_fp32_groups = []
|
| 297 |
+
for i in range(num_param_groups):
|
| 298 |
+
merged_partitions = [sd[i] for sd in fp32_flat_groups]
|
| 299 |
+
full_single_fp32_vector = torch.cat(merged_partitions, 0)
|
| 300 |
+
merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
|
| 301 |
+
avail_numel = sum(
|
| 302 |
+
[full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
|
| 303 |
+
|
| 304 |
+
if debug:
|
| 305 |
+
wanted_params = sum([len(shapes) for shapes in param_shapes])
|
| 306 |
+
wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
|
| 307 |
+
# not asserting if there is a mismatch due to possible padding
|
| 308 |
+
print(f"Have {avail_numel} numels to process.")
|
| 309 |
+
print(f"Need {wanted_numel} numels in {wanted_params} params.")
|
| 310 |
+
|
| 311 |
+
# params
|
| 312 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
| 313 |
+
# out-of-core computing solution
|
| 314 |
+
total_numel = 0
|
| 315 |
+
total_params = 0
|
| 316 |
+
for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
|
| 317 |
+
offset = 0
|
| 318 |
+
avail_numel = full_single_fp32_vector.numel()
|
| 319 |
+
for name, shape in shapes.items():
|
| 320 |
+
|
| 321 |
+
unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
|
| 322 |
+
total_numel += unpartitioned_numel
|
| 323 |
+
total_params += 1
|
| 324 |
+
|
| 325 |
+
if debug:
|
| 326 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
| 327 |
+
state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
|
| 328 |
+
offset += unpartitioned_numel
|
| 329 |
+
|
| 330 |
+
# Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
|
| 331 |
+
# avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
|
| 332 |
+
# paddings performed in the code it's almost impossible to predict the exact numbers w/o the
|
| 333 |
+
# live optimizer object, so we are checking that the numbers are within the right range
|
| 334 |
+
align_to = 2 * world_size
|
| 335 |
+
|
| 336 |
+
def zero2_align(x):
|
| 337 |
+
return align_to * math.ceil(x / align_to)
|
| 338 |
+
|
| 339 |
+
if debug:
|
| 340 |
+
print(f"original offset={offset}, avail_numel={avail_numel}")
|
| 341 |
+
|
| 342 |
+
offset = zero2_align(offset)
|
| 343 |
+
avail_numel = zero2_align(avail_numel)
|
| 344 |
+
|
| 345 |
+
if debug:
|
| 346 |
+
print(f"aligned offset={offset}, avail_numel={avail_numel}")
|
| 347 |
+
|
| 348 |
+
# Sanity check
|
| 349 |
+
if offset != avail_numel:
|
| 350 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
| 351 |
+
|
| 352 |
+
print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
|
| 353 |
+
|
| 354 |
+
|
| 355 |
+
def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 356 |
+
exclude_frozen_parameters):
|
| 357 |
+
state_dict = OrderedDict()
|
| 358 |
+
|
| 359 |
+
# buffers
|
| 360 |
+
buffers = zero_model_states[0].buffers
|
| 361 |
+
state_dict.update(buffers)
|
| 362 |
+
if debug:
|
| 363 |
+
print(f"added {len(buffers)} buffers")
|
| 364 |
+
|
| 365 |
+
if not exclude_frozen_parameters:
|
| 366 |
+
_zero2_merge_frozen_params(state_dict, zero_model_states)
|
| 367 |
+
|
| 368 |
+
_zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
| 369 |
+
|
| 370 |
+
# recover shared parameters
|
| 371 |
+
for pair in zero_model_states[0].shared_params:
|
| 372 |
+
if pair[1] in state_dict:
|
| 373 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
| 374 |
+
|
| 375 |
+
return state_dict
|
| 376 |
+
|
| 377 |
+
|
| 378 |
+
def zero3_partitioned_param_info(unpartitioned_numel, world_size):
|
| 379 |
+
remainder = unpartitioned_numel % world_size
|
| 380 |
+
padding_numel = (world_size - remainder) if remainder else 0
|
| 381 |
+
partitioned_numel = math.ceil(unpartitioned_numel / world_size)
|
| 382 |
+
return partitioned_numel, padding_numel
|
| 383 |
+
|
| 384 |
+
|
| 385 |
+
def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
|
| 386 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
| 387 |
+
return
|
| 388 |
+
|
| 389 |
+
if debug:
|
| 390 |
+
for i in range(world_size):
|
| 391 |
+
num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
|
| 392 |
+
print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
| 393 |
+
|
| 394 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
| 395 |
+
wanted_params = len(frozen_param_shapes)
|
| 396 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
| 397 |
+
avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
|
| 398 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
| 399 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
| 400 |
+
|
| 401 |
+
total_params = 0
|
| 402 |
+
total_numel = 0
|
| 403 |
+
for name, shape in zero_model_states[0].frozen_param_shapes.items():
|
| 404 |
+
total_params += 1
|
| 405 |
+
unpartitioned_numel = shape.numel()
|
| 406 |
+
total_numel += unpartitioned_numel
|
| 407 |
+
|
| 408 |
+
param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
|
| 409 |
+
state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
|
| 410 |
+
|
| 411 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
| 412 |
+
|
| 413 |
+
if debug:
|
| 414 |
+
print(
|
| 415 |
+
f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
| 416 |
+
)
|
| 417 |
+
|
| 418 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
| 419 |
+
|
| 420 |
+
|
| 421 |
+
class GatheredTensor:
|
| 422 |
+
"""
|
| 423 |
+
A pseudo tensor that collects partitioned weights.
|
| 424 |
+
It is more memory efficient when there are multiple groups.
|
| 425 |
+
"""
|
| 426 |
+
|
| 427 |
+
def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape):
|
| 428 |
+
self.flat_groups = flat_groups
|
| 429 |
+
self.flat_groups_offset = flat_groups_offset
|
| 430 |
+
self.offset = offset
|
| 431 |
+
self.partitioned_numel = partitioned_numel
|
| 432 |
+
self.shape = shape
|
| 433 |
+
self.dtype = self.flat_groups[0][0].dtype
|
| 434 |
+
|
| 435 |
+
def contiguous(self):
|
| 436 |
+
"""
|
| 437 |
+
Merge partitioned weights from flat_groups into a single tensor.
|
| 438 |
+
"""
|
| 439 |
+
end_idx = self.offset + self.partitioned_numel
|
| 440 |
+
world_size = len(self.flat_groups)
|
| 441 |
+
pad_flat_param_chunks = []
|
| 442 |
+
|
| 443 |
+
for rank_i in range(world_size):
|
| 444 |
+
# for each rank, we need to collect weights from related group/groups
|
| 445 |
+
flat_groups_at_rank_i = self.flat_groups[rank_i]
|
| 446 |
+
start_group_id = None
|
| 447 |
+
end_group_id = None
|
| 448 |
+
for group_id in range(len(self.flat_groups_offset)):
|
| 449 |
+
if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]:
|
| 450 |
+
start_group_id = group_id
|
| 451 |
+
if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]:
|
| 452 |
+
end_group_id = group_id
|
| 453 |
+
break
|
| 454 |
+
# collect weights from related group/groups
|
| 455 |
+
for group_id in range(start_group_id, end_group_id + 1):
|
| 456 |
+
flat_tensor = flat_groups_at_rank_i[group_id]
|
| 457 |
+
start_offset = self.offset - self.flat_groups_offset[group_id]
|
| 458 |
+
end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id]
|
| 459 |
+
pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset])
|
| 460 |
+
|
| 461 |
+
# collect weights from all ranks
|
| 462 |
+
pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0)
|
| 463 |
+
param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous()
|
| 464 |
+
return param
|
| 465 |
+
|
| 466 |
+
|
| 467 |
+
def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
| 468 |
+
param_shapes = zero_model_states[0].param_shapes
|
| 469 |
+
avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size
|
| 470 |
+
|
| 471 |
+
# Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
|
| 472 |
+
# param, re-consolidating each param, while dealing with padding if any
|
| 473 |
+
|
| 474 |
+
# merge list of dicts, preserving order
|
| 475 |
+
param_shapes = {k: v for d in param_shapes for k, v in d.items()}
|
| 476 |
+
|
| 477 |
+
if debug:
|
| 478 |
+
for i in range(world_size):
|
| 479 |
+
print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
|
| 480 |
+
|
| 481 |
+
wanted_params = len(param_shapes)
|
| 482 |
+
wanted_numel = sum(shape.numel() for shape in param_shapes.values())
|
| 483 |
+
# not asserting if there is a mismatch due to possible padding
|
| 484 |
+
avail_numel = fp32_flat_groups[0].numel() * world_size
|
| 485 |
+
print(f"Trainable params: Have {avail_numel} numels to process.")
|
| 486 |
+
print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
|
| 487 |
+
|
| 488 |
+
# params
|
| 489 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
| 490 |
+
# out-of-core computing solution
|
| 491 |
+
offset = 0
|
| 492 |
+
total_numel = 0
|
| 493 |
+
total_params = 0
|
| 494 |
+
flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]]))
|
| 495 |
+
for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'):
|
| 496 |
+
unpartitioned_numel = shape.numel()
|
| 497 |
+
total_numel += unpartitioned_numel
|
| 498 |
+
total_params += 1
|
| 499 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
| 500 |
+
|
| 501 |
+
if debug:
|
| 502 |
+
print(
|
| 503 |
+
f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
| 504 |
+
)
|
| 505 |
+
|
| 506 |
+
# memory efficient tensor
|
| 507 |
+
tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape)
|
| 508 |
+
state_dict[name] = tensor
|
| 509 |
+
offset += partitioned_numel
|
| 510 |
+
|
| 511 |
+
offset *= world_size
|
| 512 |
+
|
| 513 |
+
# Sanity check
|
| 514 |
+
if offset != avail_numel:
|
| 515 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
| 516 |
+
|
| 517 |
+
print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
|
| 518 |
+
|
| 519 |
+
|
| 520 |
+
def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 521 |
+
exclude_frozen_parameters):
|
| 522 |
+
state_dict = OrderedDict()
|
| 523 |
+
|
| 524 |
+
# buffers
|
| 525 |
+
buffers = zero_model_states[0].buffers
|
| 526 |
+
state_dict.update(buffers)
|
| 527 |
+
if debug:
|
| 528 |
+
print(f"added {len(buffers)} buffers")
|
| 529 |
+
|
| 530 |
+
if not exclude_frozen_parameters:
|
| 531 |
+
_zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
|
| 532 |
+
|
| 533 |
+
_zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
| 534 |
+
|
| 535 |
+
# recover shared parameters
|
| 536 |
+
for pair in zero_model_states[0].shared_params:
|
| 537 |
+
if pair[1] in state_dict:
|
| 538 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
| 539 |
+
|
| 540 |
+
return state_dict
|
| 541 |
+
|
| 542 |
+
|
| 543 |
+
def to_torch_tensor(state_dict, return_empty_tensor=False):
|
| 544 |
+
"""
|
| 545 |
+
Convert state_dict of GatheredTensor to torch tensor
|
| 546 |
+
"""
|
| 547 |
+
torch_state_dict = {}
|
| 548 |
+
converted_tensors = {}
|
| 549 |
+
for name, tensor in state_dict.items():
|
| 550 |
+
tensor_id = id(tensor)
|
| 551 |
+
if tensor_id in converted_tensors: # shared tensors
|
| 552 |
+
shared_tensor = torch_state_dict[converted_tensors[tensor_id]]
|
| 553 |
+
torch_state_dict[name] = shared_tensor
|
| 554 |
+
else:
|
| 555 |
+
converted_tensors[tensor_id] = name
|
| 556 |
+
if return_empty_tensor:
|
| 557 |
+
torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype)
|
| 558 |
+
else:
|
| 559 |
+
torch_state_dict[name] = tensor.contiguous()
|
| 560 |
+
return torch_state_dict
|
| 561 |
+
|
| 562 |
+
|
| 563 |
+
def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
|
| 564 |
+
tag=None,
|
| 565 |
+
exclude_frozen_parameters=False,
|
| 566 |
+
lazy_mode=False):
|
| 567 |
+
"""
|
| 568 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
|
| 569 |
+
``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
|
| 570 |
+
via a model hub.
|
| 571 |
+
|
| 572 |
+
Args:
|
| 573 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder
|
| 574 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
|
| 575 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
| 576 |
+
- ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient.
|
| 577 |
+
Convert the pesduo tensor to torch tensor by ``.contiguous()``
|
| 578 |
+
|
| 579 |
+
Returns:
|
| 580 |
+
- pytorch ``state_dict``
|
| 581 |
+
|
| 582 |
+
A typical usage might be ::
|
| 583 |
+
|
| 584 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
| 585 |
+
# do the training and checkpoint saving
|
| 586 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
|
| 587 |
+
model = model.cpu() # move to cpu
|
| 588 |
+
model.load_state_dict(state_dict)
|
| 589 |
+
# submit to model hub or save the model to share with others
|
| 590 |
+
|
| 591 |
+
In this example the ``model`` will no longer be usable in the deepspeed context of the same
|
| 592 |
+
application. i.e. you will need to re-initialize the deepspeed engine, since
|
| 593 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
| 594 |
+
|
| 595 |
+
If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
|
| 596 |
+
|
| 597 |
+
Note: the above usage may not work if your application doesn't have sufficient free CPU memory.
|
| 598 |
+
You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
|
| 599 |
+
the checkpoint. Or you can load state_dict in lazy mode ::
|
| 600 |
+
|
| 601 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
| 602 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu
|
| 603 |
+
for name, lazy_tensor in state_dict.item():
|
| 604 |
+
tensor = lazy_tensor.contiguous() # to cpu
|
| 605 |
+
print(name, tensor)
|
| 606 |
+
# del tensor to release memory if it no longer in use
|
| 607 |
+
"""
|
| 608 |
+
if tag is None:
|
| 609 |
+
latest_path = os.path.join(checkpoint_dir, 'latest')
|
| 610 |
+
if os.path.isfile(latest_path):
|
| 611 |
+
with open(latest_path, 'r') as fd:
|
| 612 |
+
tag = fd.read().strip()
|
| 613 |
+
else:
|
| 614 |
+
raise ValueError(f"Unable to find 'latest' file at {latest_path}")
|
| 615 |
+
|
| 616 |
+
ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
|
| 617 |
+
|
| 618 |
+
if not os.path.isdir(ds_checkpoint_dir):
|
| 619 |
+
raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
|
| 620 |
+
|
| 621 |
+
state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
|
| 622 |
+
if lazy_mode:
|
| 623 |
+
return state_dict
|
| 624 |
+
else:
|
| 625 |
+
return to_torch_tensor(state_dict)
|
| 626 |
+
|
| 627 |
+
|
| 628 |
+
def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
|
| 629 |
+
output_dir,
|
| 630 |
+
max_shard_size="5GB",
|
| 631 |
+
safe_serialization=False,
|
| 632 |
+
tag=None,
|
| 633 |
+
exclude_frozen_parameters=False):
|
| 634 |
+
"""
|
| 635 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
|
| 636 |
+
loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
|
| 637 |
+
|
| 638 |
+
Args:
|
| 639 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
| 640 |
+
- ``output_dir``: directory to the pytorch fp32 state_dict output files
|
| 641 |
+
- ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
|
| 642 |
+
- ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
|
| 643 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
| 644 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
| 645 |
+
"""
|
| 646 |
+
|
| 647 |
+
# Dependency pre-check
|
| 648 |
+
if safe_serialization:
|
| 649 |
+
try:
|
| 650 |
+
from safetensors.torch import save_file
|
| 651 |
+
except ImportError:
|
| 652 |
+
print('If you want to use `safe_serialization`, please `pip install safetensors`')
|
| 653 |
+
raise
|
| 654 |
+
if max_shard_size is not None:
|
| 655 |
+
try:
|
| 656 |
+
from huggingface_hub import split_torch_state_dict_into_shards
|
| 657 |
+
except ImportError:
|
| 658 |
+
print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
|
| 659 |
+
raise
|
| 660 |
+
|
| 661 |
+
# Convert zero checkpoint to state_dict
|
| 662 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
|
| 663 |
+
tag,
|
| 664 |
+
exclude_frozen_parameters,
|
| 665 |
+
lazy_mode=True)
|
| 666 |
+
|
| 667 |
+
# Shard the model if it is too big.
|
| 668 |
+
weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
|
| 669 |
+
if max_shard_size is not None:
|
| 670 |
+
filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
|
| 671 |
+
# an memory-efficient approach for sharding
|
| 672 |
+
empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True)
|
| 673 |
+
state_dict_split = split_torch_state_dict_into_shards(empty_state_dict,
|
| 674 |
+
filename_pattern=filename_pattern,
|
| 675 |
+
max_shard_size=max_shard_size)
|
| 676 |
+
else:
|
| 677 |
+
from collections import namedtuple
|
| 678 |
+
StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
|
| 679 |
+
state_dict_split = StateDictSplit(is_sharded=False,
|
| 680 |
+
filename_to_tensors={weights_name: list(state_dict.keys())})
|
| 681 |
+
|
| 682 |
+
# Save the model by shard
|
| 683 |
+
os.makedirs(output_dir, exist_ok=True)
|
| 684 |
+
filename_to_tensors = state_dict_split.filename_to_tensors.items()
|
| 685 |
+
for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
|
| 686 |
+
shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors}
|
| 687 |
+
shard_state_dict = to_torch_tensor(shard_state_dict)
|
| 688 |
+
output_path = os.path.join(output_dir, shard_file)
|
| 689 |
+
if safe_serialization:
|
| 690 |
+
save_file(shard_state_dict, output_path, metadata={"format": "pt"})
|
| 691 |
+
else:
|
| 692 |
+
torch.save(shard_state_dict, output_path)
|
| 693 |
+
# release the memory of current shard
|
| 694 |
+
for tensor_name in list(shard_state_dict.keys()):
|
| 695 |
+
del state_dict[tensor_name]
|
| 696 |
+
del shard_state_dict[tensor_name]
|
| 697 |
+
del shard_state_dict
|
| 698 |
+
gc.collect()
|
| 699 |
+
|
| 700 |
+
# Save index if sharded
|
| 701 |
+
if state_dict_split.is_sharded:
|
| 702 |
+
index = {
|
| 703 |
+
"metadata": state_dict_split.metadata,
|
| 704 |
+
"weight_map": state_dict_split.tensor_to_filename,
|
| 705 |
+
}
|
| 706 |
+
save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
|
| 707 |
+
save_index_file = os.path.join(output_dir, save_index_file)
|
| 708 |
+
with open(save_index_file, "w", encoding="utf-8") as f:
|
| 709 |
+
content = json.dumps(index, indent=2, sort_keys=True) + "\n"
|
| 710 |
+
f.write(content)
|
| 711 |
+
|
| 712 |
+
|
| 713 |
+
def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
|
| 714 |
+
"""
|
| 715 |
+
1. Put the provided model to cpu
|
| 716 |
+
2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
|
| 717 |
+
3. Load it into the provided model
|
| 718 |
+
|
| 719 |
+
Args:
|
| 720 |
+
- ``model``: the model object to update
|
| 721 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
| 722 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
| 723 |
+
|
| 724 |
+
Returns:
|
| 725 |
+
- ``model`: modified model
|
| 726 |
+
|
| 727 |
+
Make sure you have plenty of CPU memory available before you call this function. If you don't
|
| 728 |
+
have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
|
| 729 |
+
conveniently placed for you in the checkpoint folder.
|
| 730 |
+
|
| 731 |
+
A typical usage might be ::
|
| 732 |
+
|
| 733 |
+
from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
|
| 734 |
+
model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
|
| 735 |
+
# submit to model hub or save the model to share with others
|
| 736 |
+
|
| 737 |
+
Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
|
| 738 |
+
of the same application. i.e. you will need to re-initialize the deepspeed engine, since
|
| 739 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
| 740 |
+
|
| 741 |
+
"""
|
| 742 |
+
logger.info("Extracting fp32 weights")
|
| 743 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
|
| 744 |
+
|
| 745 |
+
logger.info("Overwriting model with fp32 weights")
|
| 746 |
+
model = model.cpu()
|
| 747 |
+
model.load_state_dict(state_dict, strict=False)
|
| 748 |
+
|
| 749 |
+
return model
|
| 750 |
+
|
| 751 |
+
|
| 752 |
+
if __name__ == "__main__":
|
| 753 |
+
parser = argparse.ArgumentParser()
|
| 754 |
+
parser.add_argument("checkpoint_dir",
|
| 755 |
+
type=str,
|
| 756 |
+
help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
|
| 757 |
+
parser.add_argument("output_dir",
|
| 758 |
+
type=str,
|
| 759 |
+
help="directory to the pytorch fp32 state_dict output files"
|
| 760 |
+
"(e.g. path/checkpoint-12-output/)")
|
| 761 |
+
parser.add_argument(
|
| 762 |
+
"--max_shard_size",
|
| 763 |
+
type=str,
|
| 764 |
+
default="5GB",
|
| 765 |
+
help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
|
| 766 |
+
"lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
|
| 767 |
+
"We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
|
| 768 |
+
"without CPU OOM issues.")
|
| 769 |
+
parser.add_argument(
|
| 770 |
+
"--safe_serialization",
|
| 771 |
+
default=False,
|
| 772 |
+
action='store_true',
|
| 773 |
+
help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
|
| 774 |
+
parser.add_argument("-t",
|
| 775 |
+
"--tag",
|
| 776 |
+
type=str,
|
| 777 |
+
default=None,
|
| 778 |
+
help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
|
| 779 |
+
parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
|
| 780 |
+
parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
|
| 781 |
+
args = parser.parse_args()
|
| 782 |
+
|
| 783 |
+
debug = args.debug
|
| 784 |
+
|
| 785 |
+
convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
|
| 786 |
+
args.output_dir,
|
| 787 |
+
max_shard_size=args.max_shard_size,
|
| 788 |
+
safe_serialization=args.safe_serialization,
|
| 789 |
+
tag=args.tag,
|
| 790 |
+
exclude_frozen_parameters=args.exclude_frozen_parameters)
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96540243aac93e49d9c00162b2a11b42054f5bd6d95581b5558ea5ae36ff4bbe
|
| 3 |
+
size 8066685992
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b003abd0da50c8a043127ea184f2e8e11e4bc6f9eb2e076ea7f71e955ff9f6dd
|
| 3 |
+
size 8066667688
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cc902074bedffc31bf7a124e736dd5e77842ae8c9e58dfb4f152cd7288ffff1e
|
| 3 |
+
size 8066672104
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:252b17a3fbab10314af735d95975050e55739e798adb1a32b02466bd7796ae6c
|
| 3 |
+
size 8066671208
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/mp_rank_00_model_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5302cf91a0d0a7763e31dd84e9e5261faf772cc1c15ce4051ce80b60664e8a38
|
| 3 |
+
size 5378167768
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/latest
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
global_step50000
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final/zero_to_fp32.py
ADDED
|
@@ -0,0 +1,790 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
|
| 3 |
+
# Copyright (c) Microsoft Corporation.
|
| 4 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 5 |
+
|
| 6 |
+
# DeepSpeed Team
|
| 7 |
+
|
| 8 |
+
# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
|
| 9 |
+
# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
|
| 10 |
+
# the future. Once extracted, the weights don't require DeepSpeed and can be used in any
|
| 11 |
+
# application.
|
| 12 |
+
#
|
| 13 |
+
# example:
|
| 14 |
+
# python zero_to_fp32.py . output_dir/
|
| 15 |
+
# or
|
| 16 |
+
# python zero_to_fp32.py . output_dir/ --safe_serialization
|
| 17 |
+
|
| 18 |
+
import argparse
|
| 19 |
+
import torch
|
| 20 |
+
import glob
|
| 21 |
+
import math
|
| 22 |
+
import os
|
| 23 |
+
import re
|
| 24 |
+
import gc
|
| 25 |
+
import json
|
| 26 |
+
import numpy as np
|
| 27 |
+
from tqdm import tqdm
|
| 28 |
+
from collections import OrderedDict
|
| 29 |
+
from dataclasses import dataclass
|
| 30 |
+
|
| 31 |
+
# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
|
| 32 |
+
# DeepSpeed data structures it has to be available in the current python environment.
|
| 33 |
+
from deepspeed.utils import logger
|
| 34 |
+
from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
|
| 35 |
+
FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
|
| 36 |
+
FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS, AUTOEP_LAYERS_KEY,
|
| 37 |
+
AUTOEP_LAYERS_KEY_LEGACY, AUTOEP_ZERO3_EXPERT_STATE_FORMAT_KEY,
|
| 38 |
+
AUTOEP_ZERO3_PARTITIONED_EXPERT_STATE_FORMAT)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
@dataclass
|
| 42 |
+
class zero_model_state:
|
| 43 |
+
buffers: dict()
|
| 44 |
+
param_shapes: dict()
|
| 45 |
+
shared_params: list
|
| 46 |
+
ds_version: int
|
| 47 |
+
frozen_param_shapes: dict()
|
| 48 |
+
frozen_param_fragments: dict()
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
debug = 0
|
| 52 |
+
|
| 53 |
+
# load to cpu
|
| 54 |
+
device = torch.device('cpu')
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def atoi(text):
|
| 58 |
+
return int(text) if text.isdigit() else text
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def natural_keys(text):
|
| 62 |
+
'''
|
| 63 |
+
alist.sort(key=natural_keys) sorts in human order
|
| 64 |
+
http://nedbatchelder.com/blog/200712/human_sorting.html
|
| 65 |
+
(See Toothy's implementation in the comments)
|
| 66 |
+
'''
|
| 67 |
+
return [atoi(c) for c in re.split(r'(\d+)', text)]
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def get_model_state_file(checkpoint_dir, zero_stage):
|
| 71 |
+
if not os.path.isdir(checkpoint_dir):
|
| 72 |
+
raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
|
| 73 |
+
|
| 74 |
+
# there should be only one file
|
| 75 |
+
if zero_stage <= 2:
|
| 76 |
+
file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
|
| 77 |
+
elif zero_stage == 3:
|
| 78 |
+
file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
|
| 79 |
+
|
| 80 |
+
if not os.path.exists(file):
|
| 81 |
+
raise FileNotFoundError(f"can't find model states file at '{file}'")
|
| 82 |
+
|
| 83 |
+
return file
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def get_checkpoint_files(checkpoint_dir, glob_pattern):
|
| 87 |
+
# XXX: need to test that this simple glob rule works for multi-node setup too
|
| 88 |
+
ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
|
| 89 |
+
|
| 90 |
+
if len(ckpt_files) == 0:
|
| 91 |
+
raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
|
| 92 |
+
|
| 93 |
+
return ckpt_files
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def get_optim_files(checkpoint_dir):
|
| 97 |
+
return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
def get_model_state_files(checkpoint_dir):
|
| 101 |
+
return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def _has_autoep_zero3_partitioned_metadata(state_dict):
|
| 105 |
+
autoep_layers = state_dict.get(AUTOEP_LAYERS_KEY)
|
| 106 |
+
if autoep_layers is None:
|
| 107 |
+
autoep_layers = state_dict.get(AUTOEP_LAYERS_KEY_LEGACY)
|
| 108 |
+
if not isinstance(autoep_layers, list):
|
| 109 |
+
return False
|
| 110 |
+
return any(
|
| 111 |
+
isinstance(entry, dict)
|
| 112 |
+
and entry.get(AUTOEP_ZERO3_EXPERT_STATE_FORMAT_KEY) == AUTOEP_ZERO3_PARTITIONED_EXPERT_STATE_FORMAT
|
| 113 |
+
for entry in autoep_layers)
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
def _raise_if_autoep_zero3_partitioned_state(state_dict):
|
| 117 |
+
if _has_autoep_zero3_partitioned_metadata(state_dict):
|
| 118 |
+
raise NotImplementedError("zero_to_fp32 does not support AutoEP ZeRO-3 partition-native checkpoints. "
|
| 119 |
+
"AutoEP expert parameters are partitioned over expert replica groups, so "
|
| 120 |
+
"global data-parallel consolidation would produce incomplete expert tensors. "
|
| 121 |
+
"Use ds_to_universal.py for expert-aware conversion.")
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
def _raise_if_autoep_zero3_partitioned_checkpoint(model_files):
|
| 125 |
+
for file in model_files:
|
| 126 |
+
state_dict = torch.load(file, map_location=device, weights_only=False)
|
| 127 |
+
_raise_if_autoep_zero3_partitioned_state(state_dict)
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
def parse_model_states(files):
|
| 131 |
+
zero_model_states = []
|
| 132 |
+
for file in files:
|
| 133 |
+
state_dict = torch.load(file, map_location=device, weights_only=False)
|
| 134 |
+
_raise_if_autoep_zero3_partitioned_state(state_dict)
|
| 135 |
+
|
| 136 |
+
if BUFFER_NAMES not in state_dict:
|
| 137 |
+
raise ValueError(f"{file} is not a model state checkpoint")
|
| 138 |
+
buffer_names = state_dict[BUFFER_NAMES]
|
| 139 |
+
if debug:
|
| 140 |
+
print("Found buffers:", buffer_names)
|
| 141 |
+
|
| 142 |
+
# recover just the buffers while restoring them to fp32 if they were saved in fp16
|
| 143 |
+
buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
|
| 144 |
+
param_shapes = state_dict[PARAM_SHAPES]
|
| 145 |
+
|
| 146 |
+
# collect parameters that are included in param_shapes
|
| 147 |
+
param_names = []
|
| 148 |
+
for s in param_shapes:
|
| 149 |
+
for name in s.keys():
|
| 150 |
+
param_names.append(name)
|
| 151 |
+
|
| 152 |
+
# update with frozen parameters
|
| 153 |
+
frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
|
| 154 |
+
if frozen_param_shapes is not None:
|
| 155 |
+
if debug:
|
| 156 |
+
print(f"Found frozen_param_shapes: {frozen_param_shapes}")
|
| 157 |
+
param_names += list(frozen_param_shapes.keys())
|
| 158 |
+
|
| 159 |
+
# handle shared params
|
| 160 |
+
shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
|
| 161 |
+
|
| 162 |
+
ds_version = state_dict.get(DS_VERSION, None)
|
| 163 |
+
|
| 164 |
+
frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
|
| 165 |
+
|
| 166 |
+
z_model_state = zero_model_state(buffers=buffers,
|
| 167 |
+
param_shapes=param_shapes,
|
| 168 |
+
shared_params=shared_params,
|
| 169 |
+
ds_version=ds_version,
|
| 170 |
+
frozen_param_shapes=frozen_param_shapes,
|
| 171 |
+
frozen_param_fragments=frozen_param_fragments)
|
| 172 |
+
zero_model_states.append(z_model_state)
|
| 173 |
+
|
| 174 |
+
return zero_model_states
|
| 175 |
+
|
| 176 |
+
|
| 177 |
+
def parse_optim_states(files, ds_checkpoint_dir):
|
| 178 |
+
total_files = len(files)
|
| 179 |
+
state_dicts = []
|
| 180 |
+
for f in tqdm(files, desc='Loading checkpoint shards'):
|
| 181 |
+
state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False)
|
| 182 |
+
# immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
|
| 183 |
+
# and also handle the case where it was already removed by another helper script
|
| 184 |
+
state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
|
| 185 |
+
state_dicts.append(state_dict)
|
| 186 |
+
|
| 187 |
+
if ZERO_STAGE not in state_dicts[0][OPTIMIZER_STATE_DICT]:
|
| 188 |
+
raise ValueError(f"{files[0]} is not a zero checkpoint")
|
| 189 |
+
zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
|
| 190 |
+
world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
|
| 191 |
+
|
| 192 |
+
# For ZeRO-2 each param group can have different partition_count as data parallelism for expert
|
| 193 |
+
# parameters can be different from data parallelism for non-expert parameters. So we can just
|
| 194 |
+
# use the max of the partition_count to get the dp world_size.
|
| 195 |
+
|
| 196 |
+
if type(world_size) is list:
|
| 197 |
+
world_size = max(world_size)
|
| 198 |
+
|
| 199 |
+
if world_size != total_files:
|
| 200 |
+
raise ValueError(
|
| 201 |
+
f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
|
| 202 |
+
"Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
|
| 203 |
+
)
|
| 204 |
+
|
| 205 |
+
# the groups are named differently in each stage
|
| 206 |
+
if zero_stage <= 2:
|
| 207 |
+
fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
|
| 208 |
+
elif zero_stage == 3:
|
| 209 |
+
fp32_groups_key = FP32_FLAT_GROUPS
|
| 210 |
+
else:
|
| 211 |
+
raise ValueError(f"unknown zero stage {zero_stage}")
|
| 212 |
+
|
| 213 |
+
fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
|
| 214 |
+
return zero_stage, world_size, fp32_flat_groups
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
|
| 218 |
+
"""
|
| 219 |
+
Returns fp32 state_dict reconstructed from ds checkpoint
|
| 220 |
+
|
| 221 |
+
Args:
|
| 222 |
+
- ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
|
| 223 |
+
|
| 224 |
+
"""
|
| 225 |
+
print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
|
| 226 |
+
|
| 227 |
+
# parse_model_states rejects AutoEP ZeRO-3 partition-native checkpoints
|
| 228 |
+
# before the expensive optimizer-shard load below.
|
| 229 |
+
model_files = get_model_state_files(ds_checkpoint_dir)
|
| 230 |
+
zero_model_states = parse_model_states(model_files)
|
| 231 |
+
print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
|
| 232 |
+
|
| 233 |
+
optim_files = get_optim_files(ds_checkpoint_dir)
|
| 234 |
+
zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
|
| 235 |
+
print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
|
| 236 |
+
|
| 237 |
+
if zero_stage <= 2:
|
| 238 |
+
return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 239 |
+
exclude_frozen_parameters)
|
| 240 |
+
elif zero_stage == 3:
|
| 241 |
+
return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 242 |
+
exclude_frozen_parameters)
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
def _zero2_merge_frozen_params(state_dict, zero_model_states):
|
| 246 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
| 247 |
+
return
|
| 248 |
+
|
| 249 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
| 250 |
+
frozen_param_fragments = zero_model_states[0].frozen_param_fragments
|
| 251 |
+
|
| 252 |
+
if debug:
|
| 253 |
+
num_elem = sum(s.numel() for s in frozen_param_shapes.values())
|
| 254 |
+
print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
| 255 |
+
|
| 256 |
+
wanted_params = len(frozen_param_shapes)
|
| 257 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
| 258 |
+
avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
|
| 259 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
| 260 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
| 261 |
+
|
| 262 |
+
total_params = 0
|
| 263 |
+
total_numel = 0
|
| 264 |
+
for name, shape in frozen_param_shapes.items():
|
| 265 |
+
total_params += 1
|
| 266 |
+
unpartitioned_numel = shape.numel()
|
| 267 |
+
total_numel += unpartitioned_numel
|
| 268 |
+
|
| 269 |
+
state_dict[name] = frozen_param_fragments[name]
|
| 270 |
+
|
| 271 |
+
if debug:
|
| 272 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
| 273 |
+
|
| 274 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
| 275 |
+
|
| 276 |
+
|
| 277 |
+
def _has_callable(obj, fn):
|
| 278 |
+
attr = getattr(obj, fn, None)
|
| 279 |
+
return callable(attr)
|
| 280 |
+
|
| 281 |
+
|
| 282 |
+
def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
| 283 |
+
param_shapes = zero_model_states[0].param_shapes
|
| 284 |
+
|
| 285 |
+
# Reconstruction protocol:
|
| 286 |
+
#
|
| 287 |
+
# XXX: document this
|
| 288 |
+
|
| 289 |
+
if debug:
|
| 290 |
+
for i in range(world_size):
|
| 291 |
+
for j in range(len(fp32_flat_groups[0])):
|
| 292 |
+
print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
|
| 293 |
+
|
| 294 |
+
# XXX: memory usage doubles here (zero2)
|
| 295 |
+
num_param_groups = len(fp32_flat_groups[0])
|
| 296 |
+
merged_single_partition_of_fp32_groups = []
|
| 297 |
+
for i in range(num_param_groups):
|
| 298 |
+
merged_partitions = [sd[i] for sd in fp32_flat_groups]
|
| 299 |
+
full_single_fp32_vector = torch.cat(merged_partitions, 0)
|
| 300 |
+
merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
|
| 301 |
+
avail_numel = sum(
|
| 302 |
+
[full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
|
| 303 |
+
|
| 304 |
+
if debug:
|
| 305 |
+
wanted_params = sum([len(shapes) for shapes in param_shapes])
|
| 306 |
+
wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
|
| 307 |
+
# not asserting if there is a mismatch due to possible padding
|
| 308 |
+
print(f"Have {avail_numel} numels to process.")
|
| 309 |
+
print(f"Need {wanted_numel} numels in {wanted_params} params.")
|
| 310 |
+
|
| 311 |
+
# params
|
| 312 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
| 313 |
+
# out-of-core computing solution
|
| 314 |
+
total_numel = 0
|
| 315 |
+
total_params = 0
|
| 316 |
+
for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
|
| 317 |
+
offset = 0
|
| 318 |
+
avail_numel = full_single_fp32_vector.numel()
|
| 319 |
+
for name, shape in shapes.items():
|
| 320 |
+
|
| 321 |
+
unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
|
| 322 |
+
total_numel += unpartitioned_numel
|
| 323 |
+
total_params += 1
|
| 324 |
+
|
| 325 |
+
if debug:
|
| 326 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
| 327 |
+
state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
|
| 328 |
+
offset += unpartitioned_numel
|
| 329 |
+
|
| 330 |
+
# Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
|
| 331 |
+
# avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
|
| 332 |
+
# paddings performed in the code it's almost impossible to predict the exact numbers w/o the
|
| 333 |
+
# live optimizer object, so we are checking that the numbers are within the right range
|
| 334 |
+
align_to = 2 * world_size
|
| 335 |
+
|
| 336 |
+
def zero2_align(x):
|
| 337 |
+
return align_to * math.ceil(x / align_to)
|
| 338 |
+
|
| 339 |
+
if debug:
|
| 340 |
+
print(f"original offset={offset}, avail_numel={avail_numel}")
|
| 341 |
+
|
| 342 |
+
offset = zero2_align(offset)
|
| 343 |
+
avail_numel = zero2_align(avail_numel)
|
| 344 |
+
|
| 345 |
+
if debug:
|
| 346 |
+
print(f"aligned offset={offset}, avail_numel={avail_numel}")
|
| 347 |
+
|
| 348 |
+
# Sanity check
|
| 349 |
+
if offset != avail_numel:
|
| 350 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
| 351 |
+
|
| 352 |
+
print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
|
| 353 |
+
|
| 354 |
+
|
| 355 |
+
def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 356 |
+
exclude_frozen_parameters):
|
| 357 |
+
state_dict = OrderedDict()
|
| 358 |
+
|
| 359 |
+
# buffers
|
| 360 |
+
buffers = zero_model_states[0].buffers
|
| 361 |
+
state_dict.update(buffers)
|
| 362 |
+
if debug:
|
| 363 |
+
print(f"added {len(buffers)} buffers")
|
| 364 |
+
|
| 365 |
+
if not exclude_frozen_parameters:
|
| 366 |
+
_zero2_merge_frozen_params(state_dict, zero_model_states)
|
| 367 |
+
|
| 368 |
+
_zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
| 369 |
+
|
| 370 |
+
# recover shared parameters
|
| 371 |
+
for pair in zero_model_states[0].shared_params:
|
| 372 |
+
if pair[1] in state_dict:
|
| 373 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
| 374 |
+
|
| 375 |
+
return state_dict
|
| 376 |
+
|
| 377 |
+
|
| 378 |
+
def zero3_partitioned_param_info(unpartitioned_numel, world_size):
|
| 379 |
+
remainder = unpartitioned_numel % world_size
|
| 380 |
+
padding_numel = (world_size - remainder) if remainder else 0
|
| 381 |
+
partitioned_numel = math.ceil(unpartitioned_numel / world_size)
|
| 382 |
+
return partitioned_numel, padding_numel
|
| 383 |
+
|
| 384 |
+
|
| 385 |
+
def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
|
| 386 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
| 387 |
+
return
|
| 388 |
+
|
| 389 |
+
if debug:
|
| 390 |
+
for i in range(world_size):
|
| 391 |
+
num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
|
| 392 |
+
print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
| 393 |
+
|
| 394 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
| 395 |
+
wanted_params = len(frozen_param_shapes)
|
| 396 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
| 397 |
+
avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
|
| 398 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
| 399 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
| 400 |
+
|
| 401 |
+
total_params = 0
|
| 402 |
+
total_numel = 0
|
| 403 |
+
for name, shape in zero_model_states[0].frozen_param_shapes.items():
|
| 404 |
+
total_params += 1
|
| 405 |
+
unpartitioned_numel = shape.numel()
|
| 406 |
+
total_numel += unpartitioned_numel
|
| 407 |
+
|
| 408 |
+
param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
|
| 409 |
+
state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
|
| 410 |
+
|
| 411 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
| 412 |
+
|
| 413 |
+
if debug:
|
| 414 |
+
print(
|
| 415 |
+
f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
| 416 |
+
)
|
| 417 |
+
|
| 418 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
| 419 |
+
|
| 420 |
+
|
| 421 |
+
class GatheredTensor:
|
| 422 |
+
"""
|
| 423 |
+
A pseudo tensor that collects partitioned weights.
|
| 424 |
+
It is more memory efficient when there are multiple groups.
|
| 425 |
+
"""
|
| 426 |
+
|
| 427 |
+
def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape):
|
| 428 |
+
self.flat_groups = flat_groups
|
| 429 |
+
self.flat_groups_offset = flat_groups_offset
|
| 430 |
+
self.offset = offset
|
| 431 |
+
self.partitioned_numel = partitioned_numel
|
| 432 |
+
self.shape = shape
|
| 433 |
+
self.dtype = self.flat_groups[0][0].dtype
|
| 434 |
+
|
| 435 |
+
def contiguous(self):
|
| 436 |
+
"""
|
| 437 |
+
Merge partitioned weights from flat_groups into a single tensor.
|
| 438 |
+
"""
|
| 439 |
+
end_idx = self.offset + self.partitioned_numel
|
| 440 |
+
world_size = len(self.flat_groups)
|
| 441 |
+
pad_flat_param_chunks = []
|
| 442 |
+
|
| 443 |
+
for rank_i in range(world_size):
|
| 444 |
+
# for each rank, we need to collect weights from related group/groups
|
| 445 |
+
flat_groups_at_rank_i = self.flat_groups[rank_i]
|
| 446 |
+
start_group_id = None
|
| 447 |
+
end_group_id = None
|
| 448 |
+
for group_id in range(len(self.flat_groups_offset)):
|
| 449 |
+
if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]:
|
| 450 |
+
start_group_id = group_id
|
| 451 |
+
if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]:
|
| 452 |
+
end_group_id = group_id
|
| 453 |
+
break
|
| 454 |
+
# collect weights from related group/groups
|
| 455 |
+
for group_id in range(start_group_id, end_group_id + 1):
|
| 456 |
+
flat_tensor = flat_groups_at_rank_i[group_id]
|
| 457 |
+
start_offset = self.offset - self.flat_groups_offset[group_id]
|
| 458 |
+
end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id]
|
| 459 |
+
pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset])
|
| 460 |
+
|
| 461 |
+
# collect weights from all ranks
|
| 462 |
+
pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0)
|
| 463 |
+
param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous()
|
| 464 |
+
return param
|
| 465 |
+
|
| 466 |
+
|
| 467 |
+
def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
| 468 |
+
param_shapes = zero_model_states[0].param_shapes
|
| 469 |
+
avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size
|
| 470 |
+
|
| 471 |
+
# Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
|
| 472 |
+
# param, re-consolidating each param, while dealing with padding if any
|
| 473 |
+
|
| 474 |
+
# merge list of dicts, preserving order
|
| 475 |
+
param_shapes = {k: v for d in param_shapes for k, v in d.items()}
|
| 476 |
+
|
| 477 |
+
if debug:
|
| 478 |
+
for i in range(world_size):
|
| 479 |
+
print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
|
| 480 |
+
|
| 481 |
+
wanted_params = len(param_shapes)
|
| 482 |
+
wanted_numel = sum(shape.numel() for shape in param_shapes.values())
|
| 483 |
+
# not asserting if there is a mismatch due to possible padding
|
| 484 |
+
avail_numel = fp32_flat_groups[0].numel() * world_size
|
| 485 |
+
print(f"Trainable params: Have {avail_numel} numels to process.")
|
| 486 |
+
print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
|
| 487 |
+
|
| 488 |
+
# params
|
| 489 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
| 490 |
+
# out-of-core computing solution
|
| 491 |
+
offset = 0
|
| 492 |
+
total_numel = 0
|
| 493 |
+
total_params = 0
|
| 494 |
+
flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]]))
|
| 495 |
+
for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'):
|
| 496 |
+
unpartitioned_numel = shape.numel()
|
| 497 |
+
total_numel += unpartitioned_numel
|
| 498 |
+
total_params += 1
|
| 499 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
| 500 |
+
|
| 501 |
+
if debug:
|
| 502 |
+
print(
|
| 503 |
+
f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
| 504 |
+
)
|
| 505 |
+
|
| 506 |
+
# memory efficient tensor
|
| 507 |
+
tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape)
|
| 508 |
+
state_dict[name] = tensor
|
| 509 |
+
offset += partitioned_numel
|
| 510 |
+
|
| 511 |
+
offset *= world_size
|
| 512 |
+
|
| 513 |
+
# Sanity check
|
| 514 |
+
if offset != avail_numel:
|
| 515 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
| 516 |
+
|
| 517 |
+
print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
|
| 518 |
+
|
| 519 |
+
|
| 520 |
+
def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 521 |
+
exclude_frozen_parameters):
|
| 522 |
+
state_dict = OrderedDict()
|
| 523 |
+
|
| 524 |
+
# buffers
|
| 525 |
+
buffers = zero_model_states[0].buffers
|
| 526 |
+
state_dict.update(buffers)
|
| 527 |
+
if debug:
|
| 528 |
+
print(f"added {len(buffers)} buffers")
|
| 529 |
+
|
| 530 |
+
if not exclude_frozen_parameters:
|
| 531 |
+
_zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
|
| 532 |
+
|
| 533 |
+
_zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
| 534 |
+
|
| 535 |
+
# recover shared parameters
|
| 536 |
+
for pair in zero_model_states[0].shared_params:
|
| 537 |
+
if pair[1] in state_dict:
|
| 538 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
| 539 |
+
|
| 540 |
+
return state_dict
|
| 541 |
+
|
| 542 |
+
|
| 543 |
+
def to_torch_tensor(state_dict, return_empty_tensor=False):
|
| 544 |
+
"""
|
| 545 |
+
Convert state_dict of GatheredTensor to torch tensor
|
| 546 |
+
"""
|
| 547 |
+
torch_state_dict = {}
|
| 548 |
+
converted_tensors = {}
|
| 549 |
+
for name, tensor in state_dict.items():
|
| 550 |
+
tensor_id = id(tensor)
|
| 551 |
+
if tensor_id in converted_tensors: # shared tensors
|
| 552 |
+
shared_tensor = torch_state_dict[converted_tensors[tensor_id]]
|
| 553 |
+
torch_state_dict[name] = shared_tensor
|
| 554 |
+
else:
|
| 555 |
+
converted_tensors[tensor_id] = name
|
| 556 |
+
if return_empty_tensor:
|
| 557 |
+
torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype)
|
| 558 |
+
else:
|
| 559 |
+
torch_state_dict[name] = tensor.contiguous()
|
| 560 |
+
return torch_state_dict
|
| 561 |
+
|
| 562 |
+
|
| 563 |
+
def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
|
| 564 |
+
tag=None,
|
| 565 |
+
exclude_frozen_parameters=False,
|
| 566 |
+
lazy_mode=False):
|
| 567 |
+
"""
|
| 568 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
|
| 569 |
+
``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
|
| 570 |
+
via a model hub.
|
| 571 |
+
|
| 572 |
+
Args:
|
| 573 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder
|
| 574 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
|
| 575 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
| 576 |
+
- ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient.
|
| 577 |
+
Convert the pesduo tensor to torch tensor by ``.contiguous()``
|
| 578 |
+
|
| 579 |
+
Returns:
|
| 580 |
+
- pytorch ``state_dict``
|
| 581 |
+
|
| 582 |
+
A typical usage might be ::
|
| 583 |
+
|
| 584 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
| 585 |
+
# do the training and checkpoint saving
|
| 586 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
|
| 587 |
+
model = model.cpu() # move to cpu
|
| 588 |
+
model.load_state_dict(state_dict)
|
| 589 |
+
# submit to model hub or save the model to share with others
|
| 590 |
+
|
| 591 |
+
In this example the ``model`` will no longer be usable in the deepspeed context of the same
|
| 592 |
+
application. i.e. you will need to re-initialize the deepspeed engine, since
|
| 593 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
| 594 |
+
|
| 595 |
+
If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
|
| 596 |
+
|
| 597 |
+
Note: the above usage may not work if your application doesn't have sufficient free CPU memory.
|
| 598 |
+
You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
|
| 599 |
+
the checkpoint. Or you can load state_dict in lazy mode ::
|
| 600 |
+
|
| 601 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
| 602 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu
|
| 603 |
+
for name, lazy_tensor in state_dict.item():
|
| 604 |
+
tensor = lazy_tensor.contiguous() # to cpu
|
| 605 |
+
print(name, tensor)
|
| 606 |
+
# del tensor to release memory if it no longer in use
|
| 607 |
+
"""
|
| 608 |
+
if tag is None:
|
| 609 |
+
latest_path = os.path.join(checkpoint_dir, 'latest')
|
| 610 |
+
if os.path.isfile(latest_path):
|
| 611 |
+
with open(latest_path, 'r') as fd:
|
| 612 |
+
tag = fd.read().strip()
|
| 613 |
+
else:
|
| 614 |
+
raise ValueError(f"Unable to find 'latest' file at {latest_path}")
|
| 615 |
+
|
| 616 |
+
ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
|
| 617 |
+
|
| 618 |
+
if not os.path.isdir(ds_checkpoint_dir):
|
| 619 |
+
raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
|
| 620 |
+
|
| 621 |
+
state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
|
| 622 |
+
if lazy_mode:
|
| 623 |
+
return state_dict
|
| 624 |
+
else:
|
| 625 |
+
return to_torch_tensor(state_dict)
|
| 626 |
+
|
| 627 |
+
|
| 628 |
+
def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
|
| 629 |
+
output_dir,
|
| 630 |
+
max_shard_size="5GB",
|
| 631 |
+
safe_serialization=False,
|
| 632 |
+
tag=None,
|
| 633 |
+
exclude_frozen_parameters=False):
|
| 634 |
+
"""
|
| 635 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
|
| 636 |
+
loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
|
| 637 |
+
|
| 638 |
+
Args:
|
| 639 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
| 640 |
+
- ``output_dir``: directory to the pytorch fp32 state_dict output files
|
| 641 |
+
- ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
|
| 642 |
+
- ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
|
| 643 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
| 644 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
| 645 |
+
"""
|
| 646 |
+
|
| 647 |
+
# Dependency pre-check
|
| 648 |
+
if safe_serialization:
|
| 649 |
+
try:
|
| 650 |
+
from safetensors.torch import save_file
|
| 651 |
+
except ImportError:
|
| 652 |
+
print('If you want to use `safe_serialization`, please `pip install safetensors`')
|
| 653 |
+
raise
|
| 654 |
+
if max_shard_size is not None:
|
| 655 |
+
try:
|
| 656 |
+
from huggingface_hub import split_torch_state_dict_into_shards
|
| 657 |
+
except ImportError:
|
| 658 |
+
print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
|
| 659 |
+
raise
|
| 660 |
+
|
| 661 |
+
# Convert zero checkpoint to state_dict
|
| 662 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
|
| 663 |
+
tag,
|
| 664 |
+
exclude_frozen_parameters,
|
| 665 |
+
lazy_mode=True)
|
| 666 |
+
|
| 667 |
+
# Shard the model if it is too big.
|
| 668 |
+
weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
|
| 669 |
+
if max_shard_size is not None:
|
| 670 |
+
filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
|
| 671 |
+
# an memory-efficient approach for sharding
|
| 672 |
+
empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True)
|
| 673 |
+
state_dict_split = split_torch_state_dict_into_shards(empty_state_dict,
|
| 674 |
+
filename_pattern=filename_pattern,
|
| 675 |
+
max_shard_size=max_shard_size)
|
| 676 |
+
else:
|
| 677 |
+
from collections import namedtuple
|
| 678 |
+
StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
|
| 679 |
+
state_dict_split = StateDictSplit(is_sharded=False,
|
| 680 |
+
filename_to_tensors={weights_name: list(state_dict.keys())})
|
| 681 |
+
|
| 682 |
+
# Save the model by shard
|
| 683 |
+
os.makedirs(output_dir, exist_ok=True)
|
| 684 |
+
filename_to_tensors = state_dict_split.filename_to_tensors.items()
|
| 685 |
+
for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
|
| 686 |
+
shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors}
|
| 687 |
+
shard_state_dict = to_torch_tensor(shard_state_dict)
|
| 688 |
+
output_path = os.path.join(output_dir, shard_file)
|
| 689 |
+
if safe_serialization:
|
| 690 |
+
save_file(shard_state_dict, output_path, metadata={"format": "pt"})
|
| 691 |
+
else:
|
| 692 |
+
torch.save(shard_state_dict, output_path)
|
| 693 |
+
# release the memory of current shard
|
| 694 |
+
for tensor_name in list(shard_state_dict.keys()):
|
| 695 |
+
del state_dict[tensor_name]
|
| 696 |
+
del shard_state_dict[tensor_name]
|
| 697 |
+
del shard_state_dict
|
| 698 |
+
gc.collect()
|
| 699 |
+
|
| 700 |
+
# Save index if sharded
|
| 701 |
+
if state_dict_split.is_sharded:
|
| 702 |
+
index = {
|
| 703 |
+
"metadata": state_dict_split.metadata,
|
| 704 |
+
"weight_map": state_dict_split.tensor_to_filename,
|
| 705 |
+
}
|
| 706 |
+
save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
|
| 707 |
+
save_index_file = os.path.join(output_dir, save_index_file)
|
| 708 |
+
with open(save_index_file, "w", encoding="utf-8") as f:
|
| 709 |
+
content = json.dumps(index, indent=2, sort_keys=True) + "\n"
|
| 710 |
+
f.write(content)
|
| 711 |
+
|
| 712 |
+
|
| 713 |
+
def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
|
| 714 |
+
"""
|
| 715 |
+
1. Put the provided model to cpu
|
| 716 |
+
2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
|
| 717 |
+
3. Load it into the provided model
|
| 718 |
+
|
| 719 |
+
Args:
|
| 720 |
+
- ``model``: the model object to update
|
| 721 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
| 722 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
| 723 |
+
|
| 724 |
+
Returns:
|
| 725 |
+
- ``model`: modified model
|
| 726 |
+
|
| 727 |
+
Make sure you have plenty of CPU memory available before you call this function. If you don't
|
| 728 |
+
have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
|
| 729 |
+
conveniently placed for you in the checkpoint folder.
|
| 730 |
+
|
| 731 |
+
A typical usage might be ::
|
| 732 |
+
|
| 733 |
+
from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
|
| 734 |
+
model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
|
| 735 |
+
# submit to model hub or save the model to share with others
|
| 736 |
+
|
| 737 |
+
Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
|
| 738 |
+
of the same application. i.e. you will need to re-initialize the deepspeed engine, since
|
| 739 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
| 740 |
+
|
| 741 |
+
"""
|
| 742 |
+
logger.info("Extracting fp32 weights")
|
| 743 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
|
| 744 |
+
|
| 745 |
+
logger.info("Overwriting model with fp32 weights")
|
| 746 |
+
model = model.cpu()
|
| 747 |
+
model.load_state_dict(state_dict, strict=False)
|
| 748 |
+
|
| 749 |
+
return model
|
| 750 |
+
|
| 751 |
+
|
| 752 |
+
if __name__ == "__main__":
|
| 753 |
+
parser = argparse.ArgumentParser()
|
| 754 |
+
parser.add_argument("checkpoint_dir",
|
| 755 |
+
type=str,
|
| 756 |
+
help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
|
| 757 |
+
parser.add_argument("output_dir",
|
| 758 |
+
type=str,
|
| 759 |
+
help="directory to the pytorch fp32 state_dict output files"
|
| 760 |
+
"(e.g. path/checkpoint-12-output/)")
|
| 761 |
+
parser.add_argument(
|
| 762 |
+
"--max_shard_size",
|
| 763 |
+
type=str,
|
| 764 |
+
default="5GB",
|
| 765 |
+
help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
|
| 766 |
+
"lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
|
| 767 |
+
"We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
|
| 768 |
+
"without CPU OOM issues.")
|
| 769 |
+
parser.add_argument(
|
| 770 |
+
"--safe_serialization",
|
| 771 |
+
default=False,
|
| 772 |
+
action='store_true',
|
| 773 |
+
help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
|
| 774 |
+
parser.add_argument("-t",
|
| 775 |
+
"--tag",
|
| 776 |
+
type=str,
|
| 777 |
+
default=None,
|
| 778 |
+
help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
|
| 779 |
+
parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
|
| 780 |
+
parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
|
| 781 |
+
args = parser.parse_args()
|
| 782 |
+
|
| 783 |
+
debug = args.debug
|
| 784 |
+
|
| 785 |
+
convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
|
| 786 |
+
args.output_dir,
|
| 787 |
+
max_shard_size=args.max_shard_size,
|
| 788 |
+
safe_serialization=args.safe_serialization,
|
| 789 |
+
tag=args.tag,
|
| 790 |
+
exclude_frozen_parameters=args.exclude_frozen_parameters)
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/train.log
CHANGED
|
@@ -4665,3 +4665,350 @@
|
|
| 4665 |
2026-09-25 16:42:22 | INFO | train rank=0 | step=46550/50000 progress=93.1% loss=0.085150 lr=1.296002e-06 lr_backbone=1.296002e-06 elapsed=47:35:04 avg_step=3.68s recent_step=3.52s eta=03:31:36
|
| 4666 |
2026-09-25 16:42:56 | INFO | train rank=0 | step=46560/50000 progress=93.1% loss=0.078506 lr=1.288532e-06 lr_backbone=1.288532e-06 elapsed=47:35:38 avg_step=3.68s recent_step=3.47s eta=03:30:59
|
| 4667 |
2026-09-25 16:43:47 | INFO | train rank=0 | step=46570/50000 progress=93.1% loss=0.064601 lr=1.281084e-06 lr_backbone=1.281084e-06 elapsed=47:36:29 avg_step=3.68s recent_step=5.10s eta=03:30:23
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4665 |
2026-09-25 16:42:22 | INFO | train rank=0 | step=46550/50000 progress=93.1% loss=0.085150 lr=1.296002e-06 lr_backbone=1.296002e-06 elapsed=47:35:04 avg_step=3.68s recent_step=3.52s eta=03:31:36
|
| 4666 |
2026-09-25 16:42:56 | INFO | train rank=0 | step=46560/50000 progress=93.1% loss=0.078506 lr=1.288532e-06 lr_backbone=1.288532e-06 elapsed=47:35:38 avg_step=3.68s recent_step=3.47s eta=03:30:59
|
| 4667 |
2026-09-25 16:43:47 | INFO | train rank=0 | step=46570/50000 progress=93.1% loss=0.064601 lr=1.281084e-06 lr_backbone=1.281084e-06 elapsed=47:36:29 avg_step=3.68s recent_step=5.10s eta=03:30:23
|
| 4668 |
+
2026-09-25 16:44:25 | INFO | train rank=0 | step=46580/50000 progress=93.2% loss=0.079905 lr=1.273656e-06 lr_backbone=1.273656e-06 elapsed=47:37:07 avg_step=3.68s recent_step=3.77s eta=03:29:46
|
| 4669 |
+
2026-09-25 16:44:58 | INFO | train rank=0 | step=46590/50000 progress=93.2% loss=0.071854 lr=1.266251e-06 lr_backbone=1.266251e-06 elapsed=47:37:40 avg_step=3.68s recent_step=3.31s eta=03:29:09
|
| 4670 |
+
2026-09-25 16:45:24 | INFO | train rank=0 | step=46600/50000 progress=93.2% loss=0.067299 lr=1.258866e-06 lr_backbone=1.258866e-06 elapsed=47:38:06 avg_step=3.68s recent_step=2.61s eta=03:28:31
|
| 4671 |
+
2026-09-25 16:46:18 | INFO | train rank=0 | step=46610/50000 progress=93.2% loss=0.073048 lr=1.251503e-06 lr_backbone=1.251503e-06 elapsed=47:39:00 avg_step=3.68s recent_step=5.36s eta=03:27:56
|
| 4672 |
+
2026-09-25 16:46:58 | INFO | train rank=0 | step=46620/50000 progress=93.2% loss=0.078455 lr=1.244161e-06 lr_backbone=1.244161e-06 elapsed=47:39:40 avg_step=3.68s recent_step=4.04s eta=03:27:19
|
| 4673 |
+
2026-09-25 16:47:31 | INFO | train rank=0 | step=46630/50000 progress=93.3% loss=0.070384 lr=1.236840e-06 lr_backbone=1.236840e-06 elapsed=47:40:13 avg_step=3.68s recent_step=3.28s eta=03:26:42
|
| 4674 |
+
2026-09-25 16:48:02 | INFO | train rank=0 | step=46640/50000 progress=93.3% loss=0.075566 lr=1.229541e-06 lr_backbone=1.229541e-06 elapsed=47:40:45 avg_step=3.68s recent_step=3.15s eta=03:26:05
|
| 4675 |
+
2026-09-25 16:48:53 | INFO | train rank=0 | step=46650/50000 progress=93.3% loss=0.090195 lr=1.222263e-06 lr_backbone=1.222263e-06 elapsed=47:41:35 avg_step=3.68s recent_step=5.07s eta=03:25:29
|
| 4676 |
+
2026-09-25 16:49:27 | INFO | train rank=0 | step=46660/50000 progress=93.3% loss=0.070902 lr=1.215007e-06 lr_backbone=1.215007e-06 elapsed=47:42:09 avg_step=3.68s recent_step=3.41s eta=03:24:52
|
| 4677 |
+
2026-09-25 16:50:03 | INFO | train rank=0 | step=46670/50000 progress=93.3% loss=0.100467 lr=1.207772e-06 lr_backbone=1.207772e-06 elapsed=47:42:45 avg_step=3.68s recent_step=3.60s eta=03:24:15
|
| 4678 |
+
2026-09-25 16:50:26 | INFO | train rank=0 | step=46680/50000 progress=93.4% loss=0.088364 lr=1.200558e-06 lr_backbone=1.200558e-06 elapsed=47:43:08 avg_step=3.68s recent_step=2.31s eta=03:23:38
|
| 4679 |
+
2026-09-25 16:51:18 | INFO | train rank=0 | step=46690/50000 progress=93.4% loss=0.081345 lr=1.193365e-06 lr_backbone=1.193365e-06 elapsed=47:44:00 avg_step=3.68s recent_step=5.21s eta=03:23:02
|
| 4680 |
+
2026-09-25 16:51:50 | INFO | train rank=0 | step=46700/50000 progress=93.4% loss=0.082804 lr=1.186194e-06 lr_backbone=1.186194e-06 elapsed=47:44:32 avg_step=3.68s recent_step=3.14s eta=03:22:25
|
| 4681 |
+
2026-09-25 16:52:28 | INFO | train rank=0 | step=46710/50000 progress=93.4% loss=0.070296 lr=1.179044e-06 lr_backbone=1.179044e-06 elapsed=47:45:10 avg_step=3.68s recent_step=3.82s eta=03:21:48
|
| 4682 |
+
2026-09-25 16:53:01 | INFO | train rank=0 | step=46720/50000 progress=93.4% loss=0.081726 lr=1.171916e-06 lr_backbone=1.171916e-06 elapsed=47:45:43 avg_step=3.68s recent_step=3.30s eta=03:21:11
|
| 4683 |
+
2026-09-25 16:53:41 | INFO | train rank=0 | step=46730/50000 progress=93.5% loss=0.082142 lr=1.164809e-06 lr_backbone=1.164809e-06 elapsed=47:46:23 avg_step=3.68s recent_step=3.96s eta=03:20:34
|
| 4684 |
+
2026-09-25 16:54:19 | INFO | train rank=0 | step=46740/50000 progress=93.5% loss=0.112387 lr=1.157723e-06 lr_backbone=1.157723e-06 elapsed=47:47:01 avg_step=3.68s recent_step=3.86s eta=03:19:58
|
| 4685 |
+
2026-09-25 16:54:52 | INFO | train rank=0 | step=46750/50000 progress=93.5% loss=0.078362 lr=1.150658e-06 lr_backbone=1.150658e-06 elapsed=47:47:34 avg_step=3.68s recent_step=3.26s eta=03:19:21
|
| 4686 |
+
2026-09-25 16:55:26 | INFO | train rank=0 | step=46760/50000 progress=93.5% loss=0.070207 lr=1.143615e-06 lr_backbone=1.143615e-06 elapsed=47:48:09 avg_step=3.68s recent_step=3.46s eta=03:18:44
|
| 4687 |
+
2026-09-25 16:56:13 | INFO | train rank=0 | step=46770/50000 progress=93.5% loss=0.082786 lr=1.136594e-06 lr_backbone=1.136594e-06 elapsed=47:48:55 avg_step=3.68s recent_step=4.66s eta=03:18:07
|
| 4688 |
+
2026-09-25 16:56:52 | INFO | train rank=0 | step=46780/50000 progress=93.6% loss=0.083894 lr=1.129594e-06 lr_backbone=1.129594e-06 elapsed=47:49:34 avg_step=3.68s recent_step=3.91s eta=03:17:31
|
| 4689 |
+
2026-09-25 16:57:26 | INFO | train rank=0 | step=46790/50000 progress=93.6% loss=0.111434 lr=1.122615e-06 lr_backbone=1.122615e-06 elapsed=47:50:09 avg_step=3.68s recent_step=3.43s eta=03:16:54
|
| 4690 |
+
2026-09-25 16:58:02 | INFO | train rank=0 | step=46800/50000 progress=93.6% loss=0.074171 lr=1.115657e-06 lr_backbone=1.115657e-06 elapsed=47:50:44 avg_step=3.68s recent_step=3.54s eta=03:16:17
|
| 4691 |
+
2026-09-25 16:58:51 | INFO | train rank=0 | step=46810/50000 progress=93.6% loss=0.090711 lr=1.108721e-06 lr_backbone=1.108721e-06 elapsed=47:51:33 avg_step=3.68s recent_step=4.91s eta=03:15:41
|
| 4692 |
+
2026-09-25 16:59:21 | INFO | train rank=0 | step=46820/50000 progress=93.6% loss=0.086775 lr=1.101806e-06 lr_backbone=1.101806e-06 elapsed=47:52:03 avg_step=3.68s recent_step=3.02s eta=03:15:04
|
| 4693 |
+
2026-09-25 16:59:55 | INFO | train rank=0 | step=46830/50000 progress=93.7% loss=0.060297 lr=1.094913e-06 lr_backbone=1.094913e-06 elapsed=47:52:37 avg_step=3.68s recent_step=3.35s eta=03:14:27
|
| 4694 |
+
2026-09-25 17:00:28 | INFO | train rank=0 | step=46840/50000 progress=93.7% loss=0.077113 lr=1.088041e-06 lr_backbone=1.088041e-06 elapsed=47:53:10 avg_step=3.68s recent_step=3.35s eta=03:13:50
|
| 4695 |
+
2026-09-25 17:01:13 | INFO | train rank=0 | step=46850/50000 progress=93.7% loss=0.087077 lr=1.081190e-06 lr_backbone=1.081190e-06 elapsed=47:53:55 avg_step=3.68s recent_step=4.48s eta=03:13:13
|
| 4696 |
+
2026-09-25 17:01:46 | INFO | train rank=0 | step=46860/50000 progress=93.7% loss=0.101646 lr=1.074361e-06 lr_backbone=1.074361e-06 elapsed=47:54:28 avg_step=3.68s recent_step=3.25s eta=03:12:36
|
| 4697 |
+
2026-09-25 17:02:23 | INFO | train rank=0 | step=46870/50000 progress=93.7% loss=0.097853 lr=1.067554e-06 lr_backbone=1.067554e-06 elapsed=47:55:05 avg_step=3.68s recent_step=3.74s eta=03:12:00
|
| 4698 |
+
2026-09-25 17:02:58 | INFO | train rank=0 | step=46880/50000 progress=93.8% loss=0.071325 lr=1.060767e-06 lr_backbone=1.060767e-06 elapsed=47:55:40 avg_step=3.68s recent_step=3.54s eta=03:11:23
|
| 4699 |
+
2026-09-25 17:03:43 | INFO | train rank=0 | step=46890/50000 progress=93.8% loss=0.093415 lr=1.054002e-06 lr_backbone=1.054002e-06 elapsed=47:56:25 avg_step=3.68s recent_step=4.50s eta=03:10:46
|
| 4700 |
+
2026-09-25 17:04:11 | INFO | train rank=0 | step=46900/50000 progress=93.8% loss=0.089540 lr=1.047259e-06 lr_backbone=1.047259e-06 elapsed=47:56:53 avg_step=3.68s recent_step=2.76s eta=03:10:09
|
| 4701 |
+
2026-09-25 17:04:42 | INFO | train rank=0 | step=46910/50000 progress=93.8% loss=0.086984 lr=1.040537e-06 lr_backbone=1.040537e-06 elapsed=47:57:24 avg_step=3.68s recent_step=3.07s eta=03:09:32
|
| 4702 |
+
2026-09-25 17:05:08 | INFO | train rank=0 | step=46920/50000 progress=93.8% loss=0.091927 lr=1.033836e-06 lr_backbone=1.033836e-06 elapsed=47:57:50 avg_step=3.68s recent_step=2.66s eta=03:08:54
|
| 4703 |
+
2026-09-25 17:05:53 | INFO | train rank=0 | step=46930/50000 progress=93.9% loss=0.073208 lr=1.027157e-06 lr_backbone=1.027157e-06 elapsed=47:58:35 avg_step=3.68s recent_step=4.48s eta=03:08:18
|
| 4704 |
+
2026-09-25 17:06:17 | INFO | train rank=0 | step=46940/50000 progress=93.9% loss=0.090728 lr=1.020499e-06 lr_backbone=1.020499e-06 elapsed=47:58:59 avg_step=3.68s recent_step=2.35s eta=03:07:40
|
| 4705 |
+
2026-09-25 17:06:46 | INFO | train rank=0 | step=46950/50000 progress=93.9% loss=0.069807 lr=1.013862e-06 lr_backbone=1.013862e-06 elapsed=47:59:28 avg_step=3.68s recent_step=2.90s eta=03:07:03
|
| 4706 |
+
2026-09-25 17:07:25 | INFO | train rank=0 | step=46960/50000 progress=93.9% loss=0.087164 lr=1.007247e-06 lr_backbone=1.007247e-06 elapsed=48:00:07 avg_step=3.68s recent_step=3.90s eta=03:06:26
|
| 4707 |
+
2026-09-25 17:08:26 | INFO | train rank=0 | step=46970/50000 progress=93.9% loss=0.080754 lr=1.000654e-06 lr_backbone=1.000654e-06 elapsed=48:01:08 avg_step=3.68s recent_step=6.15s eta=03:05:51
|
| 4708 |
+
2026-09-25 17:08:59 | INFO | train rank=0 | step=46980/50000 progress=94.0% loss=0.081587 lr=9.940817e-07 lr_backbone=9.940817e-07 elapsed=48:01:41 avg_step=3.68s recent_step=3.33s eta=03:05:14
|
| 4709 |
+
2026-09-25 17:09:35 | INFO | train rank=0 | step=46990/50000 progress=94.0% loss=0.077603 lr=9.875310e-07 lr_backbone=9.875310e-07 elapsed=48:02:17 avg_step=3.68s recent_step=3.58s eta=03:04:37
|
| 4710 |
+
2026-09-25 17:10:11 | INFO | train rank=0 | step=47000/50000 progress=94.0% loss=0.078168 lr=9.810017e-07 lr_backbone=9.810017e-07 elapsed=48:02:53 avg_step=3.68s recent_step=3.58s eta=03:04:00
|
| 4711 |
+
2026-09-25 17:10:43 | INFO | train rank=0 | step=47010/50000 progress=94.0% loss=0.076215 lr=9.744939e-07 lr_backbone=9.744939e-07 elapsed=48:03:25 avg_step=3.68s recent_step=3.16s eta=03:03:23
|
| 4712 |
+
2026-09-25 17:11:22 | INFO | train rank=0 | step=47020/50000 progress=94.0% loss=0.097152 lr=9.680075e-07 lr_backbone=9.680075e-07 elapsed=48:04:04 avg_step=3.68s recent_step=3.95s eta=03:02:47
|
| 4713 |
+
2026-09-25 17:11:59 | INFO | train rank=0 | step=47030/50000 progress=94.1% loss=0.097942 lr=9.615426e-07 lr_backbone=9.615426e-07 elapsed=48:04:41 avg_step=3.68s recent_step=3.68s eta=03:02:10
|
| 4714 |
+
2026-09-25 17:12:30 | INFO | train rank=0 | step=47040/50000 progress=94.1% loss=0.106666 lr=9.550991e-07 lr_backbone=9.550991e-07 elapsed=48:05:12 avg_step=3.68s recent_step=3.09s eta=03:01:33
|
| 4715 |
+
2026-09-25 17:13:13 | INFO | train rank=0 | step=47050/50000 progress=94.1% loss=0.082119 lr=9.486771e-07 lr_backbone=9.486771e-07 elapsed=48:05:55 avg_step=3.68s recent_step=4.37s eta=03:00:56
|
| 4716 |
+
2026-09-25 17:13:51 | INFO | train rank=0 | step=47060/50000 progress=94.1% loss=0.107510 lr=9.422765e-07 lr_backbone=9.422765e-07 elapsed=48:06:33 avg_step=3.68s recent_step=3.73s eta=03:00:19
|
| 4717 |
+
2026-09-25 17:14:21 | INFO | train rank=0 | step=47070/50000 progress=94.1% loss=0.080989 lr=9.358974e-07 lr_backbone=9.358974e-07 elapsed=48:07:04 avg_step=3.68s recent_step=3.08s eta=02:59:42
|
| 4718 |
+
2026-09-25 17:14:57 | INFO | train rank=0 | step=47080/50000 progress=94.2% loss=0.122306 lr=9.295398e-07 lr_backbone=9.295398e-07 elapsed=48:07:39 avg_step=3.68s recent_step=3.51s eta=02:59:05
|
| 4719 |
+
2026-09-25 17:15:39 | INFO | train rank=0 | step=47090/50000 progress=94.2% loss=0.091931 lr=9.232036e-07 lr_backbone=9.232036e-07 elapsed=48:08:21 avg_step=3.68s recent_step=4.25s eta=02:58:29
|
| 4720 |
+
2026-09-25 17:16:08 | INFO | train rank=0 | step=47100/50000 progress=94.2% loss=0.089521 lr=9.168889e-07 lr_backbone=9.168889e-07 elapsed=48:08:50 avg_step=3.68s recent_step=2.85s eta=02:57:52
|
| 4721 |
+
2026-09-25 17:16:41 | INFO | train rank=0 | step=47110/50000 progress=94.2% loss=0.084971 lr=9.105957e-07 lr_backbone=9.105957e-07 elapsed=48:09:23 avg_step=3.68s recent_step=3.37s eta=02:57:15
|
| 4722 |
+
2026-09-25 17:17:05 | INFO | train rank=0 | step=47120/50000 progress=94.2% loss=0.081781 lr=9.043239e-07 lr_backbone=9.043239e-07 elapsed=48:09:47 avg_step=3.68s recent_step=2.39s eta=02:56:37
|
| 4723 |
+
2026-09-25 17:17:50 | INFO | train rank=0 | step=47130/50000 progress=94.3% loss=0.138833 lr=8.980736e-07 lr_backbone=8.980736e-07 elapsed=48:10:32 avg_step=3.68s recent_step=4.44s eta=02:56:01
|
| 4724 |
+
2026-09-25 17:18:23 | INFO | train rank=0 | step=47140/50000 progress=94.3% loss=0.071737 lr=8.918448e-07 lr_backbone=8.918448e-07 elapsed=48:11:05 avg_step=3.68s recent_step=3.32s eta=02:55:24
|
| 4725 |
+
2026-09-25 17:18:54 | INFO | train rank=0 | step=47150/50000 progress=94.3% loss=0.077738 lr=8.856375e-07 lr_backbone=8.856375e-07 elapsed=48:11:37 avg_step=3.68s recent_step=3.16s eta=02:54:47
|
| 4726 |
+
2026-09-25 17:19:34 | INFO | train rank=0 | step=47160/50000 progress=94.3% loss=0.077795 lr=8.794516e-07 lr_backbone=8.794516e-07 elapsed=48:12:16 avg_step=3.68s recent_step=3.96s eta=02:54:10
|
| 4727 |
+
2026-09-25 17:20:31 | INFO | train rank=0 | step=47170/50000 progress=94.3% loss=0.062755 lr=8.732873e-07 lr_backbone=8.732873e-07 elapsed=48:13:13 avg_step=3.68s recent_step=5.65s eta=02:53:34
|
| 4728 |
+
2026-09-25 17:20:59 | INFO | train rank=0 | step=47180/50000 progress=94.4% loss=0.092787 lr=8.671444e-07 lr_backbone=8.671444e-07 elapsed=48:13:41 avg_step=3.68s recent_step=2.79s eta=02:52:57
|
| 4729 |
+
2026-09-25 17:21:34 | INFO | train rank=0 | step=47190/50000 progress=94.4% loss=0.082726 lr=8.610230e-07 lr_backbone=8.610230e-07 elapsed=48:14:16 avg_step=3.68s recent_step=3.55s eta=02:52:20
|
| 4730 |
+
2026-09-25 17:22:01 | INFO | train rank=0 | step=47200/50000 progress=94.4% loss=0.095472 lr=8.549231e-07 lr_backbone=8.549231e-07 elapsed=48:14:43 avg_step=3.68s recent_step=2.65s eta=02:51:43
|
| 4731 |
+
2026-09-25 17:22:49 | INFO | train rank=0 | step=47210/50000 progress=94.4% loss=0.087671 lr=8.488448e-07 lr_backbone=8.488448e-07 elapsed=48:15:31 avg_step=3.68s recent_step=4.80s eta=02:51:07
|
| 4732 |
+
2026-09-25 17:23:27 | INFO | train rank=0 | step=47220/50000 progress=94.4% loss=0.094230 lr=8.427879e-07 lr_backbone=8.427879e-07 elapsed=48:16:09 avg_step=3.68s recent_step=3.83s eta=02:50:30
|
| 4733 |
+
2026-09-25 17:23:56 | INFO | train rank=0 | step=47230/50000 progress=94.5% loss=0.102861 lr=8.367525e-07 lr_backbone=8.367525e-07 elapsed=48:16:38 avg_step=3.68s recent_step=2.94s eta=02:49:53
|
| 4734 |
+
2026-09-25 17:24:32 | INFO | train rank=0 | step=47240/50000 progress=94.5% loss=0.079501 lr=8.307386e-07 lr_backbone=8.307386e-07 elapsed=48:17:14 avg_step=3.68s recent_step=3.60s eta=02:49:16
|
| 4735 |
+
2026-09-25 17:25:24 | INFO | train rank=0 | step=47250/50000 progress=94.5% loss=0.074131 lr=8.247463e-07 lr_backbone=8.247463e-07 elapsed=48:18:06 avg_step=3.68s recent_step=5.19s eta=02:48:40
|
| 4736 |
+
2026-09-25 17:25:52 | INFO | train rank=0 | step=47260/50000 progress=94.5% loss=0.074305 lr=8.187754e-07 lr_backbone=8.187754e-07 elapsed=48:18:34 avg_step=3.68s recent_step=2.73s eta=02:48:03
|
| 4737 |
+
2026-09-25 17:26:20 | INFO | train rank=0 | step=47270/50000 progress=94.5% loss=0.077347 lr=8.128261e-07 lr_backbone=8.128261e-07 elapsed=48:19:03 avg_step=3.68s recent_step=2.89s eta=02:47:25
|
| 4738 |
+
2026-09-25 17:26:49 | INFO | train rank=0 | step=47280/50000 progress=94.6% loss=0.113898 lr=8.068982e-07 lr_backbone=8.068982e-07 elapsed=48:19:31 avg_step=3.68s recent_step=2.83s eta=02:46:48
|
| 4739 |
+
2026-09-25 17:27:30 | INFO | train rank=0 | step=47290/50000 progress=94.6% loss=0.090359 lr=8.009919e-07 lr_backbone=8.009919e-07 elapsed=48:20:12 avg_step=3.68s recent_step=4.16s eta=02:46:11
|
| 4740 |
+
2026-09-25 17:28:05 | INFO | train rank=0 | step=47300/50000 progress=94.6% loss=0.073203 lr=7.951071e-07 lr_backbone=7.951071e-07 elapsed=48:20:48 avg_step=3.68s recent_step=3.51s eta=02:45:35
|
| 4741 |
+
2026-09-25 17:28:47 | INFO | train rank=0 | step=47310/50000 progress=94.6% loss=0.082295 lr=7.892439e-07 lr_backbone=7.892439e-07 elapsed=48:21:30 avg_step=3.68s recent_step=4.21s eta=02:44:58
|
| 4742 |
+
2026-09-25 17:29:19 | INFO | train rank=0 | step=47320/50000 progress=94.6% loss=0.091381 lr=7.834022e-07 lr_backbone=7.834022e-07 elapsed=48:22:01 avg_step=3.68s recent_step=3.17s eta=02:44:21
|
| 4743 |
+
2026-09-25 17:30:14 | INFO | train rank=0 | step=47330/50000 progress=94.7% loss=0.076409 lr=7.775819e-07 lr_backbone=7.775819e-07 elapsed=48:22:56 avg_step=3.68s recent_step=5.51s eta=02:43:45
|
| 4744 |
+
2026-09-25 17:30:46 | INFO | train rank=0 | step=47340/50000 progress=94.7% loss=0.084113 lr=7.717833e-07 lr_backbone=7.717833e-07 elapsed=48:23:28 avg_step=3.68s recent_step=3.14s eta=02:43:08
|
| 4745 |
+
2026-09-25 17:31:23 | INFO | train rank=0 | step=47350/50000 progress=94.7% loss=0.085187 lr=7.660061e-07 lr_backbone=7.660061e-07 elapsed=48:24:05 avg_step=3.68s recent_step=3.74s eta=02:42:31
|
| 4746 |
+
2026-09-25 17:31:53 | INFO | train rank=0 | step=47360/50000 progress=94.7% loss=0.111039 lr=7.602505e-07 lr_backbone=7.602505e-07 elapsed=48:24:35 avg_step=3.68s recent_step=3.00s eta=02:41:54
|
| 4747 |
+
2026-09-25 17:32:44 | INFO | train rank=0 | step=47370/50000 progress=94.7% loss=0.072407 lr=7.545165e-07 lr_backbone=7.545165e-07 elapsed=48:25:26 avg_step=3.68s recent_step=5.05s eta=02:41:18
|
| 4748 |
+
2026-09-25 17:33:18 | INFO | train rank=0 | step=47380/50000 progress=94.8% loss=0.098539 lr=7.488039e-07 lr_backbone=7.488039e-07 elapsed=48:26:00 avg_step=3.68s recent_step=3.42s eta=02:40:41
|
| 4749 |
+
2026-09-25 17:33:48 | INFO | train rank=0 | step=47390/50000 progress=94.8% loss=0.060736 lr=7.431130e-07 lr_backbone=7.431130e-07 elapsed=48:26:30 avg_step=3.68s recent_step=2.98s eta=02:40:04
|
| 4750 |
+
2026-09-25 17:34:19 | INFO | train rank=0 | step=47400/50000 progress=94.8% loss=0.095713 lr=7.374435e-07 lr_backbone=7.374435e-07 elapsed=48:27:01 avg_step=3.68s recent_step=3.17s eta=02:39:27
|
| 4751 |
+
2026-09-25 17:35:04 | INFO | train rank=0 | step=47410/50000 progress=94.8% loss=0.088418 lr=7.317957e-07 lr_backbone=7.317957e-07 elapsed=48:27:46 avg_step=3.68s recent_step=4.50s eta=02:38:51
|
| 4752 |
+
2026-09-25 17:35:46 | INFO | train rank=0 | step=47420/50000 progress=94.8% loss=0.073921 lr=7.261693e-07 lr_backbone=7.261693e-07 elapsed=48:28:28 avg_step=3.68s recent_step=4.16s eta=02:38:14
|
| 4753 |
+
2026-09-25 17:36:16 | INFO | train rank=0 | step=47430/50000 progress=94.9% loss=0.087544 lr=7.205645e-07 lr_backbone=7.205645e-07 elapsed=48:28:58 avg_step=3.68s recent_step=3.04s eta=02:37:37
|
| 4754 |
+
2026-09-25 17:36:47 | INFO | train rank=0 | step=47440/50000 progress=94.9% loss=0.080941 lr=7.149813e-07 lr_backbone=7.149813e-07 elapsed=48:29:29 avg_step=3.68s recent_step=3.09s eta=02:37:00
|
| 4755 |
+
2026-09-25 17:37:37 | INFO | train rank=0 | step=47450/50000 progress=94.9% loss=0.097078 lr=7.094197e-07 lr_backbone=7.094197e-07 elapsed=48:30:19 avg_step=3.68s recent_step=4.99s eta=02:36:24
|
| 4756 |
+
2026-09-25 17:38:17 | INFO | train rank=0 | step=47460/50000 progress=94.9% loss=0.076843 lr=7.038796e-07 lr_backbone=7.038796e-07 elapsed=48:30:59 avg_step=3.68s recent_step=4.00s eta=02:35:47
|
| 4757 |
+
2026-09-25 17:38:45 | INFO | train rank=0 | step=47470/50000 progress=94.9% loss=0.105511 lr=6.983610e-07 lr_backbone=6.983610e-07 elapsed=48:31:27 avg_step=3.68s recent_step=2.80s eta=02:35:10
|
| 4758 |
+
2026-09-25 17:39:12 | INFO | train rank=0 | step=47480/50000 progress=95.0% loss=0.080297 lr=6.928641e-07 lr_backbone=6.928641e-07 elapsed=48:31:54 avg_step=3.68s recent_step=2.72s eta=02:34:32
|
| 4759 |
+
2026-09-25 17:40:02 | INFO | train rank=0 | step=47490/50000 progress=95.0% loss=0.084706 lr=6.873887e-07 lr_backbone=6.873887e-07 elapsed=48:32:44 avg_step=3.68s recent_step=5.00s eta=02:33:56
|
| 4760 |
+
2026-09-25 17:40:35 | INFO | train rank=0 | step=47500/50000 progress=95.0% loss=0.086510 lr=6.819348e-07 lr_backbone=6.819348e-07 elapsed=48:33:17 avg_step=3.68s recent_step=3.28s eta=02:33:19
|
| 4761 |
+
2026-09-25 17:41:14 | INFO | train rank=0 | step=47510/50000 progress=95.0% loss=0.079491 lr=6.765026e-07 lr_backbone=6.765026e-07 elapsed=48:33:56 avg_step=3.68s recent_step=3.93s eta=02:32:43
|
| 4762 |
+
2026-09-25 17:41:46 | INFO | train rank=0 | step=47520/50000 progress=95.0% loss=0.077871 lr=6.710919e-07 lr_backbone=6.710919e-07 elapsed=48:34:28 avg_step=3.68s recent_step=3.18s eta=02:32:06
|
| 4763 |
+
2026-09-25 17:42:36 | INFO | train rank=0 | step=47530/50000 progress=95.1% loss=0.074909 lr=6.657028e-07 lr_backbone=6.657028e-07 elapsed=48:35:18 avg_step=3.68s recent_step=5.02s eta=02:31:30
|
| 4764 |
+
2026-09-25 17:43:05 | INFO | train rank=0 | step=47540/50000 progress=95.1% loss=0.080882 lr=6.603353e-07 lr_backbone=6.603353e-07 elapsed=48:35:48 avg_step=3.68s recent_step=2.91s eta=02:30:52
|
| 4765 |
+
2026-09-25 17:43:42 | INFO | train rank=0 | step=47550/50000 progress=95.1% loss=0.061628 lr=6.549893e-07 lr_backbone=6.549893e-07 elapsed=48:36:24 avg_step=3.68s recent_step=3.62s eta=02:30:16
|
| 4766 |
+
2026-09-25 17:44:16 | INFO | train rank=0 | step=47560/50000 progress=95.1% loss=0.087009 lr=6.496650e-07 lr_backbone=6.496650e-07 elapsed=48:36:59 avg_step=3.68s recent_step=3.48s eta=02:29:39
|
| 4767 |
+
2026-09-25 17:44:58 | INFO | train rank=0 | step=47570/50000 progress=95.1% loss=0.083700 lr=6.443622e-07 lr_backbone=6.443622e-07 elapsed=48:37:40 avg_step=3.68s recent_step=4.15s eta=02:29:02
|
| 4768 |
+
2026-09-25 17:45:25 | INFO | train rank=0 | step=47580/50000 progress=95.2% loss=0.075810 lr=6.390810e-07 lr_backbone=6.390810e-07 elapsed=48:38:07 avg_step=3.68s recent_step=2.74s eta=02:28:25
|
| 4769 |
+
2026-09-25 17:45:57 | INFO | train rank=0 | step=47590/50000 progress=95.2% loss=0.080124 lr=6.338214e-07 lr_backbone=6.338214e-07 elapsed=48:38:39 avg_step=3.68s recent_step=3.14s eta=02:27:48
|
| 4770 |
+
2026-09-25 17:46:25 | INFO | train rank=0 | step=47600/50000 progress=95.2% loss=0.090462 lr=6.285835e-07 lr_backbone=6.285835e-07 elapsed=48:39:08 avg_step=3.68s recent_step=2.87s eta=02:27:10
|
| 4771 |
+
2026-09-25 17:47:16 | INFO | train rank=0 | step=47610/50000 progress=95.2% loss=0.084582 lr=6.233671e-07 lr_backbone=6.233671e-07 elapsed=48:39:58 avg_step=3.68s recent_step=5.08s eta=02:26:34
|
| 4772 |
+
2026-09-25 17:47:49 | INFO | train rank=0 | step=47620/50000 progress=95.2% loss=0.096733 lr=6.181723e-07 lr_backbone=6.181723e-07 elapsed=48:40:31 avg_step=3.68s recent_step=3.27s eta=02:25:57
|
| 4773 |
+
2026-09-25 17:48:28 | INFO | train rank=0 | step=47630/50000 progress=95.3% loss=0.068783 lr=6.129991e-07 lr_backbone=6.129991e-07 elapsed=48:41:10 avg_step=3.68s recent_step=3.94s eta=02:25:21
|
| 4774 |
+
2026-09-25 17:48:59 | INFO | train rank=0 | step=47640/50000 progress=95.3% loss=0.071851 lr=6.078475e-07 lr_backbone=6.078475e-07 elapsed=48:41:42 avg_step=3.68s recent_step=3.11s eta=02:24:44
|
| 4775 |
+
2026-09-25 17:49:42 | INFO | train rank=0 | step=47650/50000 progress=95.3% loss=0.081344 lr=6.027175e-07 lr_backbone=6.027175e-07 elapsed=48:42:24 avg_step=3.68s recent_step=4.22s eta=02:24:07
|
| 4776 |
+
2026-09-25 17:50:13 | INFO | train rank=0 | step=47660/50000 progress=95.3% loss=0.075091 lr=5.976091e-07 lr_backbone=5.976091e-07 elapsed=48:42:55 avg_step=3.68s recent_step=3.16s eta=02:23:30
|
| 4777 |
+
2026-09-25 17:50:42 | INFO | train rank=0 | step=47670/50000 progress=95.3% loss=0.093499 lr=5.925224e-07 lr_backbone=5.925224e-07 elapsed=48:43:24 avg_step=3.68s recent_step=2.85s eta=02:22:53
|
| 4778 |
+
2026-09-25 17:51:08 | INFO | train rank=0 | step=47680/50000 progress=95.4% loss=0.072929 lr=5.874572e-07 lr_backbone=5.874572e-07 elapsed=48:43:50 avg_step=3.68s recent_step=2.61s eta=02:22:16
|
| 4779 |
+
2026-09-25 17:51:54 | INFO | train rank=0 | step=47690/50000 progress=95.4% loss=0.080538 lr=5.824137e-07 lr_backbone=5.824137e-07 elapsed=48:44:37 avg_step=3.68s recent_step=4.66s eta=02:21:39
|
| 4780 |
+
2026-09-25 17:52:28 | INFO | train rank=0 | step=47700/50000 progress=95.4% loss=0.067470 lr=5.773917e-07 lr_backbone=5.773917e-07 elapsed=48:45:10 avg_step=3.68s recent_step=3.37s eta=02:21:02
|
| 4781 |
+
2026-09-25 17:52:59 | INFO | train rank=0 | step=47710/50000 progress=95.4% loss=0.070077 lr=5.723914e-07 lr_backbone=5.723914e-07 elapsed=48:45:41 avg_step=3.68s recent_step=3.04s eta=02:20:25
|
| 4782 |
+
2026-09-25 17:53:30 | INFO | train rank=0 | step=47720/50000 progress=95.4% loss=0.082775 lr=5.674128e-07 lr_backbone=5.674128e-07 elapsed=48:46:12 avg_step=3.68s recent_step=3.10s eta=02:19:48
|
| 4783 |
+
2026-09-25 17:54:21 | INFO | train rank=0 | step=47730/50000 progress=95.5% loss=0.089978 lr=5.624557e-07 lr_backbone=5.624557e-07 elapsed=48:47:04 avg_step=3.68s recent_step=5.18s eta=02:19:12
|
| 4784 |
+
2026-09-25 17:54:54 | INFO | train rank=0 | step=47740/50000 progress=95.5% loss=0.101625 lr=5.575203e-07 lr_backbone=5.575203e-07 elapsed=48:47:36 avg_step=3.68s recent_step=3.29s eta=02:18:35
|
| 4785 |
+
2026-09-25 17:55:20 | INFO | train rank=0 | step=47750/50000 progress=95.5% loss=0.076686 lr=5.526065e-07 lr_backbone=5.526065e-07 elapsed=48:48:02 avg_step=3.68s recent_step=2.57s eta=02:17:58
|
| 4786 |
+
2026-09-25 17:55:55 | INFO | train rank=0 | step=47760/50000 progress=95.5% loss=0.088980 lr=5.477143e-07 lr_backbone=5.477143e-07 elapsed=48:48:37 avg_step=3.68s recent_step=3.48s eta=02:17:21
|
| 4787 |
+
2026-09-25 17:56:24 | INFO | train rank=0 | step=47770/50000 progress=95.5% loss=0.091125 lr=5.428438e-07 lr_backbone=5.428438e-07 elapsed=48:49:06 avg_step=3.68s recent_step=2.93s eta=02:16:44
|
| 4788 |
+
2026-09-25 17:57:01 | INFO | train rank=0 | step=47780/50000 progress=95.6% loss=0.079573 lr=5.379948e-07 lr_backbone=5.379948e-07 elapsed=48:49:43 avg_step=3.68s recent_step=3.71s eta=02:16:07
|
| 4789 |
+
2026-09-25 17:57:34 | INFO | train rank=0 | step=47790/50000 progress=95.6% loss=0.103283 lr=5.331676e-07 lr_backbone=5.331676e-07 elapsed=48:50:16 avg_step=3.68s recent_step=3.25s eta=02:15:30
|
| 4790 |
+
2026-09-25 17:58:11 | INFO | train rank=0 | step=47800/50000 progress=95.6% loss=0.091507 lr=5.283619e-07 lr_backbone=5.283619e-07 elapsed=48:50:53 avg_step=3.68s recent_step=3.76s eta=02:14:53
|
| 4791 |
+
2026-09-25 17:58:53 | INFO | train rank=0 | step=47810/50000 progress=95.6% loss=0.100526 lr=5.235780e-07 lr_backbone=5.235780e-07 elapsed=48:51:35 avg_step=3.68s recent_step=4.16s eta=02:14:17
|
| 4792 |
+
2026-09-25 17:59:26 | INFO | train rank=0 | step=47820/50000 progress=95.6% loss=0.074395 lr=5.188156e-07 lr_backbone=5.188156e-07 elapsed=48:52:08 avg_step=3.68s recent_step=3.30s eta=02:13:40
|
| 4793 |
+
2026-09-25 18:00:06 | INFO | train rank=0 | step=47830/50000 progress=95.7% loss=0.094161 lr=5.140749e-07 lr_backbone=5.140749e-07 elapsed=48:52:48 avg_step=3.68s recent_step=4.00s eta=02:13:03
|
| 4794 |
+
2026-09-25 18:00:52 | INFO | train rank=0 | step=47840/50000 progress=95.7% loss=0.070038 lr=5.093558e-07 lr_backbone=5.093558e-07 elapsed=48:53:35 avg_step=3.68s recent_step=4.66s eta=02:12:27
|
| 4795 |
+
2026-09-25 18:01:24 | INFO | train rank=0 | step=47850/50000 progress=95.7% loss=0.076601 lr=5.046584e-07 lr_backbone=5.046584e-07 elapsed=48:54:06 avg_step=3.68s recent_step=3.12s eta=02:11:50
|
| 4796 |
+
2026-09-25 18:01:58 | INFO | train rank=0 | step=47860/50000 progress=95.7% loss=0.095648 lr=4.999827e-07 lr_backbone=4.999827e-07 elapsed=48:54:40 avg_step=3.68s recent_step=3.41s eta=02:11:13
|
| 4797 |
+
2026-09-25 18:02:26 | INFO | train rank=0 | step=47870/50000 progress=95.7% loss=0.087670 lr=4.953286e-07 lr_backbone=4.953286e-07 elapsed=48:55:08 avg_step=3.68s recent_step=2.81s eta=02:10:36
|
| 4798 |
+
2026-09-25 18:03:19 | INFO | train rank=0 | step=47880/50000 progress=95.8% loss=0.126861 lr=4.906961e-07 lr_backbone=4.906961e-07 elapsed=48:56:01 avg_step=3.68s recent_step=5.31s eta=02:09:59
|
| 4799 |
+
2026-09-25 18:03:56 | INFO | train rank=0 | step=47890/50000 progress=95.8% loss=0.089952 lr=4.860853e-07 lr_backbone=4.860853e-07 elapsed=48:56:38 avg_step=3.68s recent_step=3.71s eta=02:09:23
|
| 4800 |
+
2026-09-25 18:04:34 | INFO | train rank=0 | step=47900/50000 progress=95.8% loss=0.077825 lr=4.814962e-07 lr_backbone=4.814962e-07 elapsed=48:57:16 avg_step=3.68s recent_step=3.79s eta=02:08:46
|
| 4801 |
+
2026-09-25 18:05:08 | INFO | train rank=0 | step=47910/50000 progress=95.8% loss=0.101610 lr=4.769287e-07 lr_backbone=4.769287e-07 elapsed=48:57:50 avg_step=3.68s recent_step=3.38s eta=02:08:09
|
| 4802 |
+
2026-09-25 18:05:58 | INFO | train rank=0 | step=47920/50000 progress=95.8% loss=0.073255 lr=4.723829e-07 lr_backbone=4.723829e-07 elapsed=48:58:40 avg_step=3.68s recent_step=5.03s eta=02:07:33
|
| 4803 |
+
2026-09-25 18:06:27 | INFO | train rank=0 | step=47930/50000 progress=95.9% loss=0.083102 lr=4.678588e-07 lr_backbone=4.678588e-07 elapsed=48:59:09 avg_step=3.68s recent_step=2.87s eta=02:06:56
|
| 4804 |
+
2026-09-25 18:07:04 | INFO | train rank=0 | step=47940/50000 progress=95.9% loss=0.089161 lr=4.633563e-07 lr_backbone=4.633563e-07 elapsed=48:59:46 avg_step=3.68s recent_step=3.74s eta=02:06:19
|
| 4805 |
+
2026-09-25 18:07:37 | INFO | train rank=0 | step=47950/50000 progress=95.9% loss=0.097565 lr=4.588755e-07 lr_backbone=4.588755e-07 elapsed=49:00:19 avg_step=3.68s recent_step=3.30s eta=02:05:42
|
| 4806 |
+
2026-09-25 18:08:22 | INFO | train rank=0 | step=47960/50000 progress=95.9% loss=0.075529 lr=4.544163e-07 lr_backbone=4.544163e-07 elapsed=49:01:04 avg_step=3.68s recent_step=4.46s eta=02:05:05
|
| 4807 |
+
2026-09-25 18:08:52 | INFO | train rank=0 | step=47970/50000 progress=95.9% loss=0.089899 lr=4.499789e-07 lr_backbone=4.499789e-07 elapsed=49:01:34 avg_step=3.68s recent_step=3.06s eta=02:04:28
|
| 4808 |
+
2026-09-25 18:09:24 | INFO | train rank=0 | step=47980/50000 progress=96.0% loss=0.087753 lr=4.455631e-07 lr_backbone=4.455631e-07 elapsed=49:02:06 avg_step=3.68s recent_step=3.16s eta=02:03:51
|
| 4809 |
+
2026-09-25 18:09:58 | INFO | train rank=0 | step=47990/50000 progress=96.0% loss=0.090018 lr=4.411690e-07 lr_backbone=4.411690e-07 elapsed=49:02:40 avg_step=3.68s recent_step=3.43s eta=02:03:15
|
| 4810 |
+
2026-09-25 18:10:54 | INFO | train rank=0 | step=48000/50000 progress=96.0% loss=0.065093 lr=4.367965e-07 lr_backbone=4.367965e-07 elapsed=49:03:36 avg_step=3.68s recent_step=5.55s eta=02:02:39
|
| 4811 |
+
2026-09-25 18:11:25 | INFO | train rank=0 | step=48010/50000 progress=96.0% loss=0.072766 lr=4.324458e-07 lr_backbone=4.324458e-07 elapsed=49:04:07 avg_step=3.68s recent_step=3.15s eta=02:02:01
|
| 4812 |
+
2026-09-25 18:11:49 | INFO | train rank=0 | step=48020/50000 progress=96.0% loss=0.066684 lr=4.281167e-07 lr_backbone=4.281167e-07 elapsed=49:04:31 avg_step=3.68s recent_step=2.35s eta=02:01:24
|
| 4813 |
+
2026-09-25 18:12:31 | INFO | train rank=0 | step=48030/50000 progress=96.1% loss=0.093431 lr=4.238093e-07 lr_backbone=4.238093e-07 elapsed=49:05:13 avg_step=3.68s recent_step=4.20s eta=02:00:48
|
| 4814 |
+
2026-09-25 18:13:19 | INFO | train rank=0 | step=48040/50000 progress=96.1% loss=0.084093 lr=4.195236e-07 lr_backbone=4.195236e-07 elapsed=49:06:01 avg_step=3.68s recent_step=4.79s eta=02:00:11
|
| 4815 |
+
2026-09-25 18:13:51 | INFO | train rank=0 | step=48050/50000 progress=96.1% loss=0.067688 lr=4.152596e-07 lr_backbone=4.152596e-07 elapsed=49:06:33 avg_step=3.68s recent_step=3.22s eta=01:59:34
|
| 4816 |
+
2026-09-25 18:14:13 | INFO | train rank=0 | step=48060/50000 progress=96.1% loss=0.080759 lr=4.110173e-07 lr_backbone=4.110173e-07 elapsed=49:06:55 avg_step=3.68s recent_step=2.25s eta=01:58:57
|
| 4817 |
+
2026-09-25 18:14:43 | INFO | train rank=0 | step=48070/50000 progress=96.1% loss=0.075274 lr=4.067967e-07 lr_backbone=4.067967e-07 elapsed=49:07:25 avg_step=3.68s recent_step=2.94s eta=01:58:20
|
| 4818 |
+
2026-09-25 18:15:35 | INFO | train rank=0 | step=48080/50000 progress=96.2% loss=0.098743 lr=4.025977e-07 lr_backbone=4.025977e-07 elapsed=49:08:18 avg_step=3.68s recent_step=5.28s eta=01:57:44
|
| 4819 |
+
2026-09-25 18:16:11 | INFO | train rank=0 | step=48090/50000 progress=96.2% loss=0.078103 lr=3.984205e-07 lr_backbone=3.984205e-07 elapsed=49:08:53 avg_step=3.68s recent_step=3.54s eta=01:57:07
|
| 4820 |
+
2026-09-25 18:16:38 | INFO | train rank=0 | step=48100/50000 progress=96.2% loss=0.077020 lr=3.942649e-07 lr_backbone=3.942649e-07 elapsed=49:09:20 avg_step=3.68s recent_step=2.73s eta=01:56:30
|
| 4821 |
+
2026-09-25 18:17:07 | INFO | train rank=0 | step=48110/50000 progress=96.2% loss=0.073915 lr=3.901311e-07 lr_backbone=3.901311e-07 elapsed=49:09:49 avg_step=3.68s recent_step=2.88s eta=01:55:53
|
| 4822 |
+
2026-09-25 18:17:57 | INFO | train rank=0 | step=48120/50000 progress=96.2% loss=0.088395 lr=3.860189e-07 lr_backbone=3.860189e-07 elapsed=49:10:40 avg_step=3.68s recent_step=5.05s eta=01:55:16
|
| 4823 |
+
2026-09-25 18:18:25 | INFO | train rank=0 | step=48130/50000 progress=96.3% loss=0.086041 lr=3.819285e-07 lr_backbone=3.819285e-07 elapsed=49:11:07 avg_step=3.68s recent_step=2.78s eta=01:54:39
|
| 4824 |
+
2026-09-25 18:18:59 | INFO | train rank=0 | step=48140/50000 progress=96.3% loss=0.056158 lr=3.778598e-07 lr_backbone=3.778598e-07 elapsed=49:11:41 avg_step=3.68s recent_step=3.37s eta=01:54:02
|
| 4825 |
+
2026-09-25 18:19:40 | INFO | train rank=0 | step=48150/50000 progress=96.3% loss=0.081847 lr=3.738127e-07 lr_backbone=3.738127e-07 elapsed=49:12:22 avg_step=3.68s recent_step=4.08s eta=01:53:26
|
| 4826 |
+
2026-09-25 18:20:24 | INFO | train rank=0 | step=48160/50000 progress=96.3% loss=0.119980 lr=3.697874e-07 lr_backbone=3.697874e-07 elapsed=49:13:06 avg_step=3.68s recent_step=4.43s eta=01:52:49
|
| 4827 |
+
2026-09-25 18:20:52 | INFO | train rank=0 | step=48170/50000 progress=96.3% loss=0.080690 lr=3.657838e-07 lr_backbone=3.657838e-07 elapsed=49:13:34 avg_step=3.68s recent_step=2.78s eta=01:52:12
|
| 4828 |
+
2026-09-25 18:21:22 | INFO | train rank=0 | step=48180/50000 progress=96.4% loss=0.077171 lr=3.618019e-07 lr_backbone=3.618019e-07 elapsed=49:14:05 avg_step=3.68s recent_step=3.06s eta=01:51:35
|
| 4829 |
+
2026-09-25 18:22:03 | INFO | train rank=0 | step=48190/50000 progress=96.4% loss=0.069462 lr=3.578417e-07 lr_backbone=3.578417e-07 elapsed=49:14:45 avg_step=3.68s recent_step=4.08s eta=01:50:58
|
| 4830 |
+
2026-09-25 18:22:53 | INFO | train rank=0 | step=48200/50000 progress=96.4% loss=0.083061 lr=3.539033e-07 lr_backbone=3.539033e-07 elapsed=49:15:35 avg_step=3.68s recent_step=4.93s eta=01:50:22
|
| 4831 |
+
2026-09-25 18:23:21 | INFO | train rank=0 | step=48210/50000 progress=96.4% loss=0.070824 lr=3.499865e-07 lr_backbone=3.499865e-07 elapsed=49:16:03 avg_step=3.68s recent_step=2.88s eta=01:49:45
|
| 4832 |
+
2026-09-25 18:23:53 | INFO | train rank=0 | step=48220/50000 progress=96.4% loss=0.099263 lr=3.460915e-07 lr_backbone=3.460915e-07 elapsed=49:16:35 avg_step=3.68s recent_step=3.12s eta=01:49:08
|
| 4833 |
+
2026-09-25 18:24:27 | INFO | train rank=0 | step=48230/50000 progress=96.5% loss=0.078752 lr=3.422181e-07 lr_backbone=3.422181e-07 elapsed=49:17:09 avg_step=3.68s recent_step=3.42s eta=01:48:31
|
| 4834 |
+
2026-09-25 18:25:12 | INFO | train rank=0 | step=48240/50000 progress=96.5% loss=0.117236 lr=3.383666e-07 lr_backbone=3.383666e-07 elapsed=49:17:54 avg_step=3.68s recent_step=4.51s eta=01:47:55
|
| 4835 |
+
2026-09-25 18:25:37 | INFO | train rank=0 | step=48250/50000 progress=96.5% loss=0.095069 lr=3.345367e-07 lr_backbone=3.345367e-07 elapsed=49:18:19 avg_step=3.68s recent_step=2.56s eta=01:47:17
|
| 4836 |
+
2026-09-25 18:26:10 | INFO | train rank=0 | step=48260/50000 progress=96.5% loss=0.103581 lr=3.307285e-07 lr_backbone=3.307285e-07 elapsed=49:18:52 avg_step=3.68s recent_step=3.28s eta=01:46:40
|
| 4837 |
+
2026-09-25 18:26:47 | INFO | train rank=0 | step=48270/50000 progress=96.5% loss=0.075033 lr=3.269421e-07 lr_backbone=3.269421e-07 elapsed=49:19:30 avg_step=3.68s recent_step=3.73s eta=01:46:04
|
| 4838 |
+
2026-09-25 18:27:24 | INFO | train rank=0 | step=48280/50000 progress=96.6% loss=0.094369 lr=3.231774e-07 lr_backbone=3.231774e-07 elapsed=49:20:07 avg_step=3.68s recent_step=3.70s eta=01:45:27
|
| 4839 |
+
2026-09-25 18:28:26 | INFO | train rank=0 | step=48290/50000 progress=96.6% loss=0.082391 lr=3.194345e-07 lr_backbone=3.194345e-07 elapsed=49:21:08 avg_step=3.68s recent_step=6.18s eta=01:44:51
|
| 4840 |
+
2026-09-25 18:28:52 | INFO | train rank=0 | step=48300/50000 progress=96.6% loss=0.106695 lr=3.157132e-07 lr_backbone=3.157132e-07 elapsed=49:21:34 avg_step=3.68s recent_step=2.57s eta=01:44:14
|
| 4841 |
+
2026-09-25 18:29:20 | INFO | train rank=0 | step=48310/50000 progress=96.6% loss=0.074352 lr=3.120138e-07 lr_backbone=3.120138e-07 elapsed=49:22:02 avg_step=3.68s recent_step=2.82s eta=01:43:37
|
| 4842 |
+
2026-09-25 18:29:49 | INFO | train rank=0 | step=48320/50000 progress=96.6% loss=0.085520 lr=3.083360e-07 lr_backbone=3.083360e-07 elapsed=49:22:31 avg_step=3.68s recent_step=2.88s eta=01:43:00
|
| 4843 |
+
2026-09-25 18:30:34 | INFO | train rank=0 | step=48330/50000 progress=96.7% loss=0.060016 lr=3.046800e-07 lr_backbone=3.046800e-07 elapsed=49:23:16 avg_step=3.68s recent_step=4.53s eta=01:42:23
|
| 4844 |
+
2026-09-25 18:31:11 | INFO | train rank=0 | step=48340/50000 progress=96.7% loss=0.070344 lr=3.010457e-07 lr_backbone=3.010457e-07 elapsed=49:23:53 avg_step=3.68s recent_step=3.64s eta=01:41:46
|
| 4845 |
+
2026-09-25 18:31:47 | INFO | train rank=0 | step=48350/50000 progress=96.7% loss=0.085091 lr=2.974332e-07 lr_backbone=2.974332e-07 elapsed=49:24:29 avg_step=3.68s recent_step=3.60s eta=01:41:09
|
| 4846 |
+
2026-09-25 18:32:18 | INFO | train rank=0 | step=48360/50000 progress=96.7% loss=0.087352 lr=2.938424e-07 lr_backbone=2.938424e-07 elapsed=49:25:00 avg_step=3.68s recent_step=3.16s eta=01:40:33
|
| 4847 |
+
2026-09-25 18:32:58 | INFO | train rank=0 | step=48370/50000 progress=96.7% loss=0.079921 lr=2.902733e-07 lr_backbone=2.902733e-07 elapsed=49:25:40 avg_step=3.68s recent_step=3.93s eta=01:39:56
|
| 4848 |
+
2026-09-25 18:33:29 | INFO | train rank=0 | step=48380/50000 progress=96.8% loss=0.090726 lr=2.867260e-07 lr_backbone=2.867260e-07 elapsed=49:26:11 avg_step=3.68s recent_step=3.09s eta=01:39:19
|
| 4849 |
+
2026-09-25 18:34:05 | INFO | train rank=0 | step=48390/50000 progress=96.8% loss=0.064272 lr=2.832004e-07 lr_backbone=2.832004e-07 elapsed=49:26:47 avg_step=3.68s recent_step=3.66s eta=01:38:42
|
| 4850 |
+
2026-09-25 18:34:43 | INFO | train rank=0 | step=48400/50000 progress=96.8% loss=0.069006 lr=2.796966e-07 lr_backbone=2.796966e-07 elapsed=49:27:25 avg_step=3.68s recent_step=3.82s eta=01:38:05
|
| 4851 |
+
2026-09-25 18:35:26 | INFO | train rank=0 | step=48410/50000 progress=96.8% loss=0.086050 lr=2.762145e-07 lr_backbone=2.762145e-07 elapsed=49:28:08 avg_step=3.68s recent_step=4.29s eta=01:37:29
|
| 4852 |
+
2026-09-25 18:36:04 | INFO | train rank=0 | step=48420/50000 progress=96.8% loss=0.096816 lr=2.727542e-07 lr_backbone=2.727542e-07 elapsed=49:28:46 avg_step=3.68s recent_step=3.81s eta=01:36:52
|
| 4853 |
+
2026-09-25 18:36:39 | INFO | train rank=0 | step=48430/50000 progress=96.9% loss=0.069036 lr=2.693156e-07 lr_backbone=2.693156e-07 elapsed=49:29:21 avg_step=3.68s recent_step=3.51s eta=01:36:15
|
| 4854 |
+
2026-09-25 18:37:26 | INFO | train rank=0 | step=48440/50000 progress=96.9% loss=0.084779 lr=2.658988e-07 lr_backbone=2.658988e-07 elapsed=49:30:08 avg_step=3.68s recent_step=4.67s eta=01:35:39
|
| 4855 |
+
2026-09-25 18:38:05 | INFO | train rank=0 | step=48450/50000 progress=96.9% loss=0.070517 lr=2.625038e-07 lr_backbone=2.625038e-07 elapsed=49:30:47 avg_step=3.68s recent_step=3.89s eta=01:35:02
|
| 4856 |
+
2026-09-25 18:38:40 | INFO | train rank=0 | step=48460/50000 progress=96.9% loss=0.071433 lr=2.591305e-07 lr_backbone=2.591305e-07 elapsed=49:31:23 avg_step=3.68s recent_step=3.56s eta=01:34:25
|
| 4857 |
+
2026-09-25 18:39:19 | INFO | train rank=0 | step=48470/50000 progress=96.9% loss=0.073963 lr=2.557789e-07 lr_backbone=2.557789e-07 elapsed=49:32:01 avg_step=3.68s recent_step=3.81s eta=01:33:48
|
| 4858 |
+
2026-09-25 18:39:57 | INFO | train rank=0 | step=48480/50000 progress=97.0% loss=0.068100 lr=2.524492e-07 lr_backbone=2.524492e-07 elapsed=49:32:39 avg_step=3.68s recent_step=3.82s eta=01:33:12
|
| 4859 |
+
2026-09-25 18:40:30 | INFO | train rank=0 | step=48490/50000 progress=97.0% loss=0.095125 lr=2.491411e-07 lr_backbone=2.491411e-07 elapsed=49:33:12 avg_step=3.68s recent_step=3.30s eta=01:32:35
|
| 4860 |
+
2026-09-25 18:41:00 | INFO | train rank=0 | step=48500/50000 progress=97.0% loss=0.082799 lr=2.458549e-07 lr_backbone=2.458549e-07 elapsed=49:33:42 avg_step=3.68s recent_step=2.99s eta=01:31:58
|
| 4861 |
+
2026-09-25 18:41:32 | INFO | train rank=0 | step=48510/50000 progress=97.0% loss=0.097066 lr=2.425904e-07 lr_backbone=2.425904e-07 elapsed=49:34:14 avg_step=3.68s recent_step=3.25s eta=01:31:21
|
| 4862 |
+
2026-09-25 18:42:11 | INFO | train rank=0 | step=48520/50000 progress=97.0% loss=0.102612 lr=2.393477e-07 lr_backbone=2.393477e-07 elapsed=49:34:53 avg_step=3.68s recent_step=3.86s eta=01:30:44
|
| 4863 |
+
2026-09-25 18:42:46 | INFO | train rank=0 | step=48530/50000 progress=97.1% loss=0.076283 lr=2.361267e-07 lr_backbone=2.361267e-07 elapsed=49:35:28 avg_step=3.68s recent_step=3.56s eta=01:30:07
|
| 4864 |
+
2026-09-25 18:43:21 | INFO | train rank=0 | step=48540/50000 progress=97.1% loss=0.068633 lr=2.329275e-07 lr_backbone=2.329275e-07 elapsed=49:36:03 avg_step=3.68s recent_step=3.45s eta=01:29:30
|
| 4865 |
+
2026-09-25 18:43:54 | INFO | train rank=0 | step=48550/50000 progress=97.1% loss=0.072604 lr=2.297501e-07 lr_backbone=2.297501e-07 elapsed=49:36:36 avg_step=3.68s recent_step=3.31s eta=01:28:53
|
| 4866 |
+
2026-09-25 18:44:30 | INFO | train rank=0 | step=48560/50000 progress=97.1% loss=0.085082 lr=2.265944e-07 lr_backbone=2.265944e-07 elapsed=49:37:12 avg_step=3.68s recent_step=3.60s eta=01:28:17
|
| 4867 |
+
2026-09-25 18:45:09 | INFO | train rank=0 | step=48570/50000 progress=97.1% loss=0.083555 lr=2.234605e-07 lr_backbone=2.234605e-07 elapsed=49:37:51 avg_step=3.68s recent_step=3.87s eta=01:27:40
|
| 4868 |
+
2026-09-25 18:45:42 | INFO | train rank=0 | step=48580/50000 progress=97.2% loss=0.098611 lr=2.203484e-07 lr_backbone=2.203484e-07 elapsed=49:38:24 avg_step=3.68s recent_step=3.36s eta=01:27:03
|
| 4869 |
+
2026-09-25 18:46:22 | INFO | train rank=0 | step=48590/50000 progress=97.2% loss=0.088423 lr=2.172581e-07 lr_backbone=2.172581e-07 elapsed=49:39:04 avg_step=3.68s recent_step=3.98s eta=01:26:26
|
| 4870 |
+
2026-09-25 18:47:19 | INFO | train rank=0 | step=48600/50000 progress=97.2% loss=0.106377 lr=2.141896e-07 lr_backbone=2.141896e-07 elapsed=49:40:01 avg_step=3.68s recent_step=5.65s eta=01:25:50
|
| 4871 |
+
2026-09-25 18:47:49 | INFO | train rank=0 | step=48610/50000 progress=97.2% loss=0.074642 lr=2.111428e-07 lr_backbone=2.111428e-07 elapsed=49:40:31 avg_step=3.68s recent_step=3.03s eta=01:25:13
|
| 4872 |
+
2026-09-25 18:48:26 | INFO | train rank=0 | step=48620/50000 progress=97.2% loss=0.074608 lr=2.081178e-07 lr_backbone=2.081178e-07 elapsed=49:41:08 avg_step=3.68s recent_step=3.67s eta=01:24:36
|
| 4873 |
+
2026-09-25 18:48:55 | INFO | train rank=0 | step=48630/50000 progress=97.3% loss=0.075039 lr=2.051146e-07 lr_backbone=2.051146e-07 elapsed=49:41:38 avg_step=3.68s recent_step=2.98s eta=01:23:59
|
| 4874 |
+
2026-09-25 18:49:35 | INFO | train rank=0 | step=48640/50000 progress=97.3% loss=0.072397 lr=2.021331e-07 lr_backbone=2.021331e-07 elapsed=49:42:17 avg_step=3.68s recent_step=3.96s eta=01:23:23
|
| 4875 |
+
2026-09-25 18:50:17 | INFO | train rank=0 | step=48650/50000 progress=97.3% loss=0.074893 lr=1.991735e-07 lr_backbone=1.991735e-07 elapsed=49:42:59 avg_step=3.68s recent_step=4.19s eta=01:22:46
|
| 4876 |
+
2026-09-25 18:50:47 | INFO | train rank=0 | step=48660/50000 progress=97.3% loss=0.089199 lr=1.962356e-07 lr_backbone=1.962356e-07 elapsed=49:43:29 avg_step=3.68s recent_step=3.00s eta=01:22:09
|
| 4877 |
+
2026-09-25 18:51:31 | INFO | train rank=0 | step=48670/50000 progress=97.3% loss=0.070093 lr=1.933195e-07 lr_backbone=1.933195e-07 elapsed=49:44:13 avg_step=3.68s recent_step=4.38s eta=01:21:32
|
| 4878 |
+
2026-09-25 18:52:05 | INFO | train rank=0 | step=48680/50000 progress=97.4% loss=0.114525 lr=1.904253e-07 lr_backbone=1.904253e-07 elapsed=49:44:47 avg_step=3.68s recent_step=3.46s eta=01:20:56
|
| 4879 |
+
2026-09-25 18:52:51 | INFO | train rank=0 | step=48690/50000 progress=97.4% loss=0.096334 lr=1.875527e-07 lr_backbone=1.875527e-07 elapsed=49:45:33 avg_step=3.68s recent_step=4.57s eta=01:20:19
|
| 4880 |
+
2026-09-25 18:53:22 | INFO | train rank=0 | step=48700/50000 progress=97.4% loss=0.077099 lr=1.847020e-07 lr_backbone=1.847020e-07 elapsed=49:46:04 avg_step=3.68s recent_step=3.13s eta=01:19:42
|
| 4881 |
+
2026-09-25 18:53:50 | INFO | train rank=0 | step=48710/50000 progress=97.4% loss=0.082100 lr=1.818731e-07 lr_backbone=1.818731e-07 elapsed=49:46:33 avg_step=3.68s recent_step=2.83s eta=01:19:05
|
| 4882 |
+
2026-09-25 18:54:16 | INFO | train rank=0 | step=48720/50000 progress=97.4% loss=0.086632 lr=1.790660e-07 lr_backbone=1.790660e-07 elapsed=49:46:58 avg_step=3.68s recent_step=2.59s eta=01:18:28
|
| 4883 |
+
2026-09-25 18:54:54 | INFO | train rank=0 | step=48730/50000 progress=97.5% loss=0.141815 lr=1.762806e-07 lr_backbone=1.762806e-07 elapsed=49:47:36 avg_step=3.68s recent_step=3.80s eta=01:17:51
|
| 4884 |
+
2026-09-25 18:55:29 | INFO | train rank=0 | step=48740/50000 progress=97.5% loss=0.090619 lr=1.735171e-07 lr_backbone=1.735171e-07 elapsed=49:48:11 avg_step=3.68s recent_step=3.48s eta=01:17:14
|
| 4885 |
+
2026-09-25 18:56:05 | INFO | train rank=0 | step=48750/50000 progress=97.5% loss=0.093981 lr=1.707753e-07 lr_backbone=1.707753e-07 elapsed=49:48:47 avg_step=3.68s recent_step=3.55s eta=01:16:38
|
| 4886 |
+
2026-09-25 18:56:37 | INFO | train rank=0 | step=48760/50000 progress=97.5% loss=0.072007 lr=1.680554e-07 lr_backbone=1.680554e-07 elapsed=49:49:19 avg_step=3.68s recent_step=3.24s eta=01:16:01
|
| 4887 |
+
2026-09-25 18:57:21 | INFO | train rank=0 | step=48770/50000 progress=97.5% loss=0.087918 lr=1.653572e-07 lr_backbone=1.653572e-07 elapsed=49:50:04 avg_step=3.68s recent_step=4.46s eta=01:15:24
|
| 4888 |
+
2026-09-25 18:57:56 | INFO | train rank=0 | step=48780/50000 progress=97.6% loss=0.073863 lr=1.626809e-07 lr_backbone=1.626809e-07 elapsed=49:50:38 avg_step=3.68s recent_step=3.46s eta=01:14:47
|
| 4889 |
+
2026-09-25 18:58:22 | INFO | train rank=0 | step=48790/50000 progress=97.6% loss=0.128695 lr=1.600263e-07 lr_backbone=1.600263e-07 elapsed=49:51:04 avg_step=3.68s recent_step=2.57s eta=01:14:10
|
| 4890 |
+
2026-09-25 18:58:48 | INFO | train rank=0 | step=48800/50000 progress=97.6% loss=0.096745 lr=1.573936e-07 lr_backbone=1.573936e-07 elapsed=49:51:30 avg_step=3.68s recent_step=2.61s eta=01:13:33
|
| 4891 |
+
2026-09-25 18:59:41 | INFO | train rank=0 | step=48810/50000 progress=97.6% loss=0.073234 lr=1.547826e-07 lr_backbone=1.547826e-07 elapsed=49:52:23 avg_step=3.68s recent_step=5.33s eta=01:12:57
|
| 4892 |
+
2026-09-25 19:00:17 | INFO | train rank=0 | step=48820/50000 progress=97.6% loss=0.113477 lr=1.521935e-07 lr_backbone=1.521935e-07 elapsed=49:52:59 avg_step=3.68s recent_step=3.54s eta=01:12:20
|
| 4893 |
+
2026-09-25 19:00:55 | INFO | train rank=0 | step=48830/50000 progress=97.7% loss=0.080768 lr=1.496262e-07 lr_backbone=1.496262e-07 elapsed=49:53:37 avg_step=3.68s recent_step=3.82s eta=01:11:43
|
| 4894 |
+
2026-09-25 19:01:30 | INFO | train rank=0 | step=48840/50000 progress=97.7% loss=0.070925 lr=1.470806e-07 lr_backbone=1.470806e-07 elapsed=49:54:12 avg_step=3.68s recent_step=3.52s eta=01:11:06
|
| 4895 |
+
2026-09-25 19:02:04 | INFO | train rank=0 | step=48850/50000 progress=97.7% loss=0.084481 lr=1.445569e-07 lr_backbone=1.445569e-07 elapsed=49:54:46 avg_step=3.68s recent_step=3.42s eta=01:10:30
|
| 4896 |
+
2026-09-25 19:02:37 | INFO | train rank=0 | step=48860/50000 progress=97.7% loss=0.072588 lr=1.420550e-07 lr_backbone=1.420550e-07 elapsed=49:55:20 avg_step=3.68s recent_step=3.33s eta=01:09:53
|
| 4897 |
+
2026-09-25 19:03:17 | INFO | train rank=0 | step=48870/50000 progress=97.7% loss=0.075886 lr=1.395749e-07 lr_backbone=1.395749e-07 elapsed=49:55:59 avg_step=3.68s recent_step=3.94s eta=01:09:16
|
| 4898 |
+
2026-09-25 19:03:51 | INFO | train rank=0 | step=48880/50000 progress=97.8% loss=0.080580 lr=1.371166e-07 lr_backbone=1.371166e-07 elapsed=49:56:34 avg_step=3.68s recent_step=3.45s eta=01:08:39
|
| 4899 |
+
2026-09-25 19:04:27 | INFO | train rank=0 | step=48890/50000 progress=97.8% loss=0.094089 lr=1.346801e-07 lr_backbone=1.346801e-07 elapsed=49:57:09 avg_step=3.68s recent_step=3.57s eta=01:08:02
|
| 4900 |
+
2026-09-25 19:05:02 | INFO | train rank=0 | step=48900/50000 progress=97.8% loss=0.079359 lr=1.322654e-07 lr_backbone=1.322654e-07 elapsed=49:57:44 avg_step=3.68s recent_step=3.48s eta=01:07:26
|
| 4901 |
+
2026-09-25 19:05:44 | INFO | train rank=0 | step=48910/50000 progress=97.8% loss=0.092005 lr=1.298726e-07 lr_backbone=1.298726e-07 elapsed=49:58:26 avg_step=3.68s recent_step=4.18s eta=01:06:49
|
| 4902 |
+
2026-09-25 19:06:24 | INFO | train rank=0 | step=48920/50000 progress=97.8% loss=0.103279 lr=1.275015e-07 lr_backbone=1.275015e-07 elapsed=49:59:06 avg_step=3.68s recent_step=4.01s eta=01:06:12
|
| 4903 |
+
2026-09-25 19:07:04 | INFO | train rank=0 | step=48930/50000 progress=97.9% loss=0.094401 lr=1.251523e-07 lr_backbone=1.251523e-07 elapsed=49:59:46 avg_step=3.68s recent_step=3.99s eta=01:05:35
|
| 4904 |
+
2026-09-25 19:07:37 | INFO | train rank=0 | step=48940/50000 progress=97.9% loss=0.096536 lr=1.228249e-07 lr_backbone=1.228249e-07 elapsed=50:00:19 avg_step=3.68s recent_step=3.33s eta=01:04:59
|
| 4905 |
+
2026-09-25 19:08:15 | INFO | train rank=0 | step=48950/50000 progress=97.9% loss=0.081926 lr=1.205193e-07 lr_backbone=1.205193e-07 elapsed=50:00:57 avg_step=3.68s recent_step=3.78s eta=01:04:22
|
| 4906 |
+
2026-09-25 19:08:47 | INFO | train rank=0 | step=48960/50000 progress=97.9% loss=0.076278 lr=1.182355e-07 lr_backbone=1.182355e-07 elapsed=50:01:30 avg_step=3.68s recent_step=3.26s eta=01:03:45
|
| 4907 |
+
2026-09-25 19:09:34 | INFO | train rank=0 | step=48970/50000 progress=97.9% loss=0.093270 lr=1.159736e-07 lr_backbone=1.159736e-07 elapsed=50:02:16 avg_step=3.68s recent_step=4.65s eta=01:03:08
|
| 4908 |
+
2026-09-25 19:10:14 | INFO | train rank=0 | step=48980/50000 progress=98.0% loss=0.088448 lr=1.137334e-07 lr_backbone=1.137334e-07 elapsed=50:02:56 avg_step=3.68s recent_step=3.98s eta=01:02:32
|
| 4909 |
+
2026-09-25 19:10:40 | INFO | train rank=0 | step=48990/50000 progress=98.0% loss=0.111875 lr=1.115151e-07 lr_backbone=1.115151e-07 elapsed=50:03:23 avg_step=3.68s recent_step=2.67s eta=01:01:55
|
| 4910 |
+
2026-09-25 19:11:13 | INFO | train rank=0 | step=49000/50000 progress=98.0% loss=0.111696 lr=1.093186e-07 lr_backbone=1.093186e-07 elapsed=50:03:55 avg_step=3.68s recent_step=3.25s eta=01:01:18
|
| 4911 |
+
2026-09-25 19:11:55 | INFO | train rank=0 | step=49010/50000 progress=98.0% loss=0.089332 lr=1.071440e-07 lr_backbone=1.071440e-07 elapsed=50:04:38 avg_step=3.68s recent_step=4.25s eta=01:00:41
|
| 4912 |
+
2026-09-25 19:12:33 | INFO | train rank=0 | step=49020/50000 progress=98.0% loss=0.091962 lr=1.049911e-07 lr_backbone=1.049911e-07 elapsed=50:05:15 avg_step=3.68s recent_step=3.74s eta=01:00:04
|
| 4913 |
+
2026-09-25 19:13:27 | INFO | train rank=0 | step=49030/50000 progress=98.1% loss=0.084929 lr=1.028601e-07 lr_backbone=1.028601e-07 elapsed=50:06:09 avg_step=3.68s recent_step=5.40s eta=00:59:28
|
| 4914 |
+
2026-09-25 19:13:57 | INFO | train rank=0 | step=49040/50000 progress=98.1% loss=0.124148 lr=1.007509e-07 lr_backbone=1.007509e-07 elapsed=50:06:39 avg_step=3.68s recent_step=2.98s eta=00:58:51
|
| 4915 |
+
2026-09-25 19:14:23 | INFO | train rank=0 | step=49050/50000 progress=98.1% loss=0.095044 lr=9.866358e-08 lr_backbone=9.866358e-08 elapsed=50:07:05 avg_step=3.68s recent_step=2.68s eta=00:58:14
|
| 4916 |
+
2026-09-25 19:14:59 | INFO | train rank=0 | step=49060/50000 progress=98.1% loss=0.094391 lr=9.659805e-08 lr_backbone=9.659805e-08 elapsed=50:07:41 avg_step=3.68s recent_step=3.60s eta=00:57:37
|
| 4917 |
+
2026-09-25 19:15:46 | INFO | train rank=0 | step=49070/50000 progress=98.1% loss=0.095895 lr=9.455435e-08 lr_backbone=9.455435e-08 elapsed=50:08:29 avg_step=3.68s recent_step=4.71s eta=00:57:01
|
| 4918 |
+
2026-09-25 19:16:19 | INFO | train rank=0 | step=49080/50000 progress=98.2% loss=0.068414 lr=9.253248e-08 lr_backbone=9.253248e-08 elapsed=50:09:01 avg_step=3.68s recent_step=3.29s eta=00:56:24
|
| 4919 |
+
2026-09-25 19:16:56 | INFO | train rank=0 | step=49090/50000 progress=98.2% loss=0.105441 lr=9.053244e-08 lr_backbone=9.053244e-08 elapsed=50:09:38 avg_step=3.68s recent_step=3.69s eta=00:55:47
|
| 4920 |
+
2026-09-25 19:17:40 | INFO | train rank=0 | step=49100/50000 progress=98.2% loss=0.093642 lr=8.855423e-08 lr_backbone=8.855423e-08 elapsed=50:10:23 avg_step=3.68s recent_step=4.42s eta=00:55:10
|
| 4921 |
+
2026-09-25 19:18:21 | INFO | train rank=0 | step=49110/50000 progress=98.2% loss=0.075857 lr=8.659786e-08 lr_backbone=8.659786e-08 elapsed=50:11:03 avg_step=3.68s recent_step=4.06s eta=00:54:34
|
| 4922 |
+
2026-09-25 19:18:51 | INFO | train rank=0 | step=49120/50000 progress=98.2% loss=0.110154 lr=8.466332e-08 lr_backbone=8.466332e-08 elapsed=50:11:33 avg_step=3.68s recent_step=2.94s eta=00:53:57
|
| 4923 |
+
2026-09-25 19:19:23 | INFO | train rank=0 | step=49130/50000 progress=98.3% loss=0.106165 lr=8.275061e-08 lr_backbone=8.275061e-08 elapsed=50:12:05 avg_step=3.68s recent_step=3.25s eta=00:53:20
|
| 4924 |
+
2026-09-25 19:20:08 | INFO | train rank=0 | step=49140/50000 progress=98.3% loss=0.094078 lr=8.085974e-08 lr_backbone=8.085974e-08 elapsed=50:12:50 avg_step=3.68s recent_step=4.51s eta=00:52:43
|
| 4925 |
+
2026-09-25 19:20:46 | INFO | train rank=0 | step=49150/50000 progress=98.3% loss=0.089305 lr=7.899071e-08 lr_backbone=7.899071e-08 elapsed=50:13:29 avg_step=3.68s recent_step=3.84s eta=00:52:06
|
| 4926 |
+
2026-09-25 19:21:23 | INFO | train rank=0 | step=49160/50000 progress=98.3% loss=0.084292 lr=7.714351e-08 lr_backbone=7.714351e-08 elapsed=50:14:05 avg_step=3.68s recent_step=3.64s eta=00:51:30
|
| 4927 |
+
2026-09-25 19:21:56 | INFO | train rank=0 | step=49170/50000 progress=98.3% loss=0.069183 lr=7.531815e-08 lr_backbone=7.531815e-08 elapsed=50:14:38 avg_step=3.68s recent_step=3.35s eta=00:50:53
|
| 4928 |
+
2026-09-25 19:22:42 | INFO | train rank=0 | step=49180/50000 progress=98.4% loss=0.086795 lr=7.351463e-08 lr_backbone=7.351463e-08 elapsed=50:15:24 avg_step=3.68s recent_step=4.53s eta=00:50:16
|
| 4929 |
+
2026-09-25 19:23:18 | INFO | train rank=0 | step=49190/50000 progress=98.4% loss=0.085378 lr=7.173295e-08 lr_backbone=7.173295e-08 elapsed=50:16:00 avg_step=3.68s recent_step=3.63s eta=00:49:39
|
| 4930 |
+
2026-09-25 19:23:49 | INFO | train rank=0 | step=49200/50000 progress=98.4% loss=0.091433 lr=6.997311e-08 lr_backbone=6.997311e-08 elapsed=50:16:31 avg_step=3.68s recent_step=3.11s eta=00:49:02
|
| 4931 |
+
2026-09-25 19:24:16 | INFO | train rank=0 | step=49210/50000 progress=98.4% loss=0.100602 lr=6.823511e-08 lr_backbone=6.823511e-08 elapsed=50:16:58 avg_step=3.68s recent_step=2.71s eta=00:48:26
|
| 4932 |
+
2026-09-25 19:24:55 | INFO | train rank=0 | step=49220/50000 progress=98.4% loss=0.091758 lr=6.651896e-08 lr_backbone=6.651896e-08 elapsed=50:17:37 avg_step=3.68s recent_step=3.87s eta=00:47:49
|
| 4933 |
+
2026-09-25 19:25:36 | INFO | train rank=0 | step=49230/50000 progress=98.5% loss=0.086452 lr=6.482464e-08 lr_backbone=6.482464e-08 elapsed=50:18:18 avg_step=3.68s recent_step=4.07s eta=00:47:12
|
| 4934 |
+
2026-09-25 19:26:10 | INFO | train rank=0 | step=49240/50000 progress=98.5% loss=0.088683 lr=6.315217e-08 lr_backbone=6.315217e-08 elapsed=50:18:52 avg_step=3.68s recent_step=3.41s eta=00:46:35
|
| 4935 |
+
2026-09-25 19:26:47 | INFO | train rank=0 | step=49250/50000 progress=98.5% loss=0.085640 lr=6.150154e-08 lr_backbone=6.150154e-08 elapsed=50:19:29 avg_step=3.68s recent_step=3.74s eta=00:45:58
|
| 4936 |
+
2026-09-25 19:27:16 | INFO | train rank=0 | step=49260/50000 progress=98.5% loss=0.099423 lr=5.987276e-08 lr_backbone=5.987276e-08 elapsed=50:19:58 avg_step=3.68s recent_step=2.93s eta=00:45:22
|
| 4937 |
+
2026-09-25 19:27:56 | INFO | train rank=0 | step=49270/50000 progress=98.5% loss=0.112489 lr=5.826582e-08 lr_backbone=5.826582e-08 elapsed=50:20:38 avg_step=3.68s recent_step=3.93s eta=00:44:45
|
| 4938 |
+
2026-09-25 19:28:28 | INFO | train rank=0 | step=49280/50000 progress=98.6% loss=0.102960 lr=5.668073e-08 lr_backbone=5.668073e-08 elapsed=50:21:10 avg_step=3.68s recent_step=3.23s eta=00:44:08
|
| 4939 |
+
2026-09-25 19:29:14 | INFO | train rank=0 | step=49290/50000 progress=98.6% loss=0.096495 lr=5.511749e-08 lr_backbone=5.511749e-08 elapsed=50:21:56 avg_step=3.68s recent_step=4.59s eta=00:43:31
|
| 4940 |
+
2026-09-25 19:29:47 | INFO | train rank=0 | step=49300/50000 progress=98.6% loss=0.061375 lr=5.357609e-08 lr_backbone=5.357609e-08 elapsed=50:22:29 avg_step=3.68s recent_step=3.30s eta=00:42:54
|
| 4941 |
+
2026-09-25 19:30:19 | INFO | train rank=0 | step=49310/50000 progress=98.6% loss=0.063220 lr=5.205655e-08 lr_backbone=5.205655e-08 elapsed=50:23:01 avg_step=3.68s recent_step=3.19s eta=00:42:18
|
| 4942 |
+
2026-09-25 19:30:53 | INFO | train rank=0 | step=49320/50000 progress=98.6% loss=0.084427 lr=5.055885e-08 lr_backbone=5.055885e-08 elapsed=50:23:35 avg_step=3.68s recent_step=3.43s eta=00:41:41
|
| 4943 |
+
2026-09-25 19:31:37 | INFO | train rank=0 | step=49330/50000 progress=98.7% loss=0.101448 lr=4.908300e-08 lr_backbone=4.908300e-08 elapsed=50:24:20 avg_step=3.68s recent_step=4.45s eta=00:41:04
|
| 4944 |
+
2026-09-25 19:32:06 | INFO | train rank=0 | step=49340/50000 progress=98.7% loss=0.087663 lr=4.762900e-08 lr_backbone=4.762900e-08 elapsed=50:24:48 avg_step=3.68s recent_step=2.87s eta=00:40:27
|
| 4945 |
+
2026-09-25 19:32:36 | INFO | train rank=0 | step=49350/50000 progress=98.7% loss=0.078500 lr=4.619685e-08 lr_backbone=4.619685e-08 elapsed=50:25:18 avg_step=3.68s recent_step=2.95s eta=00:39:50
|
| 4946 |
+
2026-09-25 19:33:12 | INFO | train rank=0 | step=49360/50000 progress=98.7% loss=0.092997 lr=4.478655e-08 lr_backbone=4.478655e-08 elapsed=50:25:55 avg_step=3.68s recent_step=3.67s eta=00:39:14
|
| 4947 |
+
2026-09-25 19:34:01 | INFO | train rank=0 | step=49370/50000 progress=98.7% loss=0.061597 lr=4.339811e-08 lr_backbone=4.339811e-08 elapsed=50:26:43 avg_step=3.68s recent_step=4.88s eta=00:38:37
|
| 4948 |
+
2026-09-25 19:34:30 | INFO | train rank=0 | step=49380/50000 progress=98.8% loss=0.082175 lr=4.203152e-08 lr_backbone=4.203152e-08 elapsed=50:27:12 avg_step=3.68s recent_step=2.85s eta=00:38:00
|
| 4949 |
+
2026-09-25 19:35:05 | INFO | train rank=0 | step=49390/50000 progress=98.8% loss=0.086529 lr=4.068678e-08 lr_backbone=4.068678e-08 elapsed=50:27:48 avg_step=3.68s recent_step=3.57s eta=00:37:23
|
| 4950 |
+
2026-09-25 19:35:39 | INFO | train rank=0 | step=49400/50000 progress=98.8% loss=0.080484 lr=3.936389e-08 lr_backbone=3.936389e-08 elapsed=50:28:21 avg_step=3.68s recent_step=3.36s eta=00:36:46
|
| 4951 |
+
2026-09-25 19:36:37 | INFO | train rank=0 | step=49410/50000 progress=98.8% loss=0.075420 lr=3.806286e-08 lr_backbone=3.806286e-08 elapsed=50:29:19 avg_step=3.68s recent_step=5.81s eta=00:36:10
|
| 4952 |
+
2026-09-25 19:37:12 | INFO | train rank=0 | step=49420/50000 progress=98.8% loss=0.104882 lr=3.678369e-08 lr_backbone=3.678369e-08 elapsed=50:29:55 avg_step=3.68s recent_step=3.53s eta=00:35:33
|
| 4953 |
+
2026-09-25 19:37:40 | INFO | train rank=0 | step=49430/50000 progress=98.9% loss=0.070291 lr=3.552637e-08 lr_backbone=3.552637e-08 elapsed=50:30:22 avg_step=3.68s recent_step=2.80s eta=00:34:56
|
| 4954 |
+
2026-09-25 19:38:12 | INFO | train rank=0 | step=49440/50000 progress=98.9% loss=0.064965 lr=3.429090e-08 lr_backbone=3.429090e-08 elapsed=50:30:54 avg_step=3.68s recent_step=3.18s eta=00:34:19
|
| 4955 |
+
2026-09-25 19:38:47 | INFO | train rank=0 | step=49450/50000 progress=98.9% loss=0.076879 lr=3.307730e-08 lr_backbone=3.307730e-08 elapsed=50:31:29 avg_step=3.68s recent_step=3.48s eta=00:33:43
|
| 4956 |
+
2026-09-25 19:39:17 | INFO | train rank=0 | step=49460/50000 progress=98.9% loss=0.089046 lr=3.188555e-08 lr_backbone=3.188555e-08 elapsed=50:31:59 avg_step=3.68s recent_step=3.02s eta=00:33:06
|
| 4957 |
+
2026-09-25 19:39:50 | INFO | train rank=0 | step=49470/50000 progress=98.9% loss=0.106690 lr=3.071566e-08 lr_backbone=3.071566e-08 elapsed=50:32:32 avg_step=3.68s recent_step=3.29s eta=00:32:29
|
| 4958 |
+
2026-09-25 19:40:18 | INFO | train rank=0 | step=49480/50000 progress=99.0% loss=0.142766 lr=2.956762e-08 lr_backbone=2.956762e-08 elapsed=50:33:01 avg_step=3.68s recent_step=2.82s eta=00:31:52
|
| 4959 |
+
2026-09-25 19:41:01 | INFO | train rank=0 | step=49490/50000 progress=99.0% loss=0.076178 lr=2.844145e-08 lr_backbone=2.844145e-08 elapsed=50:33:43 avg_step=3.68s recent_step=4.23s eta=00:31:15
|
| 4960 |
+
2026-09-25 19:41:37 | INFO | train rank=0 | step=49500/50000 progress=99.0% loss=0.082535 lr=2.733713e-08 lr_backbone=2.733713e-08 elapsed=50:34:19 avg_step=3.68s recent_step=3.61s eta=00:30:38
|
| 4961 |
+
2026-09-25 19:42:09 | INFO | train rank=0 | step=49510/50000 progress=99.0% loss=0.085208 lr=2.625468e-08 lr_backbone=2.625468e-08 elapsed=50:34:51 avg_step=3.68s recent_step=3.26s eta=00:30:02
|
| 4962 |
+
2026-09-25 19:42:43 | INFO | train rank=0 | step=49520/50000 progress=99.0% loss=0.070951 lr=2.519408e-08 lr_backbone=2.519408e-08 elapsed=50:35:25 avg_step=3.68s recent_step=3.34s eta=00:29:25
|
| 4963 |
+
2026-09-25 19:43:31 | INFO | train rank=0 | step=49530/50000 progress=99.1% loss=0.071595 lr=2.415535e-08 lr_backbone=2.415535e-08 elapsed=50:36:13 avg_step=3.68s recent_step=4.79s eta=00:28:48
|
| 4964 |
+
2026-09-25 19:44:10 | INFO | train rank=0 | step=49540/50000 progress=99.1% loss=0.072474 lr=2.313847e-08 lr_backbone=2.313847e-08 elapsed=50:36:53 avg_step=3.68s recent_step=3.98s eta=00:28:11
|
| 4965 |
+
2026-09-25 19:44:45 | INFO | train rank=0 | step=49550/50000 progress=99.1% loss=0.103853 lr=2.214346e-08 lr_backbone=2.214346e-08 elapsed=50:37:27 avg_step=3.68s recent_step=3.42s eta=00:27:35
|
| 4966 |
+
2026-09-25 19:45:13 | INFO | train rank=0 | step=49560/50000 progress=99.1% loss=0.061520 lr=2.117031e-08 lr_backbone=2.117031e-08 elapsed=50:37:55 avg_step=3.68s recent_step=2.86s eta=00:26:58
|
| 4967 |
+
2026-09-25 19:45:48 | INFO | train rank=0 | step=49570/50000 progress=99.1% loss=0.072205 lr=2.021902e-08 lr_backbone=2.021902e-08 elapsed=50:38:30 avg_step=3.68s recent_step=3.45s eta=00:26:21
|
| 4968 |
+
2026-09-25 19:46:31 | INFO | train rank=0 | step=49580/50000 progress=99.2% loss=0.079105 lr=1.928960e-08 lr_backbone=1.928960e-08 elapsed=50:39:13 avg_step=3.68s recent_step=4.30s eta=00:25:44
|
| 4969 |
+
2026-09-25 19:47:12 | INFO | train rank=0 | step=49590/50000 progress=99.2% loss=0.087907 lr=1.838204e-08 lr_backbone=1.838204e-08 elapsed=50:39:55 avg_step=3.68s recent_step=4.17s eta=00:25:08
|
| 4970 |
+
2026-09-25 19:47:47 | INFO | train rank=0 | step=49600/50000 progress=99.2% loss=0.082529 lr=1.749634e-08 lr_backbone=1.749634e-08 elapsed=50:40:29 avg_step=3.68s recent_step=3.47s eta=00:24:31
|
| 4971 |
+
2026-09-25 19:48:16 | INFO | train rank=0 | step=49610/50000 progress=99.2% loss=0.081444 lr=1.663251e-08 lr_backbone=1.663251e-08 elapsed=50:40:58 avg_step=3.68s recent_step=2.88s eta=00:23:54
|
| 4972 |
+
2026-09-25 19:49:01 | INFO | train rank=0 | step=49620/50000 progress=99.2% loss=0.104971 lr=1.579054e-08 lr_backbone=1.579054e-08 elapsed=50:41:43 avg_step=3.68s recent_step=4.53s eta=00:23:17
|
| 4973 |
+
2026-09-25 19:49:32 | INFO | train rank=0 | step=49630/50000 progress=99.3% loss=0.068238 lr=1.497043e-08 lr_backbone=1.497043e-08 elapsed=50:42:14 avg_step=3.68s recent_step=3.10s eta=00:22:40
|
| 4974 |
+
2026-09-25 19:50:00 | INFO | train rank=0 | step=49640/50000 progress=99.3% loss=0.073328 lr=1.417219e-08 lr_backbone=1.417219e-08 elapsed=50:42:42 avg_step=3.68s recent_step=2.79s eta=00:22:03
|
| 4975 |
+
2026-09-25 19:50:44 | INFO | train rank=0 | step=49650/50000 progress=99.3% loss=0.079411 lr=1.339582e-08 lr_backbone=1.339582e-08 elapsed=50:43:26 avg_step=3.68s recent_step=4.39s eta=00:21:27
|
| 4976 |
+
2026-09-25 19:51:17 | INFO | train rank=0 | step=49660/50000 progress=99.3% loss=0.087734 lr=1.264131e-08 lr_backbone=1.264131e-08 elapsed=50:43:59 avg_step=3.68s recent_step=3.32s eta=00:20:50
|
| 4977 |
+
2026-09-25 19:52:03 | INFO | train rank=0 | step=49670/50000 progress=99.3% loss=0.117161 lr=1.190867e-08 lr_backbone=1.190867e-08 elapsed=50:44:45 avg_step=3.68s recent_step=4.57s eta=00:20:13
|
| 4978 |
+
2026-09-25 19:52:24 | INFO | train rank=0 | step=49680/50000 progress=99.4% loss=0.087899 lr=1.119789e-08 lr_backbone=1.119789e-08 elapsed=50:45:07 avg_step=3.68s recent_step=2.15s eta=00:19:36
|
| 4979 |
+
2026-09-25 19:53:15 | INFO | train rank=0 | step=49690/50000 progress=99.4% loss=0.089706 lr=1.050898e-08 lr_backbone=1.050898e-08 elapsed=50:45:57 avg_step=3.68s recent_step=5.06s eta=00:19:00
|
| 4980 |
+
2026-09-25 19:53:44 | INFO | train rank=0 | step=49700/50000 progress=99.4% loss=0.073376 lr=9.841942e-09 lr_backbone=9.841942e-09 elapsed=50:46:26 avg_step=3.68s recent_step=2.93s eta=00:18:23
|
| 4981 |
+
2026-09-25 19:54:28 | INFO | train rank=0 | step=49710/50000 progress=99.4% loss=0.073637 lr=9.196768e-09 lr_backbone=9.196768e-09 elapsed=50:47:10 avg_step=3.68s recent_step=4.37s eta=00:17:46
|
| 4982 |
+
2026-09-25 19:55:04 | INFO | train rank=0 | step=49720/50000 progress=99.4% loss=0.073858 lr=8.573461e-09 lr_backbone=8.573461e-09 elapsed=50:47:47 avg_step=3.68s recent_step=3.64s eta=00:17:09
|
| 4983 |
+
2026-09-25 19:55:33 | INFO | train rank=0 | step=49730/50000 progress=99.5% loss=0.068404 lr=7.972023e-09 lr_backbone=7.972023e-09 elapsed=50:48:15 avg_step=3.68s recent_step=2.89s eta=00:16:33
|
| 4984 |
+
2026-09-25 19:56:17 | INFO | train rank=0 | step=49740/50000 progress=99.5% loss=0.091657 lr=7.392452e-09 lr_backbone=7.392452e-09 elapsed=50:48:59 avg_step=3.68s recent_step=4.32s eta=00:15:56
|
| 4985 |
+
2026-09-25 19:56:49 | INFO | train rank=0 | step=49750/50000 progress=99.5% loss=0.106059 lr=6.834750e-09 lr_backbone=6.834750e-09 elapsed=50:49:31 avg_step=3.68s recent_step=3.24s eta=00:15:19
|
| 4986 |
+
2026-09-25 19:57:27 | INFO | train rank=0 | step=49760/50000 progress=99.5% loss=0.096704 lr=6.298917e-09 lr_backbone=6.298917e-09 elapsed=50:50:09 avg_step=3.68s recent_step=3.83s eta=00:14:42
|
| 4987 |
+
2026-09-25 19:58:09 | INFO | train rank=0 | step=49770/50000 progress=99.5% loss=0.083945 lr=5.784953e-09 lr_backbone=5.784953e-09 elapsed=50:50:52 avg_step=3.68s recent_step=4.22s eta=00:14:05
|
| 4988 |
+
2026-09-25 19:58:42 | INFO | train rank=0 | step=49780/50000 progress=99.6% loss=0.080002 lr=5.292858e-09 lr_backbone=5.292858e-09 elapsed=50:51:25 avg_step=3.68s recent_step=3.31s eta=00:13:29
|
| 4989 |
+
2026-09-25 19:59:29 | INFO | train rank=0 | step=49790/50000 progress=99.6% loss=0.083225 lr=4.822632e-09 lr_backbone=4.822632e-09 elapsed=50:52:12 avg_step=3.68s recent_step=4.70s eta=00:12:52
|
| 4990 |
+
2026-09-25 20:00:01 | INFO | train rank=0 | step=49800/50000 progress=99.6% loss=0.084774 lr=4.374276e-09 lr_backbone=4.374276e-09 elapsed=50:52:43 avg_step=3.68s recent_step=3.12s eta=00:12:15
|
| 4991 |
+
2026-09-25 20:00:47 | INFO | train rank=0 | step=49810/50000 progress=99.6% loss=0.074837 lr=3.947790e-09 lr_backbone=3.947790e-09 elapsed=50:53:30 avg_step=3.68s recent_step=4.67s eta=00:11:38
|
| 4992 |
+
2026-09-25 20:01:27 | INFO | train rank=0 | step=49820/50000 progress=99.6% loss=0.100414 lr=3.543173e-09 lr_backbone=3.543173e-09 elapsed=50:54:09 avg_step=3.68s recent_step=3.92s eta=00:11:02
|
| 4993 |
+
2026-09-25 20:02:05 | INFO | train rank=0 | step=49830/50000 progress=99.7% loss=0.076652 lr=3.160427e-09 lr_backbone=3.160427e-09 elapsed=50:54:47 avg_step=3.68s recent_step=3.81s eta=00:10:25
|
| 4994 |
+
2026-09-25 20:02:32 | INFO | train rank=0 | step=49840/50000 progress=99.7% loss=0.082665 lr=2.799551e-09 lr_backbone=2.799551e-09 elapsed=50:55:14 avg_step=3.68s recent_step=2.72s eta=00:09:48
|
| 4995 |
+
2026-09-25 20:03:31 | INFO | train rank=0 | step=49850/50000 progress=99.7% loss=0.081870 lr=2.460546e-09 lr_backbone=2.460546e-09 elapsed=50:56:14 avg_step=3.68s recent_step=5.94s eta=00:09:11
|
| 4996 |
+
2026-09-25 20:03:57 | INFO | train rank=0 | step=49860/50000 progress=99.7% loss=0.089103 lr=2.143411e-09 lr_backbone=2.143411e-09 elapsed=50:56:39 avg_step=3.68s recent_step=2.51s eta=00:08:34
|
| 4997 |
+
2026-09-25 20:04:27 | INFO | train rank=0 | step=49870/50000 progress=99.7% loss=0.077822 lr=1.848147e-09 lr_backbone=1.848147e-09 elapsed=50:57:09 avg_step=3.68s recent_step=3.04s eta=00:07:58
|
| 4998 |
+
2026-09-25 20:05:01 | INFO | train rank=0 | step=49880/50000 progress=99.8% loss=0.075340 lr=1.574754e-09 lr_backbone=1.574754e-09 elapsed=50:57:43 avg_step=3.68s recent_step=3.43s eta=00:07:21
|
| 4999 |
+
2026-09-25 20:05:50 | INFO | train rank=0 | step=49890/50000 progress=99.8% loss=0.075455 lr=1.323232e-09 lr_backbone=1.323232e-09 elapsed=50:58:32 avg_step=3.68s recent_step=4.84s eta=00:06:44
|
| 5000 |
+
2026-09-25 20:06:25 | INFO | train rank=0 | step=49900/50000 progress=99.8% loss=0.105893 lr=1.093581e-09 lr_backbone=1.093581e-09 elapsed=50:59:07 avg_step=3.68s recent_step=3.52s eta=00:06:07
|
| 5001 |
+
2026-09-25 20:07:04 | INFO | train rank=0 | step=49910/50000 progress=99.8% loss=0.065076 lr=8.858012e-10 lr_backbone=8.858012e-10 elapsed=50:59:47 avg_step=3.68s recent_step=3.96s eta=00:05:31
|
| 5002 |
+
2026-09-25 20:07:30 | INFO | train rank=0 | step=49920/50000 progress=99.8% loss=0.096187 lr=6.998928e-10 lr_backbone=6.998928e-10 elapsed=51:00:12 avg_step=3.68s recent_step=2.58s eta=00:04:54
|
| 5003 |
+
2026-09-25 20:08:10 | INFO | train rank=0 | step=49930/50000 progress=99.9% loss=0.073894 lr=5.358557e-10 lr_backbone=5.358557e-10 elapsed=51:00:53 avg_step=3.68s recent_step=4.02s eta=00:04:17
|
| 5004 |
+
2026-09-25 20:08:42 | INFO | train rank=0 | step=49940/50000 progress=99.9% loss=0.083540 lr=3.936901e-10 lr_backbone=3.936901e-10 elapsed=51:01:24 avg_step=3.68s recent_step=3.16s eta=00:03:40
|
| 5005 |
+
2026-09-25 20:09:10 | INFO | train rank=0 | step=49950/50000 progress=99.9% loss=0.108622 lr=2.733960e-10 lr_backbone=2.733960e-10 elapsed=51:01:52 avg_step=3.68s recent_step=2.84s eta=00:03:03
|
| 5006 |
+
2026-09-25 20:09:36 | INFO | train rank=0 | step=49960/50000 progress=99.9% loss=0.101317 lr=1.749735e-10 lr_backbone=1.749735e-10 elapsed=51:02:18 avg_step=3.68s recent_step=2.55s eta=00:02:27
|
| 5007 |
+
2026-09-25 20:10:24 | INFO | train rank=0 | step=49970/50000 progress=99.9% loss=0.073669 lr=9.842262e-11 lr_backbone=9.842262e-11 elapsed=51:03:06 avg_step=3.68s recent_step=4.80s eta=00:01:50
|
| 5008 |
+
2026-09-25 20:10:56 | INFO | train rank=0 | step=49980/50000 progress=100.0% loss=0.099091 lr=4.374339e-11 lr_backbone=4.374339e-11 elapsed=51:03:38 avg_step=3.68s recent_step=3.19s eta=00:01:13
|
| 5009 |
+
2026-09-25 20:11:24 | INFO | train rank=0 | step=49990/50000 progress=100.0% loss=0.072726 lr=1.093585e-11 lr_backbone=1.093585e-11 elapsed=51:04:07 avg_step=3.68s recent_step=2.87s eta=00:00:36
|
| 5010 |
+
2026-09-25 20:12:11 | INFO | train rank=0 | step=50000/50000 progress=100.0% loss=0.084829 lr=0.000000e+00 lr_backbone=0.000000e+00 elapsed=51:04:53 avg_step=3.68s recent_step=4.63s eta=00:00:00
|
| 5011 |
+
2026-09-25 20:12:48 | INFO | train rank=0 | Saved DeepSpeed checkpoint to /data/NTU_slab/draven/checkpoints/codebase/codebase_v8_droid/joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_50000
|
| 5012 |
+
2026-09-25 20:12:48 | INFO | train rank=0 | Finished training final_step=50000/50000 elapsed=51:05:30 avg_step=3.68s
|
| 5013 |
+
2026-09-25 20:12:48 | INFO | train rank=0 | Training finished
|
| 5014 |
+
2026-09-25 20:13:21 | INFO | train rank=0 | Saved final DeepSpeed checkpoint to /data/NTU_slab/draven/checkpoints/codebase/codebase_v8_droid/joint_50ksteps_bs128_qwen3vl2b_no_aug_end_padding_mask_chunk16/ds_checkpoint_final
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae55731dbe49f8760d2099674933ce4b94768d2987745bf5819987da1d4f5bea
|
| 3 |
+
size 8066587624
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d969c0cdb76cf640048e839fb4104f44c2617c95278b8571f032ab6cc31f523c
|
| 3 |
+
size 8066569384
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:24de5415e2f6f4c4b10b2c7522e9823d6879c0a79e1885effde6d8843dedbc71
|
| 3 |
+
size 8066573800
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c23946c17da3de50594dc9e4ea664ebdfd5f38eaf5c4d7ff7225695f582e0cb3
|
| 3 |
+
size 8066572904
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/global_step50000/mp_rank_00_model_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a83a866c0225312d921853b93e1113a9cb9440c913fd80d978b543cb98ccc98c
|
| 3 |
+
size 5378170340
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/latest
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
global_step50000
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000/zero_to_fp32.py
ADDED
|
@@ -0,0 +1,790 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
|
| 3 |
+
# Copyright (c) Microsoft Corporation.
|
| 4 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 5 |
+
|
| 6 |
+
# DeepSpeed Team
|
| 7 |
+
|
| 8 |
+
# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
|
| 9 |
+
# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
|
| 10 |
+
# the future. Once extracted, the weights don't require DeepSpeed and can be used in any
|
| 11 |
+
# application.
|
| 12 |
+
#
|
| 13 |
+
# example:
|
| 14 |
+
# python zero_to_fp32.py . output_dir/
|
| 15 |
+
# or
|
| 16 |
+
# python zero_to_fp32.py . output_dir/ --safe_serialization
|
| 17 |
+
|
| 18 |
+
import argparse
|
| 19 |
+
import torch
|
| 20 |
+
import glob
|
| 21 |
+
import math
|
| 22 |
+
import os
|
| 23 |
+
import re
|
| 24 |
+
import gc
|
| 25 |
+
import json
|
| 26 |
+
import numpy as np
|
| 27 |
+
from tqdm import tqdm
|
| 28 |
+
from collections import OrderedDict
|
| 29 |
+
from dataclasses import dataclass
|
| 30 |
+
|
| 31 |
+
# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
|
| 32 |
+
# DeepSpeed data structures it has to be available in the current python environment.
|
| 33 |
+
from deepspeed.utils import logger
|
| 34 |
+
from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
|
| 35 |
+
FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
|
| 36 |
+
FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS, AUTOEP_LAYERS_KEY,
|
| 37 |
+
AUTOEP_LAYERS_KEY_LEGACY, AUTOEP_ZERO3_EXPERT_STATE_FORMAT_KEY,
|
| 38 |
+
AUTOEP_ZERO3_PARTITIONED_EXPERT_STATE_FORMAT)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
@dataclass
|
| 42 |
+
class zero_model_state:
|
| 43 |
+
buffers: dict()
|
| 44 |
+
param_shapes: dict()
|
| 45 |
+
shared_params: list
|
| 46 |
+
ds_version: int
|
| 47 |
+
frozen_param_shapes: dict()
|
| 48 |
+
frozen_param_fragments: dict()
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
debug = 0
|
| 52 |
+
|
| 53 |
+
# load to cpu
|
| 54 |
+
device = torch.device('cpu')
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def atoi(text):
|
| 58 |
+
return int(text) if text.isdigit() else text
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def natural_keys(text):
|
| 62 |
+
'''
|
| 63 |
+
alist.sort(key=natural_keys) sorts in human order
|
| 64 |
+
http://nedbatchelder.com/blog/200712/human_sorting.html
|
| 65 |
+
(See Toothy's implementation in the comments)
|
| 66 |
+
'''
|
| 67 |
+
return [atoi(c) for c in re.split(r'(\d+)', text)]
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def get_model_state_file(checkpoint_dir, zero_stage):
|
| 71 |
+
if not os.path.isdir(checkpoint_dir):
|
| 72 |
+
raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
|
| 73 |
+
|
| 74 |
+
# there should be only one file
|
| 75 |
+
if zero_stage <= 2:
|
| 76 |
+
file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
|
| 77 |
+
elif zero_stage == 3:
|
| 78 |
+
file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
|
| 79 |
+
|
| 80 |
+
if not os.path.exists(file):
|
| 81 |
+
raise FileNotFoundError(f"can't find model states file at '{file}'")
|
| 82 |
+
|
| 83 |
+
return file
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def get_checkpoint_files(checkpoint_dir, glob_pattern):
|
| 87 |
+
# XXX: need to test that this simple glob rule works for multi-node setup too
|
| 88 |
+
ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
|
| 89 |
+
|
| 90 |
+
if len(ckpt_files) == 0:
|
| 91 |
+
raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
|
| 92 |
+
|
| 93 |
+
return ckpt_files
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def get_optim_files(checkpoint_dir):
|
| 97 |
+
return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
def get_model_state_files(checkpoint_dir):
|
| 101 |
+
return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def _has_autoep_zero3_partitioned_metadata(state_dict):
|
| 105 |
+
autoep_layers = state_dict.get(AUTOEP_LAYERS_KEY)
|
| 106 |
+
if autoep_layers is None:
|
| 107 |
+
autoep_layers = state_dict.get(AUTOEP_LAYERS_KEY_LEGACY)
|
| 108 |
+
if not isinstance(autoep_layers, list):
|
| 109 |
+
return False
|
| 110 |
+
return any(
|
| 111 |
+
isinstance(entry, dict)
|
| 112 |
+
and entry.get(AUTOEP_ZERO3_EXPERT_STATE_FORMAT_KEY) == AUTOEP_ZERO3_PARTITIONED_EXPERT_STATE_FORMAT
|
| 113 |
+
for entry in autoep_layers)
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
def _raise_if_autoep_zero3_partitioned_state(state_dict):
|
| 117 |
+
if _has_autoep_zero3_partitioned_metadata(state_dict):
|
| 118 |
+
raise NotImplementedError("zero_to_fp32 does not support AutoEP ZeRO-3 partition-native checkpoints. "
|
| 119 |
+
"AutoEP expert parameters are partitioned over expert replica groups, so "
|
| 120 |
+
"global data-parallel consolidation would produce incomplete expert tensors. "
|
| 121 |
+
"Use ds_to_universal.py for expert-aware conversion.")
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
def _raise_if_autoep_zero3_partitioned_checkpoint(model_files):
|
| 125 |
+
for file in model_files:
|
| 126 |
+
state_dict = torch.load(file, map_location=device, weights_only=False)
|
| 127 |
+
_raise_if_autoep_zero3_partitioned_state(state_dict)
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
def parse_model_states(files):
|
| 131 |
+
zero_model_states = []
|
| 132 |
+
for file in files:
|
| 133 |
+
state_dict = torch.load(file, map_location=device, weights_only=False)
|
| 134 |
+
_raise_if_autoep_zero3_partitioned_state(state_dict)
|
| 135 |
+
|
| 136 |
+
if BUFFER_NAMES not in state_dict:
|
| 137 |
+
raise ValueError(f"{file} is not a model state checkpoint")
|
| 138 |
+
buffer_names = state_dict[BUFFER_NAMES]
|
| 139 |
+
if debug:
|
| 140 |
+
print("Found buffers:", buffer_names)
|
| 141 |
+
|
| 142 |
+
# recover just the buffers while restoring them to fp32 if they were saved in fp16
|
| 143 |
+
buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
|
| 144 |
+
param_shapes = state_dict[PARAM_SHAPES]
|
| 145 |
+
|
| 146 |
+
# collect parameters that are included in param_shapes
|
| 147 |
+
param_names = []
|
| 148 |
+
for s in param_shapes:
|
| 149 |
+
for name in s.keys():
|
| 150 |
+
param_names.append(name)
|
| 151 |
+
|
| 152 |
+
# update with frozen parameters
|
| 153 |
+
frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
|
| 154 |
+
if frozen_param_shapes is not None:
|
| 155 |
+
if debug:
|
| 156 |
+
print(f"Found frozen_param_shapes: {frozen_param_shapes}")
|
| 157 |
+
param_names += list(frozen_param_shapes.keys())
|
| 158 |
+
|
| 159 |
+
# handle shared params
|
| 160 |
+
shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
|
| 161 |
+
|
| 162 |
+
ds_version = state_dict.get(DS_VERSION, None)
|
| 163 |
+
|
| 164 |
+
frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
|
| 165 |
+
|
| 166 |
+
z_model_state = zero_model_state(buffers=buffers,
|
| 167 |
+
param_shapes=param_shapes,
|
| 168 |
+
shared_params=shared_params,
|
| 169 |
+
ds_version=ds_version,
|
| 170 |
+
frozen_param_shapes=frozen_param_shapes,
|
| 171 |
+
frozen_param_fragments=frozen_param_fragments)
|
| 172 |
+
zero_model_states.append(z_model_state)
|
| 173 |
+
|
| 174 |
+
return zero_model_states
|
| 175 |
+
|
| 176 |
+
|
| 177 |
+
def parse_optim_states(files, ds_checkpoint_dir):
|
| 178 |
+
total_files = len(files)
|
| 179 |
+
state_dicts = []
|
| 180 |
+
for f in tqdm(files, desc='Loading checkpoint shards'):
|
| 181 |
+
state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False)
|
| 182 |
+
# immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
|
| 183 |
+
# and also handle the case where it was already removed by another helper script
|
| 184 |
+
state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
|
| 185 |
+
state_dicts.append(state_dict)
|
| 186 |
+
|
| 187 |
+
if ZERO_STAGE not in state_dicts[0][OPTIMIZER_STATE_DICT]:
|
| 188 |
+
raise ValueError(f"{files[0]} is not a zero checkpoint")
|
| 189 |
+
zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
|
| 190 |
+
world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
|
| 191 |
+
|
| 192 |
+
# For ZeRO-2 each param group can have different partition_count as data parallelism for expert
|
| 193 |
+
# parameters can be different from data parallelism for non-expert parameters. So we can just
|
| 194 |
+
# use the max of the partition_count to get the dp world_size.
|
| 195 |
+
|
| 196 |
+
if type(world_size) is list:
|
| 197 |
+
world_size = max(world_size)
|
| 198 |
+
|
| 199 |
+
if world_size != total_files:
|
| 200 |
+
raise ValueError(
|
| 201 |
+
f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
|
| 202 |
+
"Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
|
| 203 |
+
)
|
| 204 |
+
|
| 205 |
+
# the groups are named differently in each stage
|
| 206 |
+
if zero_stage <= 2:
|
| 207 |
+
fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
|
| 208 |
+
elif zero_stage == 3:
|
| 209 |
+
fp32_groups_key = FP32_FLAT_GROUPS
|
| 210 |
+
else:
|
| 211 |
+
raise ValueError(f"unknown zero stage {zero_stage}")
|
| 212 |
+
|
| 213 |
+
fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
|
| 214 |
+
return zero_stage, world_size, fp32_flat_groups
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
|
| 218 |
+
"""
|
| 219 |
+
Returns fp32 state_dict reconstructed from ds checkpoint
|
| 220 |
+
|
| 221 |
+
Args:
|
| 222 |
+
- ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
|
| 223 |
+
|
| 224 |
+
"""
|
| 225 |
+
print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
|
| 226 |
+
|
| 227 |
+
# parse_model_states rejects AutoEP ZeRO-3 partition-native checkpoints
|
| 228 |
+
# before the expensive optimizer-shard load below.
|
| 229 |
+
model_files = get_model_state_files(ds_checkpoint_dir)
|
| 230 |
+
zero_model_states = parse_model_states(model_files)
|
| 231 |
+
print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
|
| 232 |
+
|
| 233 |
+
optim_files = get_optim_files(ds_checkpoint_dir)
|
| 234 |
+
zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
|
| 235 |
+
print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
|
| 236 |
+
|
| 237 |
+
if zero_stage <= 2:
|
| 238 |
+
return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 239 |
+
exclude_frozen_parameters)
|
| 240 |
+
elif zero_stage == 3:
|
| 241 |
+
return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 242 |
+
exclude_frozen_parameters)
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
def _zero2_merge_frozen_params(state_dict, zero_model_states):
|
| 246 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
| 247 |
+
return
|
| 248 |
+
|
| 249 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
| 250 |
+
frozen_param_fragments = zero_model_states[0].frozen_param_fragments
|
| 251 |
+
|
| 252 |
+
if debug:
|
| 253 |
+
num_elem = sum(s.numel() for s in frozen_param_shapes.values())
|
| 254 |
+
print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
| 255 |
+
|
| 256 |
+
wanted_params = len(frozen_param_shapes)
|
| 257 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
| 258 |
+
avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
|
| 259 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
| 260 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
| 261 |
+
|
| 262 |
+
total_params = 0
|
| 263 |
+
total_numel = 0
|
| 264 |
+
for name, shape in frozen_param_shapes.items():
|
| 265 |
+
total_params += 1
|
| 266 |
+
unpartitioned_numel = shape.numel()
|
| 267 |
+
total_numel += unpartitioned_numel
|
| 268 |
+
|
| 269 |
+
state_dict[name] = frozen_param_fragments[name]
|
| 270 |
+
|
| 271 |
+
if debug:
|
| 272 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
| 273 |
+
|
| 274 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
| 275 |
+
|
| 276 |
+
|
| 277 |
+
def _has_callable(obj, fn):
|
| 278 |
+
attr = getattr(obj, fn, None)
|
| 279 |
+
return callable(attr)
|
| 280 |
+
|
| 281 |
+
|
| 282 |
+
def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
| 283 |
+
param_shapes = zero_model_states[0].param_shapes
|
| 284 |
+
|
| 285 |
+
# Reconstruction protocol:
|
| 286 |
+
#
|
| 287 |
+
# XXX: document this
|
| 288 |
+
|
| 289 |
+
if debug:
|
| 290 |
+
for i in range(world_size):
|
| 291 |
+
for j in range(len(fp32_flat_groups[0])):
|
| 292 |
+
print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
|
| 293 |
+
|
| 294 |
+
# XXX: memory usage doubles here (zero2)
|
| 295 |
+
num_param_groups = len(fp32_flat_groups[0])
|
| 296 |
+
merged_single_partition_of_fp32_groups = []
|
| 297 |
+
for i in range(num_param_groups):
|
| 298 |
+
merged_partitions = [sd[i] for sd in fp32_flat_groups]
|
| 299 |
+
full_single_fp32_vector = torch.cat(merged_partitions, 0)
|
| 300 |
+
merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
|
| 301 |
+
avail_numel = sum(
|
| 302 |
+
[full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
|
| 303 |
+
|
| 304 |
+
if debug:
|
| 305 |
+
wanted_params = sum([len(shapes) for shapes in param_shapes])
|
| 306 |
+
wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
|
| 307 |
+
# not asserting if there is a mismatch due to possible padding
|
| 308 |
+
print(f"Have {avail_numel} numels to process.")
|
| 309 |
+
print(f"Need {wanted_numel} numels in {wanted_params} params.")
|
| 310 |
+
|
| 311 |
+
# params
|
| 312 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
| 313 |
+
# out-of-core computing solution
|
| 314 |
+
total_numel = 0
|
| 315 |
+
total_params = 0
|
| 316 |
+
for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
|
| 317 |
+
offset = 0
|
| 318 |
+
avail_numel = full_single_fp32_vector.numel()
|
| 319 |
+
for name, shape in shapes.items():
|
| 320 |
+
|
| 321 |
+
unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
|
| 322 |
+
total_numel += unpartitioned_numel
|
| 323 |
+
total_params += 1
|
| 324 |
+
|
| 325 |
+
if debug:
|
| 326 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
| 327 |
+
state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
|
| 328 |
+
offset += unpartitioned_numel
|
| 329 |
+
|
| 330 |
+
# Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
|
| 331 |
+
# avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
|
| 332 |
+
# paddings performed in the code it's almost impossible to predict the exact numbers w/o the
|
| 333 |
+
# live optimizer object, so we are checking that the numbers are within the right range
|
| 334 |
+
align_to = 2 * world_size
|
| 335 |
+
|
| 336 |
+
def zero2_align(x):
|
| 337 |
+
return align_to * math.ceil(x / align_to)
|
| 338 |
+
|
| 339 |
+
if debug:
|
| 340 |
+
print(f"original offset={offset}, avail_numel={avail_numel}")
|
| 341 |
+
|
| 342 |
+
offset = zero2_align(offset)
|
| 343 |
+
avail_numel = zero2_align(avail_numel)
|
| 344 |
+
|
| 345 |
+
if debug:
|
| 346 |
+
print(f"aligned offset={offset}, avail_numel={avail_numel}")
|
| 347 |
+
|
| 348 |
+
# Sanity check
|
| 349 |
+
if offset != avail_numel:
|
| 350 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
| 351 |
+
|
| 352 |
+
print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
|
| 353 |
+
|
| 354 |
+
|
| 355 |
+
def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 356 |
+
exclude_frozen_parameters):
|
| 357 |
+
state_dict = OrderedDict()
|
| 358 |
+
|
| 359 |
+
# buffers
|
| 360 |
+
buffers = zero_model_states[0].buffers
|
| 361 |
+
state_dict.update(buffers)
|
| 362 |
+
if debug:
|
| 363 |
+
print(f"added {len(buffers)} buffers")
|
| 364 |
+
|
| 365 |
+
if not exclude_frozen_parameters:
|
| 366 |
+
_zero2_merge_frozen_params(state_dict, zero_model_states)
|
| 367 |
+
|
| 368 |
+
_zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
| 369 |
+
|
| 370 |
+
# recover shared parameters
|
| 371 |
+
for pair in zero_model_states[0].shared_params:
|
| 372 |
+
if pair[1] in state_dict:
|
| 373 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
| 374 |
+
|
| 375 |
+
return state_dict
|
| 376 |
+
|
| 377 |
+
|
| 378 |
+
def zero3_partitioned_param_info(unpartitioned_numel, world_size):
|
| 379 |
+
remainder = unpartitioned_numel % world_size
|
| 380 |
+
padding_numel = (world_size - remainder) if remainder else 0
|
| 381 |
+
partitioned_numel = math.ceil(unpartitioned_numel / world_size)
|
| 382 |
+
return partitioned_numel, padding_numel
|
| 383 |
+
|
| 384 |
+
|
| 385 |
+
def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
|
| 386 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
| 387 |
+
return
|
| 388 |
+
|
| 389 |
+
if debug:
|
| 390 |
+
for i in range(world_size):
|
| 391 |
+
num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
|
| 392 |
+
print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
| 393 |
+
|
| 394 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
| 395 |
+
wanted_params = len(frozen_param_shapes)
|
| 396 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
| 397 |
+
avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
|
| 398 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
| 399 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
| 400 |
+
|
| 401 |
+
total_params = 0
|
| 402 |
+
total_numel = 0
|
| 403 |
+
for name, shape in zero_model_states[0].frozen_param_shapes.items():
|
| 404 |
+
total_params += 1
|
| 405 |
+
unpartitioned_numel = shape.numel()
|
| 406 |
+
total_numel += unpartitioned_numel
|
| 407 |
+
|
| 408 |
+
param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
|
| 409 |
+
state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
|
| 410 |
+
|
| 411 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
| 412 |
+
|
| 413 |
+
if debug:
|
| 414 |
+
print(
|
| 415 |
+
f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
| 416 |
+
)
|
| 417 |
+
|
| 418 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
| 419 |
+
|
| 420 |
+
|
| 421 |
+
class GatheredTensor:
|
| 422 |
+
"""
|
| 423 |
+
A pseudo tensor that collects partitioned weights.
|
| 424 |
+
It is more memory efficient when there are multiple groups.
|
| 425 |
+
"""
|
| 426 |
+
|
| 427 |
+
def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape):
|
| 428 |
+
self.flat_groups = flat_groups
|
| 429 |
+
self.flat_groups_offset = flat_groups_offset
|
| 430 |
+
self.offset = offset
|
| 431 |
+
self.partitioned_numel = partitioned_numel
|
| 432 |
+
self.shape = shape
|
| 433 |
+
self.dtype = self.flat_groups[0][0].dtype
|
| 434 |
+
|
| 435 |
+
def contiguous(self):
|
| 436 |
+
"""
|
| 437 |
+
Merge partitioned weights from flat_groups into a single tensor.
|
| 438 |
+
"""
|
| 439 |
+
end_idx = self.offset + self.partitioned_numel
|
| 440 |
+
world_size = len(self.flat_groups)
|
| 441 |
+
pad_flat_param_chunks = []
|
| 442 |
+
|
| 443 |
+
for rank_i in range(world_size):
|
| 444 |
+
# for each rank, we need to collect weights from related group/groups
|
| 445 |
+
flat_groups_at_rank_i = self.flat_groups[rank_i]
|
| 446 |
+
start_group_id = None
|
| 447 |
+
end_group_id = None
|
| 448 |
+
for group_id in range(len(self.flat_groups_offset)):
|
| 449 |
+
if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]:
|
| 450 |
+
start_group_id = group_id
|
| 451 |
+
if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]:
|
| 452 |
+
end_group_id = group_id
|
| 453 |
+
break
|
| 454 |
+
# collect weights from related group/groups
|
| 455 |
+
for group_id in range(start_group_id, end_group_id + 1):
|
| 456 |
+
flat_tensor = flat_groups_at_rank_i[group_id]
|
| 457 |
+
start_offset = self.offset - self.flat_groups_offset[group_id]
|
| 458 |
+
end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id]
|
| 459 |
+
pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset])
|
| 460 |
+
|
| 461 |
+
# collect weights from all ranks
|
| 462 |
+
pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0)
|
| 463 |
+
param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous()
|
| 464 |
+
return param
|
| 465 |
+
|
| 466 |
+
|
| 467 |
+
def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
| 468 |
+
param_shapes = zero_model_states[0].param_shapes
|
| 469 |
+
avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size
|
| 470 |
+
|
| 471 |
+
# Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
|
| 472 |
+
# param, re-consolidating each param, while dealing with padding if any
|
| 473 |
+
|
| 474 |
+
# merge list of dicts, preserving order
|
| 475 |
+
param_shapes = {k: v for d in param_shapes for k, v in d.items()}
|
| 476 |
+
|
| 477 |
+
if debug:
|
| 478 |
+
for i in range(world_size):
|
| 479 |
+
print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
|
| 480 |
+
|
| 481 |
+
wanted_params = len(param_shapes)
|
| 482 |
+
wanted_numel = sum(shape.numel() for shape in param_shapes.values())
|
| 483 |
+
# not asserting if there is a mismatch due to possible padding
|
| 484 |
+
avail_numel = fp32_flat_groups[0].numel() * world_size
|
| 485 |
+
print(f"Trainable params: Have {avail_numel} numels to process.")
|
| 486 |
+
print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
|
| 487 |
+
|
| 488 |
+
# params
|
| 489 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
| 490 |
+
# out-of-core computing solution
|
| 491 |
+
offset = 0
|
| 492 |
+
total_numel = 0
|
| 493 |
+
total_params = 0
|
| 494 |
+
flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]]))
|
| 495 |
+
for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'):
|
| 496 |
+
unpartitioned_numel = shape.numel()
|
| 497 |
+
total_numel += unpartitioned_numel
|
| 498 |
+
total_params += 1
|
| 499 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
| 500 |
+
|
| 501 |
+
if debug:
|
| 502 |
+
print(
|
| 503 |
+
f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
| 504 |
+
)
|
| 505 |
+
|
| 506 |
+
# memory efficient tensor
|
| 507 |
+
tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape)
|
| 508 |
+
state_dict[name] = tensor
|
| 509 |
+
offset += partitioned_numel
|
| 510 |
+
|
| 511 |
+
offset *= world_size
|
| 512 |
+
|
| 513 |
+
# Sanity check
|
| 514 |
+
if offset != avail_numel:
|
| 515 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
| 516 |
+
|
| 517 |
+
print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
|
| 518 |
+
|
| 519 |
+
|
| 520 |
+
def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 521 |
+
exclude_frozen_parameters):
|
| 522 |
+
state_dict = OrderedDict()
|
| 523 |
+
|
| 524 |
+
# buffers
|
| 525 |
+
buffers = zero_model_states[0].buffers
|
| 526 |
+
state_dict.update(buffers)
|
| 527 |
+
if debug:
|
| 528 |
+
print(f"added {len(buffers)} buffers")
|
| 529 |
+
|
| 530 |
+
if not exclude_frozen_parameters:
|
| 531 |
+
_zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
|
| 532 |
+
|
| 533 |
+
_zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
| 534 |
+
|
| 535 |
+
# recover shared parameters
|
| 536 |
+
for pair in zero_model_states[0].shared_params:
|
| 537 |
+
if pair[1] in state_dict:
|
| 538 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
| 539 |
+
|
| 540 |
+
return state_dict
|
| 541 |
+
|
| 542 |
+
|
| 543 |
+
def to_torch_tensor(state_dict, return_empty_tensor=False):
|
| 544 |
+
"""
|
| 545 |
+
Convert state_dict of GatheredTensor to torch tensor
|
| 546 |
+
"""
|
| 547 |
+
torch_state_dict = {}
|
| 548 |
+
converted_tensors = {}
|
| 549 |
+
for name, tensor in state_dict.items():
|
| 550 |
+
tensor_id = id(tensor)
|
| 551 |
+
if tensor_id in converted_tensors: # shared tensors
|
| 552 |
+
shared_tensor = torch_state_dict[converted_tensors[tensor_id]]
|
| 553 |
+
torch_state_dict[name] = shared_tensor
|
| 554 |
+
else:
|
| 555 |
+
converted_tensors[tensor_id] = name
|
| 556 |
+
if return_empty_tensor:
|
| 557 |
+
torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype)
|
| 558 |
+
else:
|
| 559 |
+
torch_state_dict[name] = tensor.contiguous()
|
| 560 |
+
return torch_state_dict
|
| 561 |
+
|
| 562 |
+
|
| 563 |
+
def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
|
| 564 |
+
tag=None,
|
| 565 |
+
exclude_frozen_parameters=False,
|
| 566 |
+
lazy_mode=False):
|
| 567 |
+
"""
|
| 568 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
|
| 569 |
+
``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
|
| 570 |
+
via a model hub.
|
| 571 |
+
|
| 572 |
+
Args:
|
| 573 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder
|
| 574 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
|
| 575 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
| 576 |
+
- ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient.
|
| 577 |
+
Convert the pesduo tensor to torch tensor by ``.contiguous()``
|
| 578 |
+
|
| 579 |
+
Returns:
|
| 580 |
+
- pytorch ``state_dict``
|
| 581 |
+
|
| 582 |
+
A typical usage might be ::
|
| 583 |
+
|
| 584 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
| 585 |
+
# do the training and checkpoint saving
|
| 586 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
|
| 587 |
+
model = model.cpu() # move to cpu
|
| 588 |
+
model.load_state_dict(state_dict)
|
| 589 |
+
# submit to model hub or save the model to share with others
|
| 590 |
+
|
| 591 |
+
In this example the ``model`` will no longer be usable in the deepspeed context of the same
|
| 592 |
+
application. i.e. you will need to re-initialize the deepspeed engine, since
|
| 593 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
| 594 |
+
|
| 595 |
+
If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
|
| 596 |
+
|
| 597 |
+
Note: the above usage may not work if your application doesn't have sufficient free CPU memory.
|
| 598 |
+
You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
|
| 599 |
+
the checkpoint. Or you can load state_dict in lazy mode ::
|
| 600 |
+
|
| 601 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
| 602 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu
|
| 603 |
+
for name, lazy_tensor in state_dict.item():
|
| 604 |
+
tensor = lazy_tensor.contiguous() # to cpu
|
| 605 |
+
print(name, tensor)
|
| 606 |
+
# del tensor to release memory if it no longer in use
|
| 607 |
+
"""
|
| 608 |
+
if tag is None:
|
| 609 |
+
latest_path = os.path.join(checkpoint_dir, 'latest')
|
| 610 |
+
if os.path.isfile(latest_path):
|
| 611 |
+
with open(latest_path, 'r') as fd:
|
| 612 |
+
tag = fd.read().strip()
|
| 613 |
+
else:
|
| 614 |
+
raise ValueError(f"Unable to find 'latest' file at {latest_path}")
|
| 615 |
+
|
| 616 |
+
ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
|
| 617 |
+
|
| 618 |
+
if not os.path.isdir(ds_checkpoint_dir):
|
| 619 |
+
raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
|
| 620 |
+
|
| 621 |
+
state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
|
| 622 |
+
if lazy_mode:
|
| 623 |
+
return state_dict
|
| 624 |
+
else:
|
| 625 |
+
return to_torch_tensor(state_dict)
|
| 626 |
+
|
| 627 |
+
|
| 628 |
+
def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
|
| 629 |
+
output_dir,
|
| 630 |
+
max_shard_size="5GB",
|
| 631 |
+
safe_serialization=False,
|
| 632 |
+
tag=None,
|
| 633 |
+
exclude_frozen_parameters=False):
|
| 634 |
+
"""
|
| 635 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
|
| 636 |
+
loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
|
| 637 |
+
|
| 638 |
+
Args:
|
| 639 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
| 640 |
+
- ``output_dir``: directory to the pytorch fp32 state_dict output files
|
| 641 |
+
- ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
|
| 642 |
+
- ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
|
| 643 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
| 644 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
| 645 |
+
"""
|
| 646 |
+
|
| 647 |
+
# Dependency pre-check
|
| 648 |
+
if safe_serialization:
|
| 649 |
+
try:
|
| 650 |
+
from safetensors.torch import save_file
|
| 651 |
+
except ImportError:
|
| 652 |
+
print('If you want to use `safe_serialization`, please `pip install safetensors`')
|
| 653 |
+
raise
|
| 654 |
+
if max_shard_size is not None:
|
| 655 |
+
try:
|
| 656 |
+
from huggingface_hub import split_torch_state_dict_into_shards
|
| 657 |
+
except ImportError:
|
| 658 |
+
print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
|
| 659 |
+
raise
|
| 660 |
+
|
| 661 |
+
# Convert zero checkpoint to state_dict
|
| 662 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
|
| 663 |
+
tag,
|
| 664 |
+
exclude_frozen_parameters,
|
| 665 |
+
lazy_mode=True)
|
| 666 |
+
|
| 667 |
+
# Shard the model if it is too big.
|
| 668 |
+
weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
|
| 669 |
+
if max_shard_size is not None:
|
| 670 |
+
filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
|
| 671 |
+
# an memory-efficient approach for sharding
|
| 672 |
+
empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True)
|
| 673 |
+
state_dict_split = split_torch_state_dict_into_shards(empty_state_dict,
|
| 674 |
+
filename_pattern=filename_pattern,
|
| 675 |
+
max_shard_size=max_shard_size)
|
| 676 |
+
else:
|
| 677 |
+
from collections import namedtuple
|
| 678 |
+
StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
|
| 679 |
+
state_dict_split = StateDictSplit(is_sharded=False,
|
| 680 |
+
filename_to_tensors={weights_name: list(state_dict.keys())})
|
| 681 |
+
|
| 682 |
+
# Save the model by shard
|
| 683 |
+
os.makedirs(output_dir, exist_ok=True)
|
| 684 |
+
filename_to_tensors = state_dict_split.filename_to_tensors.items()
|
| 685 |
+
for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
|
| 686 |
+
shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors}
|
| 687 |
+
shard_state_dict = to_torch_tensor(shard_state_dict)
|
| 688 |
+
output_path = os.path.join(output_dir, shard_file)
|
| 689 |
+
if safe_serialization:
|
| 690 |
+
save_file(shard_state_dict, output_path, metadata={"format": "pt"})
|
| 691 |
+
else:
|
| 692 |
+
torch.save(shard_state_dict, output_path)
|
| 693 |
+
# release the memory of current shard
|
| 694 |
+
for tensor_name in list(shard_state_dict.keys()):
|
| 695 |
+
del state_dict[tensor_name]
|
| 696 |
+
del shard_state_dict[tensor_name]
|
| 697 |
+
del shard_state_dict
|
| 698 |
+
gc.collect()
|
| 699 |
+
|
| 700 |
+
# Save index if sharded
|
| 701 |
+
if state_dict_split.is_sharded:
|
| 702 |
+
index = {
|
| 703 |
+
"metadata": state_dict_split.metadata,
|
| 704 |
+
"weight_map": state_dict_split.tensor_to_filename,
|
| 705 |
+
}
|
| 706 |
+
save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
|
| 707 |
+
save_index_file = os.path.join(output_dir, save_index_file)
|
| 708 |
+
with open(save_index_file, "w", encoding="utf-8") as f:
|
| 709 |
+
content = json.dumps(index, indent=2, sort_keys=True) + "\n"
|
| 710 |
+
f.write(content)
|
| 711 |
+
|
| 712 |
+
|
| 713 |
+
def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
|
| 714 |
+
"""
|
| 715 |
+
1. Put the provided model to cpu
|
| 716 |
+
2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
|
| 717 |
+
3. Load it into the provided model
|
| 718 |
+
|
| 719 |
+
Args:
|
| 720 |
+
- ``model``: the model object to update
|
| 721 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
| 722 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
| 723 |
+
|
| 724 |
+
Returns:
|
| 725 |
+
- ``model`: modified model
|
| 726 |
+
|
| 727 |
+
Make sure you have plenty of CPU memory available before you call this function. If you don't
|
| 728 |
+
have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
|
| 729 |
+
conveniently placed for you in the checkpoint folder.
|
| 730 |
+
|
| 731 |
+
A typical usage might be ::
|
| 732 |
+
|
| 733 |
+
from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
|
| 734 |
+
model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
|
| 735 |
+
# submit to model hub or save the model to share with others
|
| 736 |
+
|
| 737 |
+
Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
|
| 738 |
+
of the same application. i.e. you will need to re-initialize the deepspeed engine, since
|
| 739 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
| 740 |
+
|
| 741 |
+
"""
|
| 742 |
+
logger.info("Extracting fp32 weights")
|
| 743 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
|
| 744 |
+
|
| 745 |
+
logger.info("Overwriting model with fp32 weights")
|
| 746 |
+
model = model.cpu()
|
| 747 |
+
model.load_state_dict(state_dict, strict=False)
|
| 748 |
+
|
| 749 |
+
return model
|
| 750 |
+
|
| 751 |
+
|
| 752 |
+
if __name__ == "__main__":
|
| 753 |
+
parser = argparse.ArgumentParser()
|
| 754 |
+
parser.add_argument("checkpoint_dir",
|
| 755 |
+
type=str,
|
| 756 |
+
help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
|
| 757 |
+
parser.add_argument("output_dir",
|
| 758 |
+
type=str,
|
| 759 |
+
help="directory to the pytorch fp32 state_dict output files"
|
| 760 |
+
"(e.g. path/checkpoint-12-output/)")
|
| 761 |
+
parser.add_argument(
|
| 762 |
+
"--max_shard_size",
|
| 763 |
+
type=str,
|
| 764 |
+
default="5GB",
|
| 765 |
+
help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
|
| 766 |
+
"lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
|
| 767 |
+
"We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
|
| 768 |
+
"without CPU OOM issues.")
|
| 769 |
+
parser.add_argument(
|
| 770 |
+
"--safe_serialization",
|
| 771 |
+
default=False,
|
| 772 |
+
action='store_true',
|
| 773 |
+
help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
|
| 774 |
+
parser.add_argument("-t",
|
| 775 |
+
"--tag",
|
| 776 |
+
type=str,
|
| 777 |
+
default=None,
|
| 778 |
+
help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
|
| 779 |
+
parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
|
| 780 |
+
parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
|
| 781 |
+
args = parser.parse_args()
|
| 782 |
+
|
| 783 |
+
debug = args.debug
|
| 784 |
+
|
| 785 |
+
convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
|
| 786 |
+
args.output_dir,
|
| 787 |
+
max_shard_size=args.max_shard_size,
|
| 788 |
+
safe_serialization=args.safe_serialization,
|
| 789 |
+
tag=args.tag,
|
| 790 |
+
exclude_frozen_parameters=args.exclude_frozen_parameters)
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_0_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ae55731dbe49f8760d2099674933ce4b94768d2987745bf5819987da1d4f5bea
|
| 3 |
+
size 8066587624
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_1_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d969c0cdb76cf640048e839fb4104f44c2617c95278b8571f032ab6cc31f523c
|
| 3 |
+
size 8066569384
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_2_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:24de5415e2f6f4c4b10b2c7522e9823d6879c0a79e1885effde6d8843dedbc71
|
| 3 |
+
size 8066573800
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/bf16_zero_pp_rank_3_mp_rank_00_optim_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c23946c17da3de50594dc9e4ea664ebdfd5f38eaf5c4d7ff7225695f582e0cb3
|
| 3 |
+
size 8066572904
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/global_step50000/mp_rank_00_model_states.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a83a866c0225312d921853b93e1113a9cb9440c913fd80d978b543cb98ccc98c
|
| 3 |
+
size 5378170340
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/latest
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
global_step50000
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final/zero_to_fp32.py
ADDED
|
@@ -0,0 +1,790 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python
|
| 2 |
+
|
| 3 |
+
# Copyright (c) Microsoft Corporation.
|
| 4 |
+
# SPDX-License-Identifier: Apache-2.0
|
| 5 |
+
|
| 6 |
+
# DeepSpeed Team
|
| 7 |
+
|
| 8 |
+
# This script extracts fp32 consolidated weights from a zero 1, 2 and 3 DeepSpeed checkpoints. It gets
|
| 9 |
+
# copied into the top level checkpoint dir, so the user can easily do the conversion at any point in
|
| 10 |
+
# the future. Once extracted, the weights don't require DeepSpeed and can be used in any
|
| 11 |
+
# application.
|
| 12 |
+
#
|
| 13 |
+
# example:
|
| 14 |
+
# python zero_to_fp32.py . output_dir/
|
| 15 |
+
# or
|
| 16 |
+
# python zero_to_fp32.py . output_dir/ --safe_serialization
|
| 17 |
+
|
| 18 |
+
import argparse
|
| 19 |
+
import torch
|
| 20 |
+
import glob
|
| 21 |
+
import math
|
| 22 |
+
import os
|
| 23 |
+
import re
|
| 24 |
+
import gc
|
| 25 |
+
import json
|
| 26 |
+
import numpy as np
|
| 27 |
+
from tqdm import tqdm
|
| 28 |
+
from collections import OrderedDict
|
| 29 |
+
from dataclasses import dataclass
|
| 30 |
+
|
| 31 |
+
# while this script doesn't use deepspeed to recover data, since the checkpoints are pickled with
|
| 32 |
+
# DeepSpeed data structures it has to be available in the current python environment.
|
| 33 |
+
from deepspeed.utils import logger
|
| 34 |
+
from deepspeed.checkpoint.constants import (DS_VERSION, OPTIMIZER_STATE_DICT, SINGLE_PARTITION_OF_FP32_GROUPS,
|
| 35 |
+
FP32_FLAT_GROUPS, ZERO_STAGE, PARTITION_COUNT, PARAM_SHAPES, BUFFER_NAMES,
|
| 36 |
+
FROZEN_PARAM_SHAPES, FROZEN_PARAM_FRAGMENTS, AUTOEP_LAYERS_KEY,
|
| 37 |
+
AUTOEP_LAYERS_KEY_LEGACY, AUTOEP_ZERO3_EXPERT_STATE_FORMAT_KEY,
|
| 38 |
+
AUTOEP_ZERO3_PARTITIONED_EXPERT_STATE_FORMAT)
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
@dataclass
|
| 42 |
+
class zero_model_state:
|
| 43 |
+
buffers: dict()
|
| 44 |
+
param_shapes: dict()
|
| 45 |
+
shared_params: list
|
| 46 |
+
ds_version: int
|
| 47 |
+
frozen_param_shapes: dict()
|
| 48 |
+
frozen_param_fragments: dict()
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
debug = 0
|
| 52 |
+
|
| 53 |
+
# load to cpu
|
| 54 |
+
device = torch.device('cpu')
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
def atoi(text):
|
| 58 |
+
return int(text) if text.isdigit() else text
|
| 59 |
+
|
| 60 |
+
|
| 61 |
+
def natural_keys(text):
|
| 62 |
+
'''
|
| 63 |
+
alist.sort(key=natural_keys) sorts in human order
|
| 64 |
+
http://nedbatchelder.com/blog/200712/human_sorting.html
|
| 65 |
+
(See Toothy's implementation in the comments)
|
| 66 |
+
'''
|
| 67 |
+
return [atoi(c) for c in re.split(r'(\d+)', text)]
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def get_model_state_file(checkpoint_dir, zero_stage):
|
| 71 |
+
if not os.path.isdir(checkpoint_dir):
|
| 72 |
+
raise FileNotFoundError(f"Directory '{checkpoint_dir}' doesn't exist")
|
| 73 |
+
|
| 74 |
+
# there should be only one file
|
| 75 |
+
if zero_stage <= 2:
|
| 76 |
+
file = os.path.join(checkpoint_dir, "mp_rank_00_model_states.pt")
|
| 77 |
+
elif zero_stage == 3:
|
| 78 |
+
file = os.path.join(checkpoint_dir, "zero_pp_rank_0_mp_rank_00_model_states.pt")
|
| 79 |
+
|
| 80 |
+
if not os.path.exists(file):
|
| 81 |
+
raise FileNotFoundError(f"can't find model states file at '{file}'")
|
| 82 |
+
|
| 83 |
+
return file
|
| 84 |
+
|
| 85 |
+
|
| 86 |
+
def get_checkpoint_files(checkpoint_dir, glob_pattern):
|
| 87 |
+
# XXX: need to test that this simple glob rule works for multi-node setup too
|
| 88 |
+
ckpt_files = sorted(glob.glob(os.path.join(checkpoint_dir, glob_pattern)), key=natural_keys)
|
| 89 |
+
|
| 90 |
+
if len(ckpt_files) == 0:
|
| 91 |
+
raise FileNotFoundError(f"can't find {glob_pattern} files in directory '{checkpoint_dir}'")
|
| 92 |
+
|
| 93 |
+
return ckpt_files
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
def get_optim_files(checkpoint_dir):
|
| 97 |
+
return get_checkpoint_files(checkpoint_dir, "*_optim_states.pt")
|
| 98 |
+
|
| 99 |
+
|
| 100 |
+
def get_model_state_files(checkpoint_dir):
|
| 101 |
+
return get_checkpoint_files(checkpoint_dir, "*_model_states.pt")
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
def _has_autoep_zero3_partitioned_metadata(state_dict):
|
| 105 |
+
autoep_layers = state_dict.get(AUTOEP_LAYERS_KEY)
|
| 106 |
+
if autoep_layers is None:
|
| 107 |
+
autoep_layers = state_dict.get(AUTOEP_LAYERS_KEY_LEGACY)
|
| 108 |
+
if not isinstance(autoep_layers, list):
|
| 109 |
+
return False
|
| 110 |
+
return any(
|
| 111 |
+
isinstance(entry, dict)
|
| 112 |
+
and entry.get(AUTOEP_ZERO3_EXPERT_STATE_FORMAT_KEY) == AUTOEP_ZERO3_PARTITIONED_EXPERT_STATE_FORMAT
|
| 113 |
+
for entry in autoep_layers)
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
def _raise_if_autoep_zero3_partitioned_state(state_dict):
|
| 117 |
+
if _has_autoep_zero3_partitioned_metadata(state_dict):
|
| 118 |
+
raise NotImplementedError("zero_to_fp32 does not support AutoEP ZeRO-3 partition-native checkpoints. "
|
| 119 |
+
"AutoEP expert parameters are partitioned over expert replica groups, so "
|
| 120 |
+
"global data-parallel consolidation would produce incomplete expert tensors. "
|
| 121 |
+
"Use ds_to_universal.py for expert-aware conversion.")
|
| 122 |
+
|
| 123 |
+
|
| 124 |
+
def _raise_if_autoep_zero3_partitioned_checkpoint(model_files):
|
| 125 |
+
for file in model_files:
|
| 126 |
+
state_dict = torch.load(file, map_location=device, weights_only=False)
|
| 127 |
+
_raise_if_autoep_zero3_partitioned_state(state_dict)
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
def parse_model_states(files):
|
| 131 |
+
zero_model_states = []
|
| 132 |
+
for file in files:
|
| 133 |
+
state_dict = torch.load(file, map_location=device, weights_only=False)
|
| 134 |
+
_raise_if_autoep_zero3_partitioned_state(state_dict)
|
| 135 |
+
|
| 136 |
+
if BUFFER_NAMES not in state_dict:
|
| 137 |
+
raise ValueError(f"{file} is not a model state checkpoint")
|
| 138 |
+
buffer_names = state_dict[BUFFER_NAMES]
|
| 139 |
+
if debug:
|
| 140 |
+
print("Found buffers:", buffer_names)
|
| 141 |
+
|
| 142 |
+
# recover just the buffers while restoring them to fp32 if they were saved in fp16
|
| 143 |
+
buffers = {k: v.float() for k, v in state_dict["module"].items() if k in buffer_names}
|
| 144 |
+
param_shapes = state_dict[PARAM_SHAPES]
|
| 145 |
+
|
| 146 |
+
# collect parameters that are included in param_shapes
|
| 147 |
+
param_names = []
|
| 148 |
+
for s in param_shapes:
|
| 149 |
+
for name in s.keys():
|
| 150 |
+
param_names.append(name)
|
| 151 |
+
|
| 152 |
+
# update with frozen parameters
|
| 153 |
+
frozen_param_shapes = state_dict.get(FROZEN_PARAM_SHAPES, None)
|
| 154 |
+
if frozen_param_shapes is not None:
|
| 155 |
+
if debug:
|
| 156 |
+
print(f"Found frozen_param_shapes: {frozen_param_shapes}")
|
| 157 |
+
param_names += list(frozen_param_shapes.keys())
|
| 158 |
+
|
| 159 |
+
# handle shared params
|
| 160 |
+
shared_params = [[k, v] for k, v in state_dict["shared_params"].items()]
|
| 161 |
+
|
| 162 |
+
ds_version = state_dict.get(DS_VERSION, None)
|
| 163 |
+
|
| 164 |
+
frozen_param_fragments = state_dict.get(FROZEN_PARAM_FRAGMENTS, None)
|
| 165 |
+
|
| 166 |
+
z_model_state = zero_model_state(buffers=buffers,
|
| 167 |
+
param_shapes=param_shapes,
|
| 168 |
+
shared_params=shared_params,
|
| 169 |
+
ds_version=ds_version,
|
| 170 |
+
frozen_param_shapes=frozen_param_shapes,
|
| 171 |
+
frozen_param_fragments=frozen_param_fragments)
|
| 172 |
+
zero_model_states.append(z_model_state)
|
| 173 |
+
|
| 174 |
+
return zero_model_states
|
| 175 |
+
|
| 176 |
+
|
| 177 |
+
def parse_optim_states(files, ds_checkpoint_dir):
|
| 178 |
+
total_files = len(files)
|
| 179 |
+
state_dicts = []
|
| 180 |
+
for f in tqdm(files, desc='Loading checkpoint shards'):
|
| 181 |
+
state_dict = torch.load(f, map_location=device, mmap=True, weights_only=False)
|
| 182 |
+
# immediately discard the potentially huge 2 optimizer states as we only care for fp32 master weights
|
| 183 |
+
# and also handle the case where it was already removed by another helper script
|
| 184 |
+
state_dict["optimizer_state_dict"].pop("optimizer_state_dict", None)
|
| 185 |
+
state_dicts.append(state_dict)
|
| 186 |
+
|
| 187 |
+
if ZERO_STAGE not in state_dicts[0][OPTIMIZER_STATE_DICT]:
|
| 188 |
+
raise ValueError(f"{files[0]} is not a zero checkpoint")
|
| 189 |
+
zero_stage = state_dicts[0][OPTIMIZER_STATE_DICT][ZERO_STAGE]
|
| 190 |
+
world_size = state_dicts[0][OPTIMIZER_STATE_DICT][PARTITION_COUNT]
|
| 191 |
+
|
| 192 |
+
# For ZeRO-2 each param group can have different partition_count as data parallelism for expert
|
| 193 |
+
# parameters can be different from data parallelism for non-expert parameters. So we can just
|
| 194 |
+
# use the max of the partition_count to get the dp world_size.
|
| 195 |
+
|
| 196 |
+
if type(world_size) is list:
|
| 197 |
+
world_size = max(world_size)
|
| 198 |
+
|
| 199 |
+
if world_size != total_files:
|
| 200 |
+
raise ValueError(
|
| 201 |
+
f"Expected {world_size} of '*_optim_states.pt' under '{ds_checkpoint_dir}' but found {total_files} files. "
|
| 202 |
+
"Possibly due to an overwrite of an old checkpoint, or a checkpoint didn't get saved by one or more processes."
|
| 203 |
+
)
|
| 204 |
+
|
| 205 |
+
# the groups are named differently in each stage
|
| 206 |
+
if zero_stage <= 2:
|
| 207 |
+
fp32_groups_key = SINGLE_PARTITION_OF_FP32_GROUPS
|
| 208 |
+
elif zero_stage == 3:
|
| 209 |
+
fp32_groups_key = FP32_FLAT_GROUPS
|
| 210 |
+
else:
|
| 211 |
+
raise ValueError(f"unknown zero stage {zero_stage}")
|
| 212 |
+
|
| 213 |
+
fp32_flat_groups = [state_dicts[i][OPTIMIZER_STATE_DICT][fp32_groups_key] for i in range(len(state_dicts))]
|
| 214 |
+
return zero_stage, world_size, fp32_flat_groups
|
| 215 |
+
|
| 216 |
+
|
| 217 |
+
def _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters):
|
| 218 |
+
"""
|
| 219 |
+
Returns fp32 state_dict reconstructed from ds checkpoint
|
| 220 |
+
|
| 221 |
+
Args:
|
| 222 |
+
- ``ds_checkpoint_dir``: path to the deepspeed checkpoint folder (where the optimizer files are)
|
| 223 |
+
|
| 224 |
+
"""
|
| 225 |
+
print(f"Processing zero checkpoint '{ds_checkpoint_dir}'")
|
| 226 |
+
|
| 227 |
+
# parse_model_states rejects AutoEP ZeRO-3 partition-native checkpoints
|
| 228 |
+
# before the expensive optimizer-shard load below.
|
| 229 |
+
model_files = get_model_state_files(ds_checkpoint_dir)
|
| 230 |
+
zero_model_states = parse_model_states(model_files)
|
| 231 |
+
print(f'Parsing checkpoint created by deepspeed=={zero_model_states[0].ds_version}')
|
| 232 |
+
|
| 233 |
+
optim_files = get_optim_files(ds_checkpoint_dir)
|
| 234 |
+
zero_stage, world_size, fp32_flat_groups = parse_optim_states(optim_files, ds_checkpoint_dir)
|
| 235 |
+
print(f"Detected checkpoint of type zero stage {zero_stage}, world_size: {world_size}")
|
| 236 |
+
|
| 237 |
+
if zero_stage <= 2:
|
| 238 |
+
return _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 239 |
+
exclude_frozen_parameters)
|
| 240 |
+
elif zero_stage == 3:
|
| 241 |
+
return _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 242 |
+
exclude_frozen_parameters)
|
| 243 |
+
|
| 244 |
+
|
| 245 |
+
def _zero2_merge_frozen_params(state_dict, zero_model_states):
|
| 246 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
| 247 |
+
return
|
| 248 |
+
|
| 249 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
| 250 |
+
frozen_param_fragments = zero_model_states[0].frozen_param_fragments
|
| 251 |
+
|
| 252 |
+
if debug:
|
| 253 |
+
num_elem = sum(s.numel() for s in frozen_param_shapes.values())
|
| 254 |
+
print(f'rank 0: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
| 255 |
+
|
| 256 |
+
wanted_params = len(frozen_param_shapes)
|
| 257 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
| 258 |
+
avail_numel = sum([p.numel() for p in frozen_param_fragments.values()])
|
| 259 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
| 260 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
| 261 |
+
|
| 262 |
+
total_params = 0
|
| 263 |
+
total_numel = 0
|
| 264 |
+
for name, shape in frozen_param_shapes.items():
|
| 265 |
+
total_params += 1
|
| 266 |
+
unpartitioned_numel = shape.numel()
|
| 267 |
+
total_numel += unpartitioned_numel
|
| 268 |
+
|
| 269 |
+
state_dict[name] = frozen_param_fragments[name]
|
| 270 |
+
|
| 271 |
+
if debug:
|
| 272 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
| 273 |
+
|
| 274 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
| 275 |
+
|
| 276 |
+
|
| 277 |
+
def _has_callable(obj, fn):
|
| 278 |
+
attr = getattr(obj, fn, None)
|
| 279 |
+
return callable(attr)
|
| 280 |
+
|
| 281 |
+
|
| 282 |
+
def _zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
| 283 |
+
param_shapes = zero_model_states[0].param_shapes
|
| 284 |
+
|
| 285 |
+
# Reconstruction protocol:
|
| 286 |
+
#
|
| 287 |
+
# XXX: document this
|
| 288 |
+
|
| 289 |
+
if debug:
|
| 290 |
+
for i in range(world_size):
|
| 291 |
+
for j in range(len(fp32_flat_groups[0])):
|
| 292 |
+
print(f"{FP32_FLAT_GROUPS}[{i}][{j}].shape={fp32_flat_groups[i][j].shape}")
|
| 293 |
+
|
| 294 |
+
# XXX: memory usage doubles here (zero2)
|
| 295 |
+
num_param_groups = len(fp32_flat_groups[0])
|
| 296 |
+
merged_single_partition_of_fp32_groups = []
|
| 297 |
+
for i in range(num_param_groups):
|
| 298 |
+
merged_partitions = [sd[i] for sd in fp32_flat_groups]
|
| 299 |
+
full_single_fp32_vector = torch.cat(merged_partitions, 0)
|
| 300 |
+
merged_single_partition_of_fp32_groups.append(full_single_fp32_vector)
|
| 301 |
+
avail_numel = sum(
|
| 302 |
+
[full_single_fp32_vector.numel() for full_single_fp32_vector in merged_single_partition_of_fp32_groups])
|
| 303 |
+
|
| 304 |
+
if debug:
|
| 305 |
+
wanted_params = sum([len(shapes) for shapes in param_shapes])
|
| 306 |
+
wanted_numel = sum([sum(shape.numel() for shape in shapes.values()) for shapes in param_shapes])
|
| 307 |
+
# not asserting if there is a mismatch due to possible padding
|
| 308 |
+
print(f"Have {avail_numel} numels to process.")
|
| 309 |
+
print(f"Need {wanted_numel} numels in {wanted_params} params.")
|
| 310 |
+
|
| 311 |
+
# params
|
| 312 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
| 313 |
+
# out-of-core computing solution
|
| 314 |
+
total_numel = 0
|
| 315 |
+
total_params = 0
|
| 316 |
+
for shapes, full_single_fp32_vector in zip(param_shapes, merged_single_partition_of_fp32_groups):
|
| 317 |
+
offset = 0
|
| 318 |
+
avail_numel = full_single_fp32_vector.numel()
|
| 319 |
+
for name, shape in shapes.items():
|
| 320 |
+
|
| 321 |
+
unpartitioned_numel = shape.numel() if _has_callable(shape, 'numel') else math.prod(shape)
|
| 322 |
+
total_numel += unpartitioned_numel
|
| 323 |
+
total_params += 1
|
| 324 |
+
|
| 325 |
+
if debug:
|
| 326 |
+
print(f"{name} full shape: {shape} unpartitioned numel {unpartitioned_numel} ")
|
| 327 |
+
state_dict[name] = full_single_fp32_vector.narrow(0, offset, unpartitioned_numel).view(shape)
|
| 328 |
+
offset += unpartitioned_numel
|
| 329 |
+
|
| 330 |
+
# Z2 started to align to 2*world_size to improve nccl performance. Therefore both offset and
|
| 331 |
+
# avail_numel can differ by anywhere between 0..2*world_size. Due to two unrelated complex
|
| 332 |
+
# paddings performed in the code it's almost impossible to predict the exact numbers w/o the
|
| 333 |
+
# live optimizer object, so we are checking that the numbers are within the right range
|
| 334 |
+
align_to = 2 * world_size
|
| 335 |
+
|
| 336 |
+
def zero2_align(x):
|
| 337 |
+
return align_to * math.ceil(x / align_to)
|
| 338 |
+
|
| 339 |
+
if debug:
|
| 340 |
+
print(f"original offset={offset}, avail_numel={avail_numel}")
|
| 341 |
+
|
| 342 |
+
offset = zero2_align(offset)
|
| 343 |
+
avail_numel = zero2_align(avail_numel)
|
| 344 |
+
|
| 345 |
+
if debug:
|
| 346 |
+
print(f"aligned offset={offset}, avail_numel={avail_numel}")
|
| 347 |
+
|
| 348 |
+
# Sanity check
|
| 349 |
+
if offset != avail_numel:
|
| 350 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
| 351 |
+
|
| 352 |
+
print(f"Reconstructed fp32 state dict with {total_params} params {total_numel} elements")
|
| 353 |
+
|
| 354 |
+
|
| 355 |
+
def _get_fp32_state_dict_from_zero2_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 356 |
+
exclude_frozen_parameters):
|
| 357 |
+
state_dict = OrderedDict()
|
| 358 |
+
|
| 359 |
+
# buffers
|
| 360 |
+
buffers = zero_model_states[0].buffers
|
| 361 |
+
state_dict.update(buffers)
|
| 362 |
+
if debug:
|
| 363 |
+
print(f"added {len(buffers)} buffers")
|
| 364 |
+
|
| 365 |
+
if not exclude_frozen_parameters:
|
| 366 |
+
_zero2_merge_frozen_params(state_dict, zero_model_states)
|
| 367 |
+
|
| 368 |
+
_zero2_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
| 369 |
+
|
| 370 |
+
# recover shared parameters
|
| 371 |
+
for pair in zero_model_states[0].shared_params:
|
| 372 |
+
if pair[1] in state_dict:
|
| 373 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
| 374 |
+
|
| 375 |
+
return state_dict
|
| 376 |
+
|
| 377 |
+
|
| 378 |
+
def zero3_partitioned_param_info(unpartitioned_numel, world_size):
|
| 379 |
+
remainder = unpartitioned_numel % world_size
|
| 380 |
+
padding_numel = (world_size - remainder) if remainder else 0
|
| 381 |
+
partitioned_numel = math.ceil(unpartitioned_numel / world_size)
|
| 382 |
+
return partitioned_numel, padding_numel
|
| 383 |
+
|
| 384 |
+
|
| 385 |
+
def _zero3_merge_frozen_params(state_dict, world_size, zero_model_states):
|
| 386 |
+
if zero_model_states[0].frozen_param_shapes is None or len(zero_model_states[0].frozen_param_shapes) == 0:
|
| 387 |
+
return
|
| 388 |
+
|
| 389 |
+
if debug:
|
| 390 |
+
for i in range(world_size):
|
| 391 |
+
num_elem = sum(s.numel() for s in zero_model_states[i].frozen_param_fragments.values())
|
| 392 |
+
print(f'rank {i}: {FROZEN_PARAM_SHAPES}.numel = {num_elem}')
|
| 393 |
+
|
| 394 |
+
frozen_param_shapes = zero_model_states[0].frozen_param_shapes
|
| 395 |
+
wanted_params = len(frozen_param_shapes)
|
| 396 |
+
wanted_numel = sum(s.numel() for s in frozen_param_shapes.values())
|
| 397 |
+
avail_numel = sum([p.numel() for p in zero_model_states[0].frozen_param_fragments.values()]) * world_size
|
| 398 |
+
print(f'Frozen params: Have {avail_numel} numels to process.')
|
| 399 |
+
print(f'Frozen params: Need {wanted_numel} numels in {wanted_params} params')
|
| 400 |
+
|
| 401 |
+
total_params = 0
|
| 402 |
+
total_numel = 0
|
| 403 |
+
for name, shape in zero_model_states[0].frozen_param_shapes.items():
|
| 404 |
+
total_params += 1
|
| 405 |
+
unpartitioned_numel = shape.numel()
|
| 406 |
+
total_numel += unpartitioned_numel
|
| 407 |
+
|
| 408 |
+
param_frags = tuple(model_state.frozen_param_fragments[name] for model_state in zero_model_states)
|
| 409 |
+
state_dict[name] = torch.cat(param_frags, 0).narrow(0, 0, unpartitioned_numel).view(shape)
|
| 410 |
+
|
| 411 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
| 412 |
+
|
| 413 |
+
if debug:
|
| 414 |
+
print(
|
| 415 |
+
f"Frozen params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
| 416 |
+
)
|
| 417 |
+
|
| 418 |
+
print(f"Reconstructed Frozen fp32 state dict with {total_params} params {total_numel} elements")
|
| 419 |
+
|
| 420 |
+
|
| 421 |
+
class GatheredTensor:
|
| 422 |
+
"""
|
| 423 |
+
A pseudo tensor that collects partitioned weights.
|
| 424 |
+
It is more memory efficient when there are multiple groups.
|
| 425 |
+
"""
|
| 426 |
+
|
| 427 |
+
def __init__(self, flat_groups, flat_groups_offset, offset, partitioned_numel, shape):
|
| 428 |
+
self.flat_groups = flat_groups
|
| 429 |
+
self.flat_groups_offset = flat_groups_offset
|
| 430 |
+
self.offset = offset
|
| 431 |
+
self.partitioned_numel = partitioned_numel
|
| 432 |
+
self.shape = shape
|
| 433 |
+
self.dtype = self.flat_groups[0][0].dtype
|
| 434 |
+
|
| 435 |
+
def contiguous(self):
|
| 436 |
+
"""
|
| 437 |
+
Merge partitioned weights from flat_groups into a single tensor.
|
| 438 |
+
"""
|
| 439 |
+
end_idx = self.offset + self.partitioned_numel
|
| 440 |
+
world_size = len(self.flat_groups)
|
| 441 |
+
pad_flat_param_chunks = []
|
| 442 |
+
|
| 443 |
+
for rank_i in range(world_size):
|
| 444 |
+
# for each rank, we need to collect weights from related group/groups
|
| 445 |
+
flat_groups_at_rank_i = self.flat_groups[rank_i]
|
| 446 |
+
start_group_id = None
|
| 447 |
+
end_group_id = None
|
| 448 |
+
for group_id in range(len(self.flat_groups_offset)):
|
| 449 |
+
if self.flat_groups_offset[group_id] <= self.offset < self.flat_groups_offset[group_id + 1]:
|
| 450 |
+
start_group_id = group_id
|
| 451 |
+
if self.flat_groups_offset[group_id] < end_idx <= self.flat_groups_offset[group_id + 1]:
|
| 452 |
+
end_group_id = group_id
|
| 453 |
+
break
|
| 454 |
+
# collect weights from related group/groups
|
| 455 |
+
for group_id in range(start_group_id, end_group_id + 1):
|
| 456 |
+
flat_tensor = flat_groups_at_rank_i[group_id]
|
| 457 |
+
start_offset = self.offset - self.flat_groups_offset[group_id]
|
| 458 |
+
end_offset = min(end_idx, self.flat_groups_offset[group_id + 1]) - self.flat_groups_offset[group_id]
|
| 459 |
+
pad_flat_param_chunks.append(flat_tensor[start_offset:end_offset])
|
| 460 |
+
|
| 461 |
+
# collect weights from all ranks
|
| 462 |
+
pad_flat_param = torch.cat(pad_flat_param_chunks, dim=0)
|
| 463 |
+
param = pad_flat_param[:self.shape.numel()].view(self.shape).contiguous()
|
| 464 |
+
return param
|
| 465 |
+
|
| 466 |
+
|
| 467 |
+
def _zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states):
|
| 468 |
+
param_shapes = zero_model_states[0].param_shapes
|
| 469 |
+
avail_numel = sum([flat_group.numel() for flat_group in fp32_flat_groups[0]]) * world_size
|
| 470 |
+
|
| 471 |
+
# Reconstruction protocol: For zero3 we need to zip the partitions together at boundary of each
|
| 472 |
+
# param, re-consolidating each param, while dealing with padding if any
|
| 473 |
+
|
| 474 |
+
# merge list of dicts, preserving order
|
| 475 |
+
param_shapes = {k: v for d in param_shapes for k, v in d.items()}
|
| 476 |
+
|
| 477 |
+
if debug:
|
| 478 |
+
for i in range(world_size):
|
| 479 |
+
print(f"{FP32_FLAT_GROUPS}[{i}].shape={fp32_flat_groups[i].shape}")
|
| 480 |
+
|
| 481 |
+
wanted_params = len(param_shapes)
|
| 482 |
+
wanted_numel = sum(shape.numel() for shape in param_shapes.values())
|
| 483 |
+
# not asserting if there is a mismatch due to possible padding
|
| 484 |
+
avail_numel = fp32_flat_groups[0].numel() * world_size
|
| 485 |
+
print(f"Trainable params: Have {avail_numel} numels to process.")
|
| 486 |
+
print(f"Trainable params: Need {wanted_numel} numels in {wanted_params} params.")
|
| 487 |
+
|
| 488 |
+
# params
|
| 489 |
+
# XXX: for huge models that can't fit into the host's RAM we will have to recode this to support
|
| 490 |
+
# out-of-core computing solution
|
| 491 |
+
offset = 0
|
| 492 |
+
total_numel = 0
|
| 493 |
+
total_params = 0
|
| 494 |
+
flat_groups_offset = [0] + list(np.cumsum([flat_tensor.numel() for flat_tensor in fp32_flat_groups[0]]))
|
| 495 |
+
for name, shape in tqdm(param_shapes.items(), desc='Gathering sharded weights'):
|
| 496 |
+
unpartitioned_numel = shape.numel()
|
| 497 |
+
total_numel += unpartitioned_numel
|
| 498 |
+
total_params += 1
|
| 499 |
+
partitioned_numel, partitioned_padding_numel = zero3_partitioned_param_info(unpartitioned_numel, world_size)
|
| 500 |
+
|
| 501 |
+
if debug:
|
| 502 |
+
print(
|
| 503 |
+
f"Trainable params: {total_params} {name} full shape: {shape} partition0 numel={partitioned_numel} partitioned_padding_numel={partitioned_padding_numel}"
|
| 504 |
+
)
|
| 505 |
+
|
| 506 |
+
# memory efficient tensor
|
| 507 |
+
tensor = GatheredTensor(fp32_flat_groups, flat_groups_offset, offset, partitioned_numel, shape)
|
| 508 |
+
state_dict[name] = tensor
|
| 509 |
+
offset += partitioned_numel
|
| 510 |
+
|
| 511 |
+
offset *= world_size
|
| 512 |
+
|
| 513 |
+
# Sanity check
|
| 514 |
+
if offset != avail_numel:
|
| 515 |
+
raise ValueError(f"consumed {offset} numels out of {avail_numel} - something is wrong")
|
| 516 |
+
|
| 517 |
+
print(f"Reconstructed Trainable fp32 state dict with {total_params} params {total_numel} elements")
|
| 518 |
+
|
| 519 |
+
|
| 520 |
+
def _get_fp32_state_dict_from_zero3_checkpoint(world_size, fp32_flat_groups, zero_model_states,
|
| 521 |
+
exclude_frozen_parameters):
|
| 522 |
+
state_dict = OrderedDict()
|
| 523 |
+
|
| 524 |
+
# buffers
|
| 525 |
+
buffers = zero_model_states[0].buffers
|
| 526 |
+
state_dict.update(buffers)
|
| 527 |
+
if debug:
|
| 528 |
+
print(f"added {len(buffers)} buffers")
|
| 529 |
+
|
| 530 |
+
if not exclude_frozen_parameters:
|
| 531 |
+
_zero3_merge_frozen_params(state_dict, world_size, zero_model_states)
|
| 532 |
+
|
| 533 |
+
_zero3_merge_trainable_params(state_dict, world_size, fp32_flat_groups, zero_model_states)
|
| 534 |
+
|
| 535 |
+
# recover shared parameters
|
| 536 |
+
for pair in zero_model_states[0].shared_params:
|
| 537 |
+
if pair[1] in state_dict:
|
| 538 |
+
state_dict[pair[0]] = state_dict[pair[1]]
|
| 539 |
+
|
| 540 |
+
return state_dict
|
| 541 |
+
|
| 542 |
+
|
| 543 |
+
def to_torch_tensor(state_dict, return_empty_tensor=False):
|
| 544 |
+
"""
|
| 545 |
+
Convert state_dict of GatheredTensor to torch tensor
|
| 546 |
+
"""
|
| 547 |
+
torch_state_dict = {}
|
| 548 |
+
converted_tensors = {}
|
| 549 |
+
for name, tensor in state_dict.items():
|
| 550 |
+
tensor_id = id(tensor)
|
| 551 |
+
if tensor_id in converted_tensors: # shared tensors
|
| 552 |
+
shared_tensor = torch_state_dict[converted_tensors[tensor_id]]
|
| 553 |
+
torch_state_dict[name] = shared_tensor
|
| 554 |
+
else:
|
| 555 |
+
converted_tensors[tensor_id] = name
|
| 556 |
+
if return_empty_tensor:
|
| 557 |
+
torch_state_dict[name] = torch.empty(tensor.shape, dtype=tensor.dtype)
|
| 558 |
+
else:
|
| 559 |
+
torch_state_dict[name] = tensor.contiguous()
|
| 560 |
+
return torch_state_dict
|
| 561 |
+
|
| 562 |
+
|
| 563 |
+
def get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
|
| 564 |
+
tag=None,
|
| 565 |
+
exclude_frozen_parameters=False,
|
| 566 |
+
lazy_mode=False):
|
| 567 |
+
"""
|
| 568 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated state_dict that can be loaded with
|
| 569 |
+
``load_state_dict()`` and used for training without DeepSpeed or shared with others, for example
|
| 570 |
+
via a model hub.
|
| 571 |
+
|
| 572 |
+
Args:
|
| 573 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder
|
| 574 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in 'latest' file. e.g., ``global_step14``
|
| 575 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
| 576 |
+
- ``lazy_mode``: get state_dict in lazy mode. It returns a dict of pesduo tensor instead of torch tensor, which is more memory efficient.
|
| 577 |
+
Convert the pesduo tensor to torch tensor by ``.contiguous()``
|
| 578 |
+
|
| 579 |
+
Returns:
|
| 580 |
+
- pytorch ``state_dict``
|
| 581 |
+
|
| 582 |
+
A typical usage might be ::
|
| 583 |
+
|
| 584 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
| 585 |
+
# do the training and checkpoint saving
|
| 586 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir) # already on cpu
|
| 587 |
+
model = model.cpu() # move to cpu
|
| 588 |
+
model.load_state_dict(state_dict)
|
| 589 |
+
# submit to model hub or save the model to share with others
|
| 590 |
+
|
| 591 |
+
In this example the ``model`` will no longer be usable in the deepspeed context of the same
|
| 592 |
+
application. i.e. you will need to re-initialize the deepspeed engine, since
|
| 593 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
| 594 |
+
|
| 595 |
+
If you want it all done for you, use ``load_state_dict_from_zero_checkpoint`` instead.
|
| 596 |
+
|
| 597 |
+
Note: the above usage may not work if your application doesn't have sufficient free CPU memory.
|
| 598 |
+
You may need to use the offline approach using the ``zero_to_fp32.py`` script that is saved with
|
| 599 |
+
the checkpoint. Or you can load state_dict in lazy mode ::
|
| 600 |
+
|
| 601 |
+
from deepspeed.utils.zero_to_fp32 import get_fp32_state_dict_from_zero_checkpoint
|
| 602 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, lazy_mode=True) # not on cpu
|
| 603 |
+
for name, lazy_tensor in state_dict.item():
|
| 604 |
+
tensor = lazy_tensor.contiguous() # to cpu
|
| 605 |
+
print(name, tensor)
|
| 606 |
+
# del tensor to release memory if it no longer in use
|
| 607 |
+
"""
|
| 608 |
+
if tag is None:
|
| 609 |
+
latest_path = os.path.join(checkpoint_dir, 'latest')
|
| 610 |
+
if os.path.isfile(latest_path):
|
| 611 |
+
with open(latest_path, 'r') as fd:
|
| 612 |
+
tag = fd.read().strip()
|
| 613 |
+
else:
|
| 614 |
+
raise ValueError(f"Unable to find 'latest' file at {latest_path}")
|
| 615 |
+
|
| 616 |
+
ds_checkpoint_dir = os.path.join(checkpoint_dir, tag)
|
| 617 |
+
|
| 618 |
+
if not os.path.isdir(ds_checkpoint_dir):
|
| 619 |
+
raise FileNotFoundError(f"Directory '{ds_checkpoint_dir}' doesn't exist")
|
| 620 |
+
|
| 621 |
+
state_dict = _get_fp32_state_dict_from_zero_checkpoint(ds_checkpoint_dir, exclude_frozen_parameters)
|
| 622 |
+
if lazy_mode:
|
| 623 |
+
return state_dict
|
| 624 |
+
else:
|
| 625 |
+
return to_torch_tensor(state_dict)
|
| 626 |
+
|
| 627 |
+
|
| 628 |
+
def convert_zero_checkpoint_to_fp32_state_dict(checkpoint_dir,
|
| 629 |
+
output_dir,
|
| 630 |
+
max_shard_size="5GB",
|
| 631 |
+
safe_serialization=False,
|
| 632 |
+
tag=None,
|
| 633 |
+
exclude_frozen_parameters=False):
|
| 634 |
+
"""
|
| 635 |
+
Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict`` file that can be
|
| 636 |
+
loaded with ``torch.load(file)`` + ``load_state_dict()`` and used for training without DeepSpeed.
|
| 637 |
+
|
| 638 |
+
Args:
|
| 639 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
| 640 |
+
- ``output_dir``: directory to the pytorch fp32 state_dict output files
|
| 641 |
+
- ``max_shard_size``: the maximum size for a checkpoint before being sharded, default value is 5GB
|
| 642 |
+
- ``safe_serialization``: whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).
|
| 643 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
| 644 |
+
- ``exclude_frozen_parameters``: exclude frozen parameters
|
| 645 |
+
"""
|
| 646 |
+
|
| 647 |
+
# Dependency pre-check
|
| 648 |
+
if safe_serialization:
|
| 649 |
+
try:
|
| 650 |
+
from safetensors.torch import save_file
|
| 651 |
+
except ImportError:
|
| 652 |
+
print('If you want to use `safe_serialization`, please `pip install safetensors`')
|
| 653 |
+
raise
|
| 654 |
+
if max_shard_size is not None:
|
| 655 |
+
try:
|
| 656 |
+
from huggingface_hub import split_torch_state_dict_into_shards
|
| 657 |
+
except ImportError:
|
| 658 |
+
print('If you want to use `max_shard_size`, please `pip install huggingface_hub`')
|
| 659 |
+
raise
|
| 660 |
+
|
| 661 |
+
# Convert zero checkpoint to state_dict
|
| 662 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir,
|
| 663 |
+
tag,
|
| 664 |
+
exclude_frozen_parameters,
|
| 665 |
+
lazy_mode=True)
|
| 666 |
+
|
| 667 |
+
# Shard the model if it is too big.
|
| 668 |
+
weights_name = "model.safetensors" if safe_serialization else "pytorch_model.bin"
|
| 669 |
+
if max_shard_size is not None:
|
| 670 |
+
filename_pattern = weights_name.replace(".bin", "{suffix}.bin").replace(".safetensors", "{suffix}.safetensors")
|
| 671 |
+
# an memory-efficient approach for sharding
|
| 672 |
+
empty_state_dict = to_torch_tensor(state_dict, return_empty_tensor=True)
|
| 673 |
+
state_dict_split = split_torch_state_dict_into_shards(empty_state_dict,
|
| 674 |
+
filename_pattern=filename_pattern,
|
| 675 |
+
max_shard_size=max_shard_size)
|
| 676 |
+
else:
|
| 677 |
+
from collections import namedtuple
|
| 678 |
+
StateDictSplit = namedtuple("StateDictSplit", ["is_sharded", "filename_to_tensors"])
|
| 679 |
+
state_dict_split = StateDictSplit(is_sharded=False,
|
| 680 |
+
filename_to_tensors={weights_name: list(state_dict.keys())})
|
| 681 |
+
|
| 682 |
+
# Save the model by shard
|
| 683 |
+
os.makedirs(output_dir, exist_ok=True)
|
| 684 |
+
filename_to_tensors = state_dict_split.filename_to_tensors.items()
|
| 685 |
+
for shard_file, tensors in tqdm(filename_to_tensors, desc="Saving checkpoint shards"):
|
| 686 |
+
shard_state_dict = {tensor_name: state_dict[tensor_name] for tensor_name in tensors}
|
| 687 |
+
shard_state_dict = to_torch_tensor(shard_state_dict)
|
| 688 |
+
output_path = os.path.join(output_dir, shard_file)
|
| 689 |
+
if safe_serialization:
|
| 690 |
+
save_file(shard_state_dict, output_path, metadata={"format": "pt"})
|
| 691 |
+
else:
|
| 692 |
+
torch.save(shard_state_dict, output_path)
|
| 693 |
+
# release the memory of current shard
|
| 694 |
+
for tensor_name in list(shard_state_dict.keys()):
|
| 695 |
+
del state_dict[tensor_name]
|
| 696 |
+
del shard_state_dict[tensor_name]
|
| 697 |
+
del shard_state_dict
|
| 698 |
+
gc.collect()
|
| 699 |
+
|
| 700 |
+
# Save index if sharded
|
| 701 |
+
if state_dict_split.is_sharded:
|
| 702 |
+
index = {
|
| 703 |
+
"metadata": state_dict_split.metadata,
|
| 704 |
+
"weight_map": state_dict_split.tensor_to_filename,
|
| 705 |
+
}
|
| 706 |
+
save_index_file = "model.safetensors.index.json" if safe_serialization else "pytorch_model.bin.index.json"
|
| 707 |
+
save_index_file = os.path.join(output_dir, save_index_file)
|
| 708 |
+
with open(save_index_file, "w", encoding="utf-8") as f:
|
| 709 |
+
content = json.dumps(index, indent=2, sort_keys=True) + "\n"
|
| 710 |
+
f.write(content)
|
| 711 |
+
|
| 712 |
+
|
| 713 |
+
def load_state_dict_from_zero_checkpoint(model, checkpoint_dir, tag=None):
|
| 714 |
+
"""
|
| 715 |
+
1. Put the provided model to cpu
|
| 716 |
+
2. Convert ZeRO 2 or 3 checkpoint into a single fp32 consolidated ``state_dict``
|
| 717 |
+
3. Load it into the provided model
|
| 718 |
+
|
| 719 |
+
Args:
|
| 720 |
+
- ``model``: the model object to update
|
| 721 |
+
- ``checkpoint_dir``: path to the desired checkpoint folder. (one that contains the tag-folder, like ``global_step14``)
|
| 722 |
+
- ``tag``: checkpoint tag used as a unique identifier for checkpoint. If not provided will attempt to load tag in the file named ``latest`` in the checkpoint folder, e.g., ``global_step14``
|
| 723 |
+
|
| 724 |
+
Returns:
|
| 725 |
+
- ``model`: modified model
|
| 726 |
+
|
| 727 |
+
Make sure you have plenty of CPU memory available before you call this function. If you don't
|
| 728 |
+
have enough use the ``zero_to_fp32.py`` utility to do the conversion. You will find it
|
| 729 |
+
conveniently placed for you in the checkpoint folder.
|
| 730 |
+
|
| 731 |
+
A typical usage might be ::
|
| 732 |
+
|
| 733 |
+
from deepspeed.utils.zero_to_fp32 import load_state_dict_from_zero_checkpoint
|
| 734 |
+
model = load_state_dict_from_zero_checkpoint(trainer.model, checkpoint_dir)
|
| 735 |
+
# submit to model hub or save the model to share with others
|
| 736 |
+
|
| 737 |
+
Note, that once this was run, the ``model`` will no longer be usable in the deepspeed context
|
| 738 |
+
of the same application. i.e. you will need to re-initialize the deepspeed engine, since
|
| 739 |
+
``model.load_state_dict(state_dict)`` will remove all the deepspeed magic from it.
|
| 740 |
+
|
| 741 |
+
"""
|
| 742 |
+
logger.info("Extracting fp32 weights")
|
| 743 |
+
state_dict = get_fp32_state_dict_from_zero_checkpoint(checkpoint_dir, tag)
|
| 744 |
+
|
| 745 |
+
logger.info("Overwriting model with fp32 weights")
|
| 746 |
+
model = model.cpu()
|
| 747 |
+
model.load_state_dict(state_dict, strict=False)
|
| 748 |
+
|
| 749 |
+
return model
|
| 750 |
+
|
| 751 |
+
|
| 752 |
+
if __name__ == "__main__":
|
| 753 |
+
parser = argparse.ArgumentParser()
|
| 754 |
+
parser.add_argument("checkpoint_dir",
|
| 755 |
+
type=str,
|
| 756 |
+
help="path to the desired checkpoint folder, e.g., path/checkpoint-12")
|
| 757 |
+
parser.add_argument("output_dir",
|
| 758 |
+
type=str,
|
| 759 |
+
help="directory to the pytorch fp32 state_dict output files"
|
| 760 |
+
"(e.g. path/checkpoint-12-output/)")
|
| 761 |
+
parser.add_argument(
|
| 762 |
+
"--max_shard_size",
|
| 763 |
+
type=str,
|
| 764 |
+
default="5GB",
|
| 765 |
+
help="The maximum size for a checkpoint before being sharded. Checkpoints shard will then be each of size"
|
| 766 |
+
"lower than this size. If expressed as a string, needs to be digits followed by a unit (like `5MB`"
|
| 767 |
+
"We default it to 5GB in order for models to be able to run easily on free-tier google colab instances"
|
| 768 |
+
"without CPU OOM issues.")
|
| 769 |
+
parser.add_argument(
|
| 770 |
+
"--safe_serialization",
|
| 771 |
+
default=False,
|
| 772 |
+
action='store_true',
|
| 773 |
+
help="Whether to save the model using `safetensors` or the traditional PyTorch way (that uses `pickle`).")
|
| 774 |
+
parser.add_argument("-t",
|
| 775 |
+
"--tag",
|
| 776 |
+
type=str,
|
| 777 |
+
default=None,
|
| 778 |
+
help="checkpoint tag used as a unique identifier for checkpoint. e.g., global_step1")
|
| 779 |
+
parser.add_argument("--exclude_frozen_parameters", action='store_true', help="exclude frozen parameters")
|
| 780 |
+
parser.add_argument("-d", "--debug", action='store_true', help="enable debug")
|
| 781 |
+
args = parser.parse_args()
|
| 782 |
+
|
| 783 |
+
debug = args.debug
|
| 784 |
+
|
| 785 |
+
convert_zero_checkpoint_to_fp32_state_dict(args.checkpoint_dir,
|
| 786 |
+
args.output_dir,
|
| 787 |
+
max_shard_size=args.max_shard_size,
|
| 788 |
+
safe_serialization=args.safe_serialization,
|
| 789 |
+
tag=args.tag,
|
| 790 |
+
exclude_frozen_parameters=args.exclude_frozen_parameters)
|
joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/train.log
CHANGED
|
@@ -4655,3 +4655,360 @@
|
|
| 4655 |
2026-09-25 16:42:41 | INFO | train rank=0 | step=46450/50000 progress=92.9% loss=0.077741 lr=1.371871e-06 lr_backbone=1.371871e-06 elapsed=47:29:25 avg_step=3.68s recent_step=4.48s eta=03:37:46
|
| 4656 |
2026-09-25 16:43:13 | INFO | train rank=0 | step=46460/50000 progress=92.9% loss=0.102335 lr=1.364188e-06 lr_backbone=1.364188e-06 elapsed=47:29:57 avg_step=3.68s recent_step=3.14s eta=03:37:09
|
| 4657 |
2026-09-25 16:43:44 | INFO | train rank=0 | step=46470/50000 progress=92.9% loss=0.082626 lr=1.356527e-06 lr_backbone=1.356527e-06 elapsed=47:30:28 avg_step=3.68s recent_step=3.09s eta=03:36:31
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4655 |
2026-09-25 16:42:41 | INFO | train rank=0 | step=46450/50000 progress=92.9% loss=0.077741 lr=1.371871e-06 lr_backbone=1.371871e-06 elapsed=47:29:25 avg_step=3.68s recent_step=4.48s eta=03:37:46
|
| 4656 |
2026-09-25 16:43:13 | INFO | train rank=0 | step=46460/50000 progress=92.9% loss=0.102335 lr=1.364188e-06 lr_backbone=1.364188e-06 elapsed=47:29:57 avg_step=3.68s recent_step=3.14s eta=03:37:09
|
| 4657 |
2026-09-25 16:43:44 | INFO | train rank=0 | step=46470/50000 progress=92.9% loss=0.082626 lr=1.356527e-06 lr_backbone=1.356527e-06 elapsed=47:30:28 avg_step=3.68s recent_step=3.09s eta=03:36:31
|
| 4658 |
+
2026-09-25 16:44:33 | INFO | train rank=0 | step=46480/50000 progress=93.0% loss=0.078817 lr=1.348887e-06 lr_backbone=1.348887e-06 elapsed=47:31:17 avg_step=3.68s recent_step=4.98s eta=03:35:55
|
| 4659 |
+
2026-09-25 16:45:13 | INFO | train rank=0 | step=46490/50000 progress=93.0% loss=0.087909 lr=1.341268e-06 lr_backbone=1.341268e-06 elapsed=47:31:57 avg_step=3.68s recent_step=3.91s eta=03:35:19
|
| 4660 |
+
2026-09-25 16:45:47 | INFO | train rank=0 | step=46500/50000 progress=93.0% loss=0.102826 lr=1.333670e-06 lr_backbone=1.333670e-06 elapsed=47:32:32 avg_step=3.68s recent_step=3.49s eta=03:34:42
|
| 4661 |
+
2026-09-25 16:46:23 | INFO | train rank=0 | step=46510/50000 progress=93.0% loss=0.064550 lr=1.326094e-06 lr_backbone=1.326094e-06 elapsed=47:33:08 avg_step=3.68s recent_step=3.60s eta=03:34:05
|
| 4662 |
+
2026-09-25 16:47:06 | INFO | train rank=0 | step=46520/50000 progress=93.0% loss=0.097337 lr=1.318539e-06 lr_backbone=1.318539e-06 elapsed=47:33:50 avg_step=3.68s recent_step=4.22s eta=03:33:29
|
| 4663 |
+
2026-09-25 16:47:31 | INFO | train rank=0 | step=46530/50000 progress=93.1% loss=0.100542 lr=1.311005e-06 lr_backbone=1.311005e-06 elapsed=47:34:15 avg_step=3.68s recent_step=2.56s eta=03:32:51
|
| 4664 |
+
2026-09-25 16:48:06 | INFO | train rank=0 | step=46540/50000 progress=93.1% loss=0.079036 lr=1.303493e-06 lr_backbone=1.303493e-06 elapsed=47:34:50 avg_step=3.68s recent_step=3.48s eta=03:32:14
|
| 4665 |
+
2026-09-25 16:48:41 | INFO | train rank=0 | step=46550/50000 progress=93.1% loss=0.087723 lr=1.296002e-06 lr_backbone=1.296002e-06 elapsed=47:35:25 avg_step=3.68s recent_step=3.50s eta=03:31:37
|
| 4666 |
+
2026-09-25 16:49:33 | INFO | train rank=0 | step=46560/50000 progress=93.1% loss=0.080156 lr=1.288532e-06 lr_backbone=1.288532e-06 elapsed=47:36:17 avg_step=3.68s recent_step=5.23s eta=03:31:01
|
| 4667 |
+
2026-09-25 16:50:05 | INFO | train rank=0 | step=46570/50000 progress=93.1% loss=0.066029 lr=1.281084e-06 lr_backbone=1.281084e-06 elapsed=47:36:49 avg_step=3.68s recent_step=3.12s eta=03:30:24
|
| 4668 |
+
2026-09-25 16:50:27 | INFO | train rank=0 | step=46580/50000 progress=93.2% loss=0.082353 lr=1.273656e-06 lr_backbone=1.273656e-06 elapsed=47:37:11 avg_step=3.68s recent_step=2.27s eta=03:29:46
|
| 4669 |
+
2026-09-25 16:51:12 | INFO | train rank=0 | step=46590/50000 progress=93.2% loss=0.074854 lr=1.266251e-06 lr_backbone=1.266251e-06 elapsed=47:37:56 avg_step=3.68s recent_step=4.51s eta=03:29:10
|
| 4670 |
+
2026-09-25 16:51:43 | INFO | train rank=0 | step=46600/50000 progress=93.2% loss=0.068043 lr=1.258866e-06 lr_backbone=1.258866e-06 elapsed=47:38:27 avg_step=3.68s recent_step=3.02s eta=03:28:33
|
| 4671 |
+
2026-09-25 16:52:16 | INFO | train rank=0 | step=46610/50000 progress=93.2% loss=0.072920 lr=1.251503e-06 lr_backbone=1.251503e-06 elapsed=47:39:00 avg_step=3.68s recent_step=3.31s eta=03:27:56
|
| 4672 |
+
2026-09-25 16:52:52 | INFO | train rank=0 | step=46620/50000 progress=93.2% loss=0.080099 lr=1.244161e-06 lr_backbone=1.244161e-06 elapsed=47:39:36 avg_step=3.68s recent_step=3.64s eta=03:27:19
|
| 4673 |
+
2026-09-25 16:53:25 | INFO | train rank=0 | step=46630/50000 progress=93.3% loss=0.071217 lr=1.236840e-06 lr_backbone=1.236840e-06 elapsed=47:40:09 avg_step=3.68s recent_step=3.26s eta=03:26:42
|
| 4674 |
+
2026-09-25 16:54:18 | INFO | train rank=0 | step=46640/50000 progress=93.3% loss=0.078682 lr=1.229541e-06 lr_backbone=1.229541e-06 elapsed=47:41:02 avg_step=3.68s recent_step=5.35s eta=03:26:06
|
| 4675 |
+
2026-09-25 16:54:51 | INFO | train rank=0 | step=46650/50000 progress=93.3% loss=0.091841 lr=1.222263e-06 lr_backbone=1.222263e-06 elapsed=47:41:35 avg_step=3.68s recent_step=3.26s eta=03:25:29
|
| 4676 |
+
2026-09-25 16:55:26 | INFO | train rank=0 | step=46660/50000 progress=93.3% loss=0.072141 lr=1.215007e-06 lr_backbone=1.215007e-06 elapsed=47:42:10 avg_step=3.68s recent_step=3.53s eta=03:24:52
|
| 4677 |
+
2026-09-25 16:55:58 | INFO | train rank=0 | step=46670/50000 progress=93.3% loss=0.102800 lr=1.207772e-06 lr_backbone=1.207772e-06 elapsed=47:42:42 avg_step=3.68s recent_step=3.15s eta=03:24:15
|
| 4678 |
+
2026-09-25 16:56:45 | INFO | train rank=0 | step=46680/50000 progress=93.4% loss=0.090416 lr=1.200558e-06 lr_backbone=1.200558e-06 elapsed=47:43:29 avg_step=3.68s recent_step=4.75s eta=03:23:39
|
| 4679 |
+
2026-09-25 16:57:11 | INFO | train rank=0 | step=46690/50000 progress=93.4% loss=0.080108 lr=1.193365e-06 lr_backbone=1.193365e-06 elapsed=47:43:55 avg_step=3.68s recent_step=2.59s eta=03:23:01
|
| 4680 |
+
2026-09-25 16:57:44 | INFO | train rank=0 | step=46700/50000 progress=93.4% loss=0.084144 lr=1.186194e-06 lr_backbone=1.186194e-06 elapsed=47:44:28 avg_step=3.68s recent_step=3.29s eta=03:22:24
|
| 4681 |
+
2026-09-25 16:58:27 | INFO | train rank=0 | step=46710/50000 progress=93.4% loss=0.072939 lr=1.179044e-06 lr_backbone=1.179044e-06 elapsed=47:45:11 avg_step=3.68s recent_step=4.37s eta=03:21:48
|
| 4682 |
+
2026-09-25 16:59:01 | INFO | train rank=0 | step=46720/50000 progress=93.4% loss=0.082136 lr=1.171916e-06 lr_backbone=1.171916e-06 elapsed=47:45:45 avg_step=3.68s recent_step=3.37s eta=03:21:11
|
| 4683 |
+
2026-09-25 16:59:34 | INFO | train rank=0 | step=46730/50000 progress=93.5% loss=0.084341 lr=1.164809e-06 lr_backbone=1.164809e-06 elapsed=47:46:18 avg_step=3.68s recent_step=3.25s eta=03:20:34
|
| 4684 |
+
2026-09-25 17:00:04 | INFO | train rank=0 | step=46740/50000 progress=93.5% loss=0.115696 lr=1.157723e-06 lr_backbone=1.157723e-06 elapsed=47:46:48 avg_step=3.68s recent_step=3.00s eta=03:19:57
|
| 4685 |
+
2026-09-25 17:00:53 | INFO | train rank=0 | step=46750/50000 progress=93.5% loss=0.079681 lr=1.150658e-06 lr_backbone=1.150658e-06 elapsed=47:47:37 avg_step=3.68s recent_step=4.88s eta=03:19:21
|
| 4686 |
+
2026-09-25 17:01:30 | INFO | train rank=0 | step=46760/50000 progress=93.5% loss=0.071644 lr=1.143615e-06 lr_backbone=1.143615e-06 elapsed=47:48:14 avg_step=3.68s recent_step=3.70s eta=03:18:44
|
| 4687 |
+
2026-09-25 17:02:02 | INFO | train rank=0 | step=46770/50000 progress=93.5% loss=0.088397 lr=1.136594e-06 lr_backbone=1.136594e-06 elapsed=47:48:46 avg_step=3.68s recent_step=3.28s eta=03:18:07
|
| 4688 |
+
2026-09-25 17:02:40 | INFO | train rank=0 | step=46780/50000 progress=93.6% loss=0.088570 lr=1.129594e-06 lr_backbone=1.129594e-06 elapsed=47:49:24 avg_step=3.68s recent_step=3.74s eta=03:17:30
|
| 4689 |
+
2026-09-25 17:03:25 | INFO | train rank=0 | step=46790/50000 progress=93.6% loss=0.111720 lr=1.122615e-06 lr_backbone=1.122615e-06 elapsed=47:50:09 avg_step=3.68s recent_step=4.48s eta=03:16:54
|
| 4690 |
+
2026-09-25 17:03:55 | INFO | train rank=0 | step=46800/50000 progress=93.6% loss=0.078504 lr=1.115657e-06 lr_backbone=1.115657e-06 elapsed=47:50:39 avg_step=3.68s recent_step=2.99s eta=03:16:17
|
| 4691 |
+
2026-09-25 17:04:33 | INFO | train rank=0 | step=46810/50000 progress=93.6% loss=0.091841 lr=1.108721e-06 lr_backbone=1.108721e-06 elapsed=47:51:17 avg_step=3.68s recent_step=3.83s eta=03:15:40
|
| 4692 |
+
2026-09-25 17:05:07 | INFO | train rank=0 | step=46820/50000 progress=93.6% loss=0.086398 lr=1.101806e-06 lr_backbone=1.101806e-06 elapsed=47:51:51 avg_step=3.68s recent_step=3.42s eta=03:15:03
|
| 4693 |
+
2026-09-25 17:05:52 | INFO | train rank=0 | step=46830/50000 progress=93.7% loss=0.061117 lr=1.094913e-06 lr_backbone=1.094913e-06 elapsed=47:52:36 avg_step=3.68s recent_step=4.49s eta=03:14:27
|
| 4694 |
+
2026-09-25 17:06:24 | INFO | train rank=0 | step=46840/50000 progress=93.7% loss=0.079132 lr=1.088041e-06 lr_backbone=1.088041e-06 elapsed=47:53:08 avg_step=3.68s recent_step=3.23s eta=03:13:49
|
| 4695 |
+
2026-09-25 17:06:57 | INFO | train rank=0 | step=46850/50000 progress=93.7% loss=0.089981 lr=1.081190e-06 lr_backbone=1.081190e-06 elapsed=47:53:41 avg_step=3.68s recent_step=3.28s eta=03:13:12
|
| 4696 |
+
2026-09-25 17:07:32 | INFO | train rank=0 | step=46860/50000 progress=93.7% loss=0.104372 lr=1.074361e-06 lr_backbone=1.074361e-06 elapsed=47:54:16 avg_step=3.68s recent_step=3.47s eta=03:12:35
|
| 4697 |
+
2026-09-25 17:08:22 | INFO | train rank=0 | step=46870/50000 progress=93.7% loss=0.099102 lr=1.067554e-06 lr_backbone=1.067554e-06 elapsed=47:55:06 avg_step=3.68s recent_step=5.07s eta=03:12:00
|
| 4698 |
+
2026-09-25 17:08:46 | INFO | train rank=0 | step=46880/50000 progress=93.8% loss=0.070379 lr=1.060767e-06 lr_backbone=1.060767e-06 elapsed=47:55:30 avg_step=3.68s recent_step=2.37s eta=03:11:22
|
| 4699 |
+
2026-09-25 17:09:21 | INFO | train rank=0 | step=46890/50000 progress=93.8% loss=0.094951 lr=1.054002e-06 lr_backbone=1.054002e-06 elapsed=47:56:05 avg_step=3.68s recent_step=3.45s eta=03:10:45
|
| 4700 |
+
2026-09-25 17:09:52 | INFO | train rank=0 | step=46900/50000 progress=93.8% loss=0.090329 lr=1.047259e-06 lr_backbone=1.047259e-06 elapsed=47:56:36 avg_step=3.68s recent_step=3.17s eta=03:10:08
|
| 4701 |
+
2026-09-25 17:10:39 | INFO | train rank=0 | step=46910/50000 progress=93.8% loss=0.088100 lr=1.040537e-06 lr_backbone=1.040537e-06 elapsed=47:57:23 avg_step=3.68s recent_step=4.67s eta=03:09:32
|
| 4702 |
+
2026-09-25 17:11:06 | INFO | train rank=0 | step=46920/50000 progress=93.8% loss=0.092884 lr=1.033836e-06 lr_backbone=1.033836e-06 elapsed=47:57:50 avg_step=3.68s recent_step=2.67s eta=03:08:54
|
| 4703 |
+
2026-09-25 17:11:39 | INFO | train rank=0 | step=46930/50000 progress=93.9% loss=0.073812 lr=1.027157e-06 lr_backbone=1.027157e-06 elapsed=47:58:23 avg_step=3.68s recent_step=3.33s eta=03:08:17
|
| 4704 |
+
2026-09-25 17:12:18 | INFO | train rank=0 | step=46940/50000 progress=93.9% loss=0.093391 lr=1.020499e-06 lr_backbone=1.020499e-06 elapsed=47:59:02 avg_step=3.68s recent_step=3.84s eta=03:07:40
|
| 4705 |
+
2026-09-25 17:13:09 | INFO | train rank=0 | step=46950/50000 progress=93.9% loss=0.069048 lr=1.013862e-06 lr_backbone=1.013862e-06 elapsed=47:59:53 avg_step=3.68s recent_step=5.12s eta=03:07:05
|
| 4706 |
+
2026-09-25 17:13:36 | INFO | train rank=0 | step=46960/50000 progress=93.9% loss=0.088478 lr=1.007247e-06 lr_backbone=1.007247e-06 elapsed=48:00:20 avg_step=3.68s recent_step=2.77s eta=03:06:27
|
| 4707 |
+
2026-09-25 17:14:14 | INFO | train rank=0 | step=46970/50000 progress=93.9% loss=0.083153 lr=1.000654e-06 lr_backbone=1.000654e-06 elapsed=48:00:58 avg_step=3.68s recent_step=3.75s eta=03:05:50
|
| 4708 |
+
2026-09-25 17:14:49 | INFO | train rank=0 | step=46980/50000 progress=94.0% loss=0.081958 lr=9.940817e-07 lr_backbone=9.940817e-07 elapsed=48:01:33 avg_step=3.68s recent_step=3.48s eta=03:05:14
|
| 4709 |
+
2026-09-25 17:15:38 | INFO | train rank=0 | step=46990/50000 progress=94.0% loss=0.078827 lr=9.875310e-07 lr_backbone=9.875310e-07 elapsed=48:02:22 avg_step=3.68s recent_step=4.94s eta=03:04:38
|
| 4710 |
+
2026-09-25 17:16:07 | INFO | train rank=0 | step=47000/50000 progress=94.0% loss=0.078086 lr=9.810017e-07 lr_backbone=9.810017e-07 elapsed=48:02:51 avg_step=3.68s recent_step=2.86s eta=03:04:00
|
| 4711 |
+
2026-09-25 17:16:33 | INFO | train rank=0 | step=47010/50000 progress=94.0% loss=0.075516 lr=9.744939e-07 lr_backbone=9.744939e-07 elapsed=48:03:17 avg_step=3.68s recent_step=2.63s eta=03:03:23
|
| 4712 |
+
2026-09-25 17:17:07 | INFO | train rank=0 | step=47020/50000 progress=94.0% loss=0.097246 lr=9.680075e-07 lr_backbone=9.680075e-07 elapsed=48:03:51 avg_step=3.68s recent_step=3.43s eta=03:02:46
|
| 4713 |
+
2026-09-25 17:17:50 | INFO | train rank=0 | step=47030/50000 progress=94.1% loss=0.100854 lr=9.615426e-07 lr_backbone=9.615426e-07 elapsed=48:04:34 avg_step=3.68s recent_step=4.24s eta=03:02:09
|
| 4714 |
+
2026-09-25 17:18:20 | INFO | train rank=0 | step=47040/50000 progress=94.1% loss=0.107054 lr=9.550991e-07 lr_backbone=9.550991e-07 elapsed=48:05:04 avg_step=3.68s recent_step=3.04s eta=03:01:32
|
| 4715 |
+
2026-09-25 17:18:48 | INFO | train rank=0 | step=47050/50000 progress=94.1% loss=0.082090 lr=9.486771e-07 lr_backbone=9.486771e-07 elapsed=48:05:32 avg_step=3.68s recent_step=2.79s eta=03:00:55
|
| 4716 |
+
2026-09-25 17:19:12 | INFO | train rank=0 | step=47060/50000 progress=94.1% loss=0.108133 lr=9.422765e-07 lr_backbone=9.422765e-07 elapsed=48:05:56 avg_step=3.68s recent_step=2.43s eta=03:00:17
|
| 4717 |
+
2026-09-25 17:20:03 | INFO | train rank=0 | step=47070/50000 progress=94.1% loss=0.081969 lr=9.358974e-07 lr_backbone=9.358974e-07 elapsed=48:06:47 avg_step=3.68s recent_step=5.11s eta=02:59:41
|
| 4718 |
+
2026-09-25 17:20:37 | INFO | train rank=0 | step=47080/50000 progress=94.2% loss=0.123051 lr=9.295398e-07 lr_backbone=9.295398e-07 elapsed=48:07:21 avg_step=3.68s recent_step=3.38s eta=02:59:04
|
| 4719 |
+
2026-09-25 17:21:19 | INFO | train rank=0 | step=47090/50000 progress=94.2% loss=0.092691 lr=9.232036e-07 lr_backbone=9.232036e-07 elapsed=48:08:03 avg_step=3.68s recent_step=4.19s eta=02:58:28
|
| 4720 |
+
2026-09-25 17:21:49 | INFO | train rank=0 | step=47100/50000 progress=94.2% loss=0.089602 lr=9.168889e-07 lr_backbone=9.168889e-07 elapsed=48:08:33 avg_step=3.68s recent_step=3.01s eta=02:57:51
|
| 4721 |
+
2026-09-25 17:22:37 | INFO | train rank=0 | step=47110/50000 progress=94.2% loss=0.086857 lr=9.105957e-07 lr_backbone=9.105957e-07 elapsed=48:09:21 avg_step=3.68s recent_step=4.73s eta=02:57:14
|
| 4722 |
+
2026-09-25 17:23:04 | INFO | train rank=0 | step=47120/50000 progress=94.2% loss=0.083515 lr=9.043239e-07 lr_backbone=9.043239e-07 elapsed=48:09:48 avg_step=3.68s recent_step=2.70s eta=02:56:37
|
| 4723 |
+
2026-09-25 17:23:35 | INFO | train rank=0 | step=47130/50000 progress=94.3% loss=0.138468 lr=8.980736e-07 lr_backbone=8.980736e-07 elapsed=48:10:19 avg_step=3.68s recent_step=3.11s eta=02:56:00
|
| 4724 |
+
2026-09-25 17:24:20 | INFO | train rank=0 | step=47140/50000 progress=94.3% loss=0.073730 lr=8.918448e-07 lr_backbone=8.918448e-07 elapsed=48:11:04 avg_step=3.68s recent_step=4.54s eta=02:55:24
|
| 4725 |
+
2026-09-25 17:25:02 | INFO | train rank=0 | step=47150/50000 progress=94.3% loss=0.078423 lr=8.856375e-07 lr_backbone=8.856375e-07 elapsed=48:11:46 avg_step=3.68s recent_step=4.16s eta=02:54:47
|
| 4726 |
+
2026-09-25 17:25:38 | INFO | train rank=0 | step=47160/50000 progress=94.3% loss=0.077316 lr=8.794516e-07 lr_backbone=8.794516e-07 elapsed=48:12:22 avg_step=3.68s recent_step=3.65s eta=02:54:10
|
| 4727 |
+
2026-09-25 17:26:11 | INFO | train rank=0 | step=47170/50000 progress=94.3% loss=0.063288 lr=8.732873e-07 lr_backbone=8.732873e-07 elapsed=48:12:55 avg_step=3.68s recent_step=3.27s eta=02:53:33
|
| 4728 |
+
2026-09-25 17:26:46 | INFO | train rank=0 | step=47180/50000 progress=94.4% loss=0.093049 lr=8.671444e-07 lr_backbone=8.671444e-07 elapsed=48:13:30 avg_step=3.68s recent_step=3.54s eta=02:52:56
|
| 4729 |
+
2026-09-25 17:27:27 | INFO | train rank=0 | step=47190/50000 progress=94.4% loss=0.081394 lr=8.610230e-07 lr_backbone=8.610230e-07 elapsed=48:14:11 avg_step=3.68s recent_step=4.11s eta=02:52:20
|
| 4730 |
+
2026-09-25 17:28:04 | INFO | train rank=0 | step=47200/50000 progress=94.4% loss=0.098667 lr=8.549231e-07 lr_backbone=8.549231e-07 elapsed=48:14:48 avg_step=3.68s recent_step=3.62s eta=02:51:43
|
| 4731 |
+
2026-09-25 17:28:34 | INFO | train rank=0 | step=47210/50000 progress=94.4% loss=0.090439 lr=8.488448e-07 lr_backbone=8.488448e-07 elapsed=48:15:18 avg_step=3.68s recent_step=3.08s eta=02:51:06
|
| 4732 |
+
2026-09-25 17:29:10 | INFO | train rank=0 | step=47220/50000 progress=94.4% loss=0.093704 lr=8.427879e-07 lr_backbone=8.427879e-07 elapsed=48:15:54 avg_step=3.68s recent_step=3.55s eta=02:50:29
|
| 4733 |
+
2026-09-25 17:30:02 | INFO | train rank=0 | step=47230/50000 progress=94.5% loss=0.104823 lr=8.367525e-07 lr_backbone=8.367525e-07 elapsed=48:16:46 avg_step=3.68s recent_step=5.23s eta=02:49:53
|
| 4734 |
+
2026-09-25 17:30:40 | INFO | train rank=0 | step=47240/50000 progress=94.5% loss=0.083406 lr=8.307386e-07 lr_backbone=8.307386e-07 elapsed=48:17:24 avg_step=3.68s recent_step=3.74s eta=02:49:16
|
| 4735 |
+
2026-09-25 17:31:11 | INFO | train rank=0 | step=47250/50000 progress=94.5% loss=0.075101 lr=8.247463e-07 lr_backbone=8.247463e-07 elapsed=48:17:55 avg_step=3.68s recent_step=3.14s eta=02:48:39
|
| 4736 |
+
2026-09-25 17:31:35 | INFO | train rank=0 | step=47260/50000 progress=94.5% loss=0.078738 lr=8.187754e-07 lr_backbone=8.187754e-07 elapsed=48:18:19 avg_step=3.68s recent_step=2.38s eta=02:48:02
|
| 4737 |
+
2026-09-25 17:32:28 | INFO | train rank=0 | step=47270/50000 progress=94.5% loss=0.077679 lr=8.128261e-07 lr_backbone=8.128261e-07 elapsed=48:19:12 avg_step=3.68s recent_step=5.31s eta=02:47:26
|
| 4738 |
+
2026-09-25 17:33:05 | INFO | train rank=0 | step=47280/50000 progress=94.6% loss=0.114031 lr=8.068982e-07 lr_backbone=8.068982e-07 elapsed=48:19:49 avg_step=3.68s recent_step=3.71s eta=02:46:49
|
| 4739 |
+
2026-09-25 17:33:44 | INFO | train rank=0 | step=47290/50000 progress=94.6% loss=0.092999 lr=8.009919e-07 lr_backbone=8.009919e-07 elapsed=48:20:29 avg_step=3.68s recent_step=3.95s eta=02:46:12
|
| 4740 |
+
2026-09-25 17:34:17 | INFO | train rank=0 | step=47300/50000 progress=94.6% loss=0.076217 lr=7.951071e-07 lr_backbone=7.951071e-07 elapsed=48:21:01 avg_step=3.68s recent_step=3.25s eta=02:45:35
|
| 4741 |
+
2026-09-25 17:34:54 | INFO | train rank=0 | step=47310/50000 progress=94.6% loss=0.083310 lr=7.892439e-07 lr_backbone=7.892439e-07 elapsed=48:21:38 avg_step=3.68s recent_step=3.68s eta=02:44:59
|
| 4742 |
+
2026-09-25 17:35:26 | INFO | train rank=0 | step=47320/50000 progress=94.6% loss=0.094301 lr=7.834022e-07 lr_backbone=7.834022e-07 elapsed=48:22:10 avg_step=3.68s recent_step=3.20s eta=02:44:21
|
| 4743 |
+
2026-09-25 17:36:01 | INFO | train rank=0 | step=47330/50000 progress=94.7% loss=0.079105 lr=7.775819e-07 lr_backbone=7.775819e-07 elapsed=48:22:45 avg_step=3.68s recent_step=3.49s eta=02:43:45
|
| 4744 |
+
2026-09-25 17:36:41 | INFO | train rank=0 | step=47340/50000 progress=94.7% loss=0.086085 lr=7.717833e-07 lr_backbone=7.717833e-07 elapsed=48:23:25 avg_step=3.68s recent_step=4.01s eta=02:43:08
|
| 4745 |
+
2026-09-25 17:37:25 | INFO | train rank=0 | step=47350/50000 progress=94.7% loss=0.086726 lr=7.660061e-07 lr_backbone=7.660061e-07 elapsed=48:24:09 avg_step=3.68s recent_step=4.38s eta=02:42:32
|
| 4746 |
+
2026-09-25 17:37:54 | INFO | train rank=0 | step=47360/50000 progress=94.7% loss=0.113020 lr=7.602505e-07 lr_backbone=7.602505e-07 elapsed=48:24:38 avg_step=3.68s recent_step=2.94s eta=02:41:54
|
| 4747 |
+
2026-09-25 17:38:29 | INFO | train rank=0 | step=47370/50000 progress=94.7% loss=0.076510 lr=7.545165e-07 lr_backbone=7.545165e-07 elapsed=48:25:13 avg_step=3.68s recent_step=3.52s eta=02:41:17
|
| 4748 |
+
2026-09-25 17:39:02 | INFO | train rank=0 | step=47380/50000 progress=94.8% loss=0.099281 lr=7.488039e-07 lr_backbone=7.488039e-07 elapsed=48:25:46 avg_step=3.68s recent_step=3.25s eta=02:40:40
|
| 4749 |
+
2026-09-25 17:39:50 | INFO | train rank=0 | step=47390/50000 progress=94.8% loss=0.060525 lr=7.431130e-07 lr_backbone=7.431130e-07 elapsed=48:26:34 avg_step=3.68s recent_step=4.87s eta=02:40:04
|
| 4750 |
+
2026-09-25 17:40:29 | INFO | train rank=0 | step=47400/50000 progress=94.8% loss=0.095351 lr=7.374435e-07 lr_backbone=7.374435e-07 elapsed=48:27:13 avg_step=3.68s recent_step=3.89s eta=02:39:28
|
| 4751 |
+
2026-09-25 17:40:58 | INFO | train rank=0 | step=47410/50000 progress=94.8% loss=0.089212 lr=7.317957e-07 lr_backbone=7.317957e-07 elapsed=48:27:42 avg_step=3.68s recent_step=2.88s eta=02:38:50
|
| 4752 |
+
2026-09-25 17:41:30 | INFO | train rank=0 | step=47420/50000 progress=94.8% loss=0.076499 lr=7.261693e-07 lr_backbone=7.261693e-07 elapsed=48:28:14 avg_step=3.68s recent_step=3.19s eta=02:38:13
|
| 4753 |
+
2026-09-25 17:42:23 | INFO | train rank=0 | step=47430/50000 progress=94.9% loss=0.087581 lr=7.205645e-07 lr_backbone=7.205645e-07 elapsed=48:29:07 avg_step=3.68s recent_step=5.33s eta=02:37:37
|
| 4754 |
+
2026-09-25 17:42:59 | INFO | train rank=0 | step=47440/50000 progress=94.9% loss=0.084557 lr=7.149813e-07 lr_backbone=7.149813e-07 elapsed=48:29:43 avg_step=3.68s recent_step=3.58s eta=02:37:01
|
| 4755 |
+
2026-09-25 17:43:34 | INFO | train rank=0 | step=47450/50000 progress=94.9% loss=0.095452 lr=7.094197e-07 lr_backbone=7.094197e-07 elapsed=48:30:18 avg_step=3.68s recent_step=3.49s eta=02:36:24
|
| 4756 |
+
2026-09-25 17:43:59 | INFO | train rank=0 | step=47460/50000 progress=94.9% loss=0.078681 lr=7.038796e-07 lr_backbone=7.038796e-07 elapsed=48:30:43 avg_step=3.68s recent_step=2.49s eta=02:35:46
|
| 4757 |
+
2026-09-25 17:44:47 | INFO | train rank=0 | step=47470/50000 progress=94.9% loss=0.103906 lr=6.983610e-07 lr_backbone=6.983610e-07 elapsed=48:31:31 avg_step=3.68s recent_step=4.86s eta=02:35:10
|
| 4758 |
+
2026-09-25 17:45:20 | INFO | train rank=0 | step=47480/50000 progress=95.0% loss=0.081211 lr=6.928641e-07 lr_backbone=6.928641e-07 elapsed=48:32:04 avg_step=3.68s recent_step=3.25s eta=02:34:33
|
| 4759 |
+
2026-09-25 17:45:51 | INFO | train rank=0 | step=47490/50000 progress=95.0% loss=0.087490 lr=6.873887e-07 lr_backbone=6.873887e-07 elapsed=48:32:35 avg_step=3.68s recent_step=3.08s eta=02:33:56
|
| 4760 |
+
2026-09-25 17:46:21 | INFO | train rank=0 | step=47500/50000 progress=95.0% loss=0.089638 lr=6.819348e-07 lr_backbone=6.819348e-07 elapsed=48:33:05 avg_step=3.68s recent_step=3.07s eta=02:33:19
|
| 4761 |
+
2026-09-25 17:47:08 | INFO | train rank=0 | step=47510/50000 progress=95.0% loss=0.082808 lr=6.765026e-07 lr_backbone=6.765026e-07 elapsed=48:33:52 avg_step=3.68s recent_step=4.70s eta=02:32:42
|
| 4762 |
+
2026-09-25 17:47:36 | INFO | train rank=0 | step=47520/50000 progress=95.0% loss=0.076558 lr=6.710919e-07 lr_backbone=6.710919e-07 elapsed=48:34:20 avg_step=3.68s recent_step=2.80s eta=02:32:05
|
| 4763 |
+
2026-09-25 17:48:14 | INFO | train rank=0 | step=47530/50000 progress=95.1% loss=0.077582 lr=6.657028e-07 lr_backbone=6.657028e-07 elapsed=48:34:58 avg_step=3.68s recent_step=3.74s eta=02:31:28
|
| 4764 |
+
2026-09-25 17:48:55 | INFO | train rank=0 | step=47540/50000 progress=95.1% loss=0.083473 lr=6.603353e-07 lr_backbone=6.603353e-07 elapsed=48:35:39 avg_step=3.68s recent_step=4.10s eta=02:30:52
|
| 4765 |
+
2026-09-25 17:49:36 | INFO | train rank=0 | step=47550/50000 progress=95.1% loss=0.062161 lr=6.549893e-07 lr_backbone=6.549893e-07 elapsed=48:36:20 avg_step=3.68s recent_step=4.11s eta=02:30:15
|
| 4766 |
+
2026-09-25 17:50:08 | INFO | train rank=0 | step=47560/50000 progress=95.1% loss=0.084542 lr=6.496650e-07 lr_backbone=6.496650e-07 elapsed=48:36:52 avg_step=3.68s recent_step=3.18s eta=02:29:38
|
| 4767 |
+
2026-09-25 17:50:39 | INFO | train rank=0 | step=47570/50000 progress=95.1% loss=0.084750 lr=6.443622e-07 lr_backbone=6.443622e-07 elapsed=48:37:23 avg_step=3.68s recent_step=3.14s eta=02:29:01
|
| 4768 |
+
2026-09-25 17:51:05 | INFO | train rank=0 | step=47580/50000 progress=95.2% loss=0.077831 lr=6.390810e-07 lr_backbone=6.390810e-07 elapsed=48:37:49 avg_step=3.68s recent_step=2.60s eta=02:28:24
|
| 4769 |
+
2026-09-25 17:51:52 | INFO | train rank=0 | step=47590/50000 progress=95.2% loss=0.081995 lr=6.338214e-07 lr_backbone=6.338214e-07 elapsed=48:38:36 avg_step=3.68s recent_step=4.69s eta=02:27:48
|
| 4770 |
+
2026-09-25 17:52:15 | INFO | train rank=0 | step=47600/50000 progress=95.2% loss=0.093708 lr=6.285835e-07 lr_backbone=6.285835e-07 elapsed=48:38:59 avg_step=3.68s recent_step=2.32s eta=02:27:10
|
| 4771 |
+
2026-09-25 17:52:53 | INFO | train rank=0 | step=47610/50000 progress=95.2% loss=0.087961 lr=6.233671e-07 lr_backbone=6.233671e-07 elapsed=48:39:37 avg_step=3.68s recent_step=3.77s eta=02:26:33
|
| 4772 |
+
2026-09-25 17:53:30 | INFO | train rank=0 | step=47620/50000 progress=95.2% loss=0.098777 lr=6.181723e-07 lr_backbone=6.181723e-07 elapsed=48:40:14 avg_step=3.68s recent_step=3.76s eta=02:25:57
|
| 4773 |
+
2026-09-25 17:54:29 | INFO | train rank=0 | step=47630/50000 progress=95.3% loss=0.070187 lr=6.129991e-07 lr_backbone=6.129991e-07 elapsed=48:41:13 avg_step=3.68s recent_step=5.85s eta=02:25:21
|
| 4774 |
+
2026-09-25 17:54:56 | INFO | train rank=0 | step=47640/50000 progress=95.3% loss=0.077023 lr=6.078475e-07 lr_backbone=6.078475e-07 elapsed=48:41:40 avg_step=3.68s recent_step=2.67s eta=02:24:44
|
| 4775 |
+
2026-09-25 17:55:29 | INFO | train rank=0 | step=47650/50000 progress=95.3% loss=0.083618 lr=6.027175e-07 lr_backbone=6.027175e-07 elapsed=48:42:13 avg_step=3.68s recent_step=3.30s eta=02:24:07
|
| 4776 |
+
2026-09-25 17:55:54 | INFO | train rank=0 | step=47660/50000 progress=95.3% loss=0.075605 lr=5.976091e-07 lr_backbone=5.976091e-07 elapsed=48:42:38 avg_step=3.68s recent_step=2.54s eta=02:23:29
|
| 4777 |
+
2026-09-25 17:56:36 | INFO | train rank=0 | step=47670/50000 progress=95.3% loss=0.093266 lr=5.925224e-07 lr_backbone=5.925224e-07 elapsed=48:43:20 avg_step=3.68s recent_step=4.25s eta=02:22:53
|
| 4778 |
+
2026-09-25 17:57:21 | INFO | train rank=0 | step=47680/50000 progress=95.4% loss=0.072892 lr=5.874572e-07 lr_backbone=5.874572e-07 elapsed=48:44:05 avg_step=3.68s recent_step=4.47s eta=02:22:16
|
| 4779 |
+
2026-09-25 17:57:51 | INFO | train rank=0 | step=47690/50000 progress=95.4% loss=0.083661 lr=5.824137e-07 lr_backbone=5.824137e-07 elapsed=48:44:35 avg_step=3.68s recent_step=3.00s eta=02:21:39
|
| 4780 |
+
2026-09-25 17:58:19 | INFO | train rank=0 | step=47700/50000 progress=95.4% loss=0.069385 lr=5.773917e-07 lr_backbone=5.773917e-07 elapsed=48:45:03 avg_step=3.68s recent_step=2.76s eta=02:21:02
|
| 4781 |
+
2026-09-25 17:59:08 | INFO | train rank=0 | step=47710/50000 progress=95.4% loss=0.070484 lr=5.723914e-07 lr_backbone=5.723914e-07 elapsed=48:45:52 avg_step=3.68s recent_step=4.89s eta=02:20:26
|
| 4782 |
+
2026-09-25 17:59:43 | INFO | train rank=0 | step=47720/50000 progress=95.4% loss=0.083442 lr=5.674128e-07 lr_backbone=5.674128e-07 elapsed=48:46:27 avg_step=3.68s recent_step=3.52s eta=02:19:49
|
| 4783 |
+
2026-09-25 18:00:20 | INFO | train rank=0 | step=47730/50000 progress=95.5% loss=0.092166 lr=5.624557e-07 lr_backbone=5.624557e-07 elapsed=48:47:04 avg_step=3.68s recent_step=3.70s eta=02:19:12
|
| 4784 |
+
2026-09-25 18:00:51 | INFO | train rank=0 | step=47740/50000 progress=95.5% loss=0.102667 lr=5.575203e-07 lr_backbone=5.575203e-07 elapsed=48:47:35 avg_step=3.68s recent_step=3.09s eta=02:18:35
|
| 4785 |
+
2026-09-25 18:01:31 | INFO | train rank=0 | step=47750/50000 progress=95.5% loss=0.077426 lr=5.526065e-07 lr_backbone=5.526065e-07 elapsed=48:48:16 avg_step=3.68s recent_step=4.07s eta=02:17:58
|
| 4786 |
+
2026-09-25 18:02:17 | INFO | train rank=0 | step=47760/50000 progress=95.5% loss=0.091915 lr=5.477143e-07 lr_backbone=5.477143e-07 elapsed=48:49:01 avg_step=3.68s recent_step=4.54s eta=02:17:22
|
| 4787 |
+
2026-09-25 18:02:48 | INFO | train rank=0 | step=47770/50000 progress=95.5% loss=0.092891 lr=5.428438e-07 lr_backbone=5.428438e-07 elapsed=48:49:32 avg_step=3.68s recent_step=3.07s eta=02:16:45
|
| 4788 |
+
2026-09-25 18:03:19 | INFO | train rank=0 | step=47780/50000 progress=95.6% loss=0.081041 lr=5.379948e-07 lr_backbone=5.379948e-07 elapsed=48:50:03 avg_step=3.68s recent_step=3.11s eta=02:16:08
|
| 4789 |
+
2026-09-25 18:04:03 | INFO | train rank=0 | step=47790/50000 progress=95.6% loss=0.106923 lr=5.331676e-07 lr_backbone=5.331676e-07 elapsed=48:50:48 avg_step=3.68s recent_step=4.48s eta=02:15:31
|
| 4790 |
+
2026-09-25 18:04:42 | INFO | train rank=0 | step=47800/50000 progress=95.6% loss=0.093157 lr=5.283619e-07 lr_backbone=5.283619e-07 elapsed=48:51:26 avg_step=3.68s recent_step=3.81s eta=02:14:55
|
| 4791 |
+
2026-09-25 18:05:19 | INFO | train rank=0 | step=47810/50000 progress=95.6% loss=0.102506 lr=5.235780e-07 lr_backbone=5.235780e-07 elapsed=48:52:03 avg_step=3.68s recent_step=3.72s eta=02:14:18
|
| 4792 |
+
2026-09-25 18:05:52 | INFO | train rank=0 | step=47820/50000 progress=95.6% loss=0.075144 lr=5.188156e-07 lr_backbone=5.188156e-07 elapsed=48:52:36 avg_step=3.68s recent_step=3.28s eta=02:13:41
|
| 4793 |
+
2026-09-25 18:06:42 | INFO | train rank=0 | step=47830/50000 progress=95.7% loss=0.093749 lr=5.140749e-07 lr_backbone=5.140749e-07 elapsed=48:53:26 avg_step=3.68s recent_step=5.08s eta=02:13:05
|
| 4794 |
+
2026-09-25 18:07:12 | INFO | train rank=0 | step=47840/50000 progress=95.7% loss=0.070290 lr=5.093558e-07 lr_backbone=5.093558e-07 elapsed=48:53:56 avg_step=3.68s recent_step=3.01s eta=02:12:28
|
| 4795 |
+
2026-09-25 18:07:46 | INFO | train rank=0 | step=47850/50000 progress=95.7% loss=0.078120 lr=5.046584e-07 lr_backbone=5.046584e-07 elapsed=48:54:30 avg_step=3.68s recent_step=3.34s eta=02:11:51
|
| 4796 |
+
2026-09-25 18:08:20 | INFO | train rank=0 | step=47860/50000 progress=95.7% loss=0.096781 lr=4.999827e-07 lr_backbone=4.999827e-07 elapsed=48:55:04 avg_step=3.68s recent_step=3.37s eta=02:11:14
|
| 4797 |
+
2026-09-25 18:09:06 | INFO | train rank=0 | step=47870/50000 progress=95.7% loss=0.085675 lr=4.953286e-07 lr_backbone=4.953286e-07 elapsed=48:55:50 avg_step=3.68s recent_step=4.67s eta=02:10:37
|
| 4798 |
+
2026-09-25 18:09:45 | INFO | train rank=0 | step=47880/50000 progress=95.8% loss=0.127745 lr=4.906961e-07 lr_backbone=4.906961e-07 elapsed=48:56:29 avg_step=3.68s recent_step=3.89s eta=02:10:01
|
| 4799 |
+
2026-09-25 18:10:20 | INFO | train rank=0 | step=47890/50000 progress=95.8% loss=0.090761 lr=4.860853e-07 lr_backbone=4.860853e-07 elapsed=48:57:04 avg_step=3.68s recent_step=3.45s eta=02:09:24
|
| 4800 |
+
2026-09-25 18:10:50 | INFO | train rank=0 | step=47900/50000 progress=95.8% loss=0.079304 lr=4.814962e-07 lr_backbone=4.814962e-07 elapsed=48:57:34 avg_step=3.68s recent_step=3.00s eta=02:08:47
|
| 4801 |
+
2026-09-25 18:11:36 | INFO | train rank=0 | step=47910/50000 progress=95.8% loss=0.102134 lr=4.769287e-07 lr_backbone=4.769287e-07 elapsed=48:58:20 avg_step=3.68s recent_step=4.67s eta=02:08:10
|
| 4802 |
+
2026-09-25 18:12:06 | INFO | train rank=0 | step=47920/50000 progress=95.8% loss=0.075919 lr=4.723829e-07 lr_backbone=4.723829e-07 elapsed=48:58:50 avg_step=3.68s recent_step=2.92s eta=02:07:33
|
| 4803 |
+
2026-09-25 18:12:36 | INFO | train rank=0 | step=47930/50000 progress=95.9% loss=0.083342 lr=4.678588e-07 lr_backbone=4.678588e-07 elapsed=48:59:20 avg_step=3.68s recent_step=3.00s eta=02:06:56
|
| 4804 |
+
2026-09-25 18:13:07 | INFO | train rank=0 | step=47940/50000 progress=95.9% loss=0.089371 lr=4.633563e-07 lr_backbone=4.633563e-07 elapsed=48:59:51 avg_step=3.68s recent_step=3.18s eta=02:06:19
|
| 4805 |
+
2026-09-25 18:13:44 | INFO | train rank=0 | step=47950/50000 progress=95.9% loss=0.097180 lr=4.588755e-07 lr_backbone=4.588755e-07 elapsed=49:00:28 avg_step=3.68s recent_step=3.66s eta=02:05:42
|
| 4806 |
+
2026-09-25 18:14:13 | INFO | train rank=0 | step=47960/50000 progress=95.9% loss=0.075371 lr=4.544163e-07 lr_backbone=4.544163e-07 elapsed=49:00:57 avg_step=3.68s recent_step=2.89s eta=02:05:05
|
| 4807 |
+
2026-09-25 18:14:40 | INFO | train rank=0 | step=47970/50000 progress=95.9% loss=0.092553 lr=4.499789e-07 lr_backbone=4.499789e-07 elapsed=49:01:24 avg_step=3.68s recent_step=2.75s eta=02:04:28
|
| 4808 |
+
2026-09-25 18:15:11 | INFO | train rank=0 | step=47980/50000 progress=96.0% loss=0.089245 lr=4.455631e-07 lr_backbone=4.455631e-07 elapsed=49:01:55 avg_step=3.68s recent_step=3.06s eta=02:03:51
|
| 4809 |
+
2026-09-25 18:15:58 | INFO | train rank=0 | step=47990/50000 progress=96.0% loss=0.087174 lr=4.411690e-07 lr_backbone=4.411690e-07 elapsed=49:02:42 avg_step=3.68s recent_step=4.67s eta=02:03:15
|
| 4810 |
+
2026-09-25 18:16:36 | INFO | train rank=0 | step=48000/50000 progress=96.0% loss=0.067611 lr=4.367965e-07 lr_backbone=4.367965e-07 elapsed=49:03:20 avg_step=3.68s recent_step=3.82s eta=02:02:38
|
| 4811 |
+
2026-09-25 18:17:11 | INFO | train rank=0 | step=48010/50000 progress=96.0% loss=0.071715 lr=4.324458e-07 lr_backbone=4.324458e-07 elapsed=49:03:55 avg_step=3.68s recent_step=3.49s eta=02:02:01
|
| 4812 |
+
2026-09-25 18:17:51 | INFO | train rank=0 | step=48020/50000 progress=96.0% loss=0.067227 lr=4.281167e-07 lr_backbone=4.281167e-07 elapsed=49:04:35 avg_step=3.68s recent_step=4.01s eta=02:01:24
|
| 4813 |
+
2026-09-25 18:18:33 | INFO | train rank=0 | step=48030/50000 progress=96.1% loss=0.092723 lr=4.238093e-07 lr_backbone=4.238093e-07 elapsed=49:05:17 avg_step=3.68s recent_step=4.24s eta=02:00:48
|
| 4814 |
+
2026-09-25 18:19:10 | INFO | train rank=0 | step=48040/50000 progress=96.1% loss=0.083856 lr=4.195236e-07 lr_backbone=4.195236e-07 elapsed=49:05:54 avg_step=3.68s recent_step=3.67s eta=02:00:11
|
| 4815 |
+
2026-09-25 18:19:43 | INFO | train rank=0 | step=48050/50000 progress=96.1% loss=0.066282 lr=4.152596e-07 lr_backbone=4.152596e-07 elapsed=49:06:27 avg_step=3.68s recent_step=3.31s eta=01:59:34
|
| 4816 |
+
2026-09-25 18:20:19 | INFO | train rank=0 | step=48060/50000 progress=96.1% loss=0.082628 lr=4.110173e-07 lr_backbone=4.110173e-07 elapsed=49:07:03 avg_step=3.68s recent_step=3.59s eta=01:58:57
|
| 4817 |
+
2026-09-25 18:20:50 | INFO | train rank=0 | step=48070/50000 progress=96.1% loss=0.075510 lr=4.067967e-07 lr_backbone=4.067967e-07 elapsed=49:07:34 avg_step=3.68s recent_step=3.14s eta=01:58:20
|
| 4818 |
+
2026-09-25 18:21:46 | INFO | train rank=0 | step=48080/50000 progress=96.2% loss=0.100617 lr=4.025977e-07 lr_backbone=4.025977e-07 elapsed=49:08:30 avg_step=3.68s recent_step=5.52s eta=01:57:44
|
| 4819 |
+
2026-09-25 18:22:23 | INFO | train rank=0 | step=48090/50000 progress=96.2% loss=0.077968 lr=3.984205e-07 lr_backbone=3.984205e-07 elapsed=49:09:07 avg_step=3.68s recent_step=3.74s eta=01:57:07
|
| 4820 |
+
2026-09-25 18:22:45 | INFO | train rank=0 | step=48100/50000 progress=96.2% loss=0.079859 lr=3.942649e-07 lr_backbone=3.942649e-07 elapsed=49:09:29 avg_step=3.68s recent_step=2.23s eta=01:56:30
|
| 4821 |
+
2026-09-25 18:23:20 | INFO | train rank=0 | step=48110/50000 progress=96.2% loss=0.074810 lr=3.901311e-07 lr_backbone=3.901311e-07 elapsed=49:10:04 avg_step=3.68s recent_step=3.51s eta=01:55:53
|
| 4822 |
+
2026-09-25 18:24:07 | INFO | train rank=0 | step=48120/50000 progress=96.2% loss=0.089437 lr=3.860189e-07 lr_backbone=3.860189e-07 elapsed=49:10:51 avg_step=3.68s recent_step=4.66s eta=01:55:17
|
| 4823 |
+
2026-09-25 18:24:41 | INFO | train rank=0 | step=48130/50000 progress=96.3% loss=0.087162 lr=3.819285e-07 lr_backbone=3.819285e-07 elapsed=49:11:25 avg_step=3.68s recent_step=3.43s eta=01:54:40
|
| 4824 |
+
2026-09-25 18:25:16 | INFO | train rank=0 | step=48140/50000 progress=96.3% loss=0.059330 lr=3.778598e-07 lr_backbone=3.778598e-07 elapsed=49:12:00 avg_step=3.68s recent_step=3.44s eta=01:54:03
|
| 4825 |
+
2026-09-25 18:25:57 | INFO | train rank=0 | step=48150/50000 progress=96.3% loss=0.084822 lr=3.738127e-07 lr_backbone=3.738127e-07 elapsed=49:12:41 avg_step=3.68s recent_step=4.16s eta=01:53:26
|
| 4826 |
+
2026-09-25 18:26:47 | INFO | train rank=0 | step=48160/50000 progress=96.3% loss=0.120035 lr=3.697874e-07 lr_backbone=3.697874e-07 elapsed=49:13:31 avg_step=3.68s recent_step=4.93s eta=01:52:50
|
| 4827 |
+
2026-09-25 18:27:14 | INFO | train rank=0 | step=48170/50000 progress=96.3% loss=0.080790 lr=3.657838e-07 lr_backbone=3.657838e-07 elapsed=49:13:58 avg_step=3.68s recent_step=2.77s eta=01:52:13
|
| 4828 |
+
2026-09-25 18:27:46 | INFO | train rank=0 | step=48180/50000 progress=96.4% loss=0.079196 lr=3.618019e-07 lr_backbone=3.618019e-07 elapsed=49:14:30 avg_step=3.68s recent_step=3.17s eta=01:51:36
|
| 4829 |
+
2026-09-25 18:28:26 | INFO | train rank=0 | step=48190/50000 progress=96.4% loss=0.069618 lr=3.578417e-07 lr_backbone=3.578417e-07 elapsed=49:15:10 avg_step=3.68s recent_step=3.95s eta=01:50:59
|
| 4830 |
+
2026-09-25 18:29:11 | INFO | train rank=0 | step=48200/50000 progress=96.4% loss=0.085893 lr=3.539033e-07 lr_backbone=3.539033e-07 elapsed=49:15:55 avg_step=3.68s recent_step=4.54s eta=01:50:23
|
| 4831 |
+
2026-09-25 18:29:40 | INFO | train rank=0 | step=48210/50000 progress=96.4% loss=0.073306 lr=3.499865e-07 lr_backbone=3.499865e-07 elapsed=49:16:24 avg_step=3.68s recent_step=2.90s eta=01:49:46
|
| 4832 |
+
2026-09-25 18:30:12 | INFO | train rank=0 | step=48220/50000 progress=96.4% loss=0.101468 lr=3.460915e-07 lr_backbone=3.460915e-07 elapsed=49:16:56 avg_step=3.68s recent_step=3.19s eta=01:49:09
|
| 4833 |
+
2026-09-25 18:30:45 | INFO | train rank=0 | step=48230/50000 progress=96.5% loss=0.078569 lr=3.422181e-07 lr_backbone=3.422181e-07 elapsed=49:17:29 avg_step=3.68s recent_step=3.32s eta=01:48:32
|
| 4834 |
+
2026-09-25 18:31:32 | INFO | train rank=0 | step=48240/50000 progress=96.5% loss=0.118519 lr=3.383666e-07 lr_backbone=3.383666e-07 elapsed=49:18:16 avg_step=3.68s recent_step=4.71s eta=01:47:55
|
| 4835 |
+
2026-09-25 18:31:58 | INFO | train rank=0 | step=48250/50000 progress=96.5% loss=0.095899 lr=3.345367e-07 lr_backbone=3.345367e-07 elapsed=49:18:42 avg_step=3.68s recent_step=2.56s eta=01:47:18
|
| 4836 |
+
2026-09-25 18:32:24 | INFO | train rank=0 | step=48260/50000 progress=96.5% loss=0.102419 lr=3.307285e-07 lr_backbone=3.307285e-07 elapsed=49:19:08 avg_step=3.68s recent_step=2.62s eta=01:46:41
|
| 4837 |
+
2026-09-25 18:32:47 | INFO | train rank=0 | step=48270/50000 progress=96.5% loss=0.078390 lr=3.269421e-07 lr_backbone=3.269421e-07 elapsed=49:19:31 avg_step=3.68s recent_step=2.31s eta=01:46:04
|
| 4838 |
+
2026-09-25 18:33:31 | INFO | train rank=0 | step=48280/50000 progress=96.6% loss=0.097407 lr=3.231774e-07 lr_backbone=3.231774e-07 elapsed=49:20:15 avg_step=3.68s recent_step=4.40s eta=01:45:27
|
| 4839 |
+
2026-09-25 18:34:04 | INFO | train rank=0 | step=48290/50000 progress=96.6% loss=0.082627 lr=3.194345e-07 lr_backbone=3.194345e-07 elapsed=49:20:48 avg_step=3.68s recent_step=3.28s eta=01:44:50
|
| 4840 |
+
2026-09-25 18:34:32 | INFO | train rank=0 | step=48300/50000 progress=96.6% loss=0.107056 lr=3.157132e-07 lr_backbone=3.157132e-07 elapsed=49:21:16 avg_step=3.68s recent_step=2.84s eta=01:44:13
|
| 4841 |
+
2026-09-25 18:35:14 | INFO | train rank=0 | step=48310/50000 progress=96.6% loss=0.075648 lr=3.120138e-07 lr_backbone=3.120138e-07 elapsed=49:21:58 avg_step=3.68s recent_step=4.14s eta=01:43:37
|
| 4842 |
+
2026-09-25 18:35:52 | INFO | train rank=0 | step=48320/50000 progress=96.6% loss=0.087796 lr=3.083360e-07 lr_backbone=3.083360e-07 elapsed=49:22:36 avg_step=3.68s recent_step=3.80s eta=01:43:00
|
| 4843 |
+
2026-09-25 18:36:27 | INFO | train rank=0 | step=48330/50000 progress=96.7% loss=0.061818 lr=3.046800e-07 lr_backbone=3.046800e-07 elapsed=49:23:12 avg_step=3.68s recent_step=3.57s eta=01:42:23
|
| 4844 |
+
2026-09-25 18:37:02 | INFO | train rank=0 | step=48340/50000 progress=96.7% loss=0.070346 lr=3.010457e-07 lr_backbone=3.010457e-07 elapsed=49:23:46 avg_step=3.68s recent_step=3.43s eta=01:41:46
|
| 4845 |
+
2026-09-25 18:37:49 | INFO | train rank=0 | step=48350/50000 progress=96.7% loss=0.086274 lr=2.974332e-07 lr_backbone=2.974332e-07 elapsed=49:24:33 avg_step=3.68s recent_step=4.70s eta=01:41:10
|
| 4846 |
+
2026-09-25 18:38:22 | INFO | train rank=0 | step=48360/50000 progress=96.7% loss=0.087623 lr=2.938424e-07 lr_backbone=2.938424e-07 elapsed=49:25:06 avg_step=3.68s recent_step=3.29s eta=01:40:33
|
| 4847 |
+
2026-09-25 18:38:54 | INFO | train rank=0 | step=48370/50000 progress=96.7% loss=0.084267 lr=2.902733e-07 lr_backbone=2.902733e-07 elapsed=49:25:38 avg_step=3.68s recent_step=3.25s eta=01:39:56
|
| 4848 |
+
2026-09-25 18:39:25 | INFO | train rank=0 | step=48380/50000 progress=96.8% loss=0.091050 lr=2.867260e-07 lr_backbone=2.867260e-07 elapsed=49:26:09 avg_step=3.68s recent_step=3.08s eta=01:39:19
|
| 4849 |
+
2026-09-25 18:40:19 | INFO | train rank=0 | step=48390/50000 progress=96.8% loss=0.066419 lr=2.832004e-07 lr_backbone=2.832004e-07 elapsed=49:27:03 avg_step=3.68s recent_step=5.39s eta=01:38:43
|
| 4850 |
+
2026-09-25 18:40:48 | INFO | train rank=0 | step=48400/50000 progress=96.8% loss=0.070792 lr=2.796966e-07 lr_backbone=2.796966e-07 elapsed=49:27:33 avg_step=3.68s recent_step=2.95s eta=01:38:06
|
| 4851 |
+
2026-09-25 18:41:24 | INFO | train rank=0 | step=48410/50000 progress=96.8% loss=0.088477 lr=2.762145e-07 lr_backbone=2.762145e-07 elapsed=49:28:08 avg_step=3.68s recent_step=3.53s eta=01:37:29
|
| 4852 |
+
2026-09-25 18:41:58 | INFO | train rank=0 | step=48420/50000 progress=96.8% loss=0.098027 lr=2.727542e-07 lr_backbone=2.727542e-07 elapsed=49:28:42 avg_step=3.68s recent_step=3.38s eta=01:36:52
|
| 4853 |
+
2026-09-25 18:42:39 | INFO | train rank=0 | step=48430/50000 progress=96.9% loss=0.070162 lr=2.693156e-07 lr_backbone=2.693156e-07 elapsed=49:29:23 avg_step=3.68s recent_step=4.15s eta=01:36:15
|
| 4854 |
+
2026-09-25 18:43:14 | INFO | train rank=0 | step=48440/50000 progress=96.9% loss=0.086852 lr=2.658988e-07 lr_backbone=2.658988e-07 elapsed=49:29:58 avg_step=3.68s recent_step=3.48s eta=01:35:38
|
| 4855 |
+
2026-09-25 18:43:52 | INFO | train rank=0 | step=48450/50000 progress=96.9% loss=0.072078 lr=2.625038e-07 lr_backbone=2.625038e-07 elapsed=49:30:36 avg_step=3.68s recent_step=3.79s eta=01:35:02
|
| 4856 |
+
2026-09-25 18:44:27 | INFO | train rank=0 | step=48460/50000 progress=96.9% loss=0.072328 lr=2.591305e-07 lr_backbone=2.591305e-07 elapsed=49:31:11 avg_step=3.68s recent_step=3.55s eta=01:34:25
|
| 4857 |
+
2026-09-25 18:45:08 | INFO | train rank=0 | step=48470/50000 progress=96.9% loss=0.076234 lr=2.557789e-07 lr_backbone=2.557789e-07 elapsed=49:31:52 avg_step=3.68s recent_step=4.06s eta=01:33:48
|
| 4858 |
+
2026-09-25 18:45:47 | INFO | train rank=0 | step=48480/50000 progress=97.0% loss=0.069693 lr=2.524492e-07 lr_backbone=2.524492e-07 elapsed=49:32:31 avg_step=3.68s recent_step=3.96s eta=01:33:11
|
| 4859 |
+
2026-09-25 18:46:20 | INFO | train rank=0 | step=48490/50000 progress=97.0% loss=0.097641 lr=2.491411e-07 lr_backbone=2.491411e-07 elapsed=49:33:04 avg_step=3.68s recent_step=3.26s eta=01:32:34
|
| 4860 |
+
2026-09-25 18:46:49 | INFO | train rank=0 | step=48500/50000 progress=97.0% loss=0.081931 lr=2.458549e-07 lr_backbone=2.458549e-07 elapsed=49:33:33 avg_step=3.68s recent_step=2.91s eta=01:31:57
|
| 4861 |
+
2026-09-25 18:47:19 | INFO | train rank=0 | step=48510/50000 progress=97.0% loss=0.097496 lr=2.425904e-07 lr_backbone=2.425904e-07 elapsed=49:34:04 avg_step=3.68s recent_step=3.04s eta=01:31:20
|
| 4862 |
+
2026-09-25 18:48:00 | INFO | train rank=0 | step=48520/50000 progress=97.0% loss=0.105955 lr=2.393477e-07 lr_backbone=2.393477e-07 elapsed=49:34:44 avg_step=3.68s recent_step=4.01s eta=01:30:44
|
| 4863 |
+
2026-09-25 18:48:36 | INFO | train rank=0 | step=48530/50000 progress=97.1% loss=0.075693 lr=2.361267e-07 lr_backbone=2.361267e-07 elapsed=49:35:20 avg_step=3.68s recent_step=3.61s eta=01:30:07
|
| 4864 |
+
2026-09-25 18:49:08 | INFO | train rank=0 | step=48540/50000 progress=97.1% loss=0.068665 lr=2.329275e-07 lr_backbone=2.329275e-07 elapsed=49:35:52 avg_step=3.68s recent_step=3.21s eta=01:29:30
|
| 4865 |
+
2026-09-25 18:49:42 | INFO | train rank=0 | step=48550/50000 progress=97.1% loss=0.074055 lr=2.297501e-07 lr_backbone=2.297501e-07 elapsed=49:36:26 avg_step=3.68s recent_step=3.42s eta=01:28:53
|
| 4866 |
+
2026-09-25 18:50:19 | INFO | train rank=0 | step=48560/50000 progress=97.1% loss=0.085455 lr=2.265944e-07 lr_backbone=2.265944e-07 elapsed=49:37:03 avg_step=3.68s recent_step=3.73s eta=01:28:16
|
| 4867 |
+
2026-09-25 18:50:49 | INFO | train rank=0 | step=48570/50000 progress=97.1% loss=0.084928 lr=2.234605e-07 lr_backbone=2.234605e-07 elapsed=49:37:33 avg_step=3.68s recent_step=3.00s eta=01:27:39
|
| 4868 |
+
2026-09-25 18:51:25 | INFO | train rank=0 | step=48580/50000 progress=97.2% loss=0.100007 lr=2.203484e-07 lr_backbone=2.203484e-07 elapsed=49:38:09 avg_step=3.68s recent_step=3.58s eta=01:27:03
|
| 4869 |
+
2026-09-25 18:52:04 | INFO | train rank=0 | step=48590/50000 progress=97.2% loss=0.087554 lr=2.172581e-07 lr_backbone=2.172581e-07 elapsed=49:38:48 avg_step=3.68s recent_step=3.88s eta=01:26:26
|
| 4870 |
+
2026-09-25 18:53:00 | INFO | train rank=0 | step=48600/50000 progress=97.2% loss=0.106161 lr=2.141896e-07 lr_backbone=2.141896e-07 elapsed=49:39:44 avg_step=3.68s recent_step=5.63s eta=01:25:50
|
| 4871 |
+
2026-09-25 18:53:30 | INFO | train rank=0 | step=48610/50000 progress=97.2% loss=0.076699 lr=2.111428e-07 lr_backbone=2.111428e-07 elapsed=49:40:14 avg_step=3.68s recent_step=3.00s eta=01:25:13
|
| 4872 |
+
2026-09-25 18:54:04 | INFO | train rank=0 | step=48620/50000 progress=97.2% loss=0.075392 lr=2.081178e-07 lr_backbone=2.081178e-07 elapsed=49:40:48 avg_step=3.68s recent_step=3.40s eta=01:24:36
|
| 4873 |
+
2026-09-25 18:54:36 | INFO | train rank=0 | step=48630/50000 progress=97.3% loss=0.075041 lr=2.051146e-07 lr_backbone=2.051146e-07 elapsed=49:41:20 avg_step=3.68s recent_step=3.20s eta=01:23:59
|
| 4874 |
+
2026-09-25 18:55:17 | INFO | train rank=0 | step=48640/50000 progress=97.3% loss=0.074597 lr=2.021331e-07 lr_backbone=2.021331e-07 elapsed=49:42:01 avg_step=3.68s recent_step=4.09s eta=01:23:22
|
| 4875 |
+
2026-09-25 18:55:45 | INFO | train rank=0 | step=48650/50000 progress=97.3% loss=0.075214 lr=1.991735e-07 lr_backbone=1.991735e-07 elapsed=49:42:29 avg_step=3.68s recent_step=2.74s eta=01:22:45
|
| 4876 |
+
2026-09-25 18:56:17 | INFO | train rank=0 | step=48660/50000 progress=97.3% loss=0.092504 lr=1.962356e-07 lr_backbone=1.962356e-07 elapsed=49:43:01 avg_step=3.68s recent_step=3.23s eta=01:22:08
|
| 4877 |
+
2026-09-25 18:56:50 | INFO | train rank=0 | step=48670/50000 progress=97.3% loss=0.071360 lr=1.933195e-07 lr_backbone=1.933195e-07 elapsed=49:43:34 avg_step=3.68s recent_step=3.28s eta=01:21:31
|
| 4878 |
+
2026-09-25 18:57:36 | INFO | train rank=0 | step=48680/50000 progress=97.4% loss=0.115222 lr=1.904253e-07 lr_backbone=1.904253e-07 elapsed=49:44:20 avg_step=3.68s recent_step=4.68s eta=01:20:55
|
| 4879 |
+
2026-09-25 18:58:06 | INFO | train rank=0 | step=48690/50000 progress=97.4% loss=0.099317 lr=1.875527e-07 lr_backbone=1.875527e-07 elapsed=49:44:50 avg_step=3.68s recent_step=2.96s eta=01:20:18
|
| 4880 |
+
2026-09-25 18:58:47 | INFO | train rank=0 | step=48700/50000 progress=97.4% loss=0.077757 lr=1.847020e-07 lr_backbone=1.847020e-07 elapsed=49:45:31 avg_step=3.68s recent_step=4.06s eta=01:19:41
|
| 4881 |
+
2026-09-25 18:59:23 | INFO | train rank=0 | step=48710/50000 progress=97.4% loss=0.080790 lr=1.818731e-07 lr_backbone=1.818731e-07 elapsed=49:46:07 avg_step=3.68s recent_step=3.60s eta=01:19:04
|
| 4882 |
+
2026-09-25 19:00:06 | INFO | train rank=0 | step=48720/50000 progress=97.4% loss=0.088184 lr=1.790660e-07 lr_backbone=1.790660e-07 elapsed=49:46:50 avg_step=3.68s recent_step=4.33s eta=01:18:28
|
| 4883 |
+
2026-09-25 19:00:38 | INFO | train rank=0 | step=48730/50000 progress=97.5% loss=0.144607 lr=1.762806e-07 lr_backbone=1.762806e-07 elapsed=49:47:22 avg_step=3.68s recent_step=3.26s eta=01:17:51
|
| 4884 |
+
2026-09-25 19:01:07 | INFO | train rank=0 | step=48740/50000 progress=97.5% loss=0.090489 lr=1.735171e-07 lr_backbone=1.735171e-07 elapsed=49:47:51 avg_step=3.68s recent_step=2.89s eta=01:17:14
|
| 4885 |
+
2026-09-25 19:01:47 | INFO | train rank=0 | step=48750/50000 progress=97.5% loss=0.094168 lr=1.707753e-07 lr_backbone=1.707753e-07 elapsed=49:48:32 avg_step=3.68s recent_step=4.01s eta=01:16:37
|
| 4886 |
+
2026-09-25 19:02:42 | INFO | train rank=0 | step=48760/50000 progress=97.5% loss=0.072680 lr=1.680554e-07 lr_backbone=1.680554e-07 elapsed=49:49:26 avg_step=3.68s recent_step=5.42s eta=01:16:01
|
| 4887 |
+
2026-09-25 19:03:11 | INFO | train rank=0 | step=48770/50000 progress=97.5% loss=0.091639 lr=1.653572e-07 lr_backbone=1.653572e-07 elapsed=49:49:55 avg_step=3.68s recent_step=2.91s eta=01:15:24
|
| 4888 |
+
2026-09-25 19:03:41 | INFO | train rank=0 | step=48780/50000 progress=97.6% loss=0.076184 lr=1.626809e-07 lr_backbone=1.626809e-07 elapsed=49:50:25 avg_step=3.68s recent_step=3.02s eta=01:14:47
|
| 4889 |
+
2026-09-25 19:04:16 | INFO | train rank=0 | step=48790/50000 progress=97.6% loss=0.130258 lr=1.600263e-07 lr_backbone=1.600263e-07 elapsed=49:51:00 avg_step=3.68s recent_step=3.53s eta=01:14:10
|
| 4890 |
+
2026-09-25 19:05:05 | INFO | train rank=0 | step=48800/50000 progress=97.6% loss=0.098704 lr=1.573936e-07 lr_backbone=1.573936e-07 elapsed=49:51:49 avg_step=3.68s recent_step=4.84s eta=01:13:34
|
| 4891 |
+
2026-09-25 19:05:44 | INFO | train rank=0 | step=48810/50000 progress=97.6% loss=0.075530 lr=1.547826e-07 lr_backbone=1.547826e-07 elapsed=49:52:28 avg_step=3.68s recent_step=3.97s eta=01:12:57
|
| 4892 |
+
2026-09-25 19:06:14 | INFO | train rank=0 | step=48820/50000 progress=97.6% loss=0.115446 lr=1.521935e-07 lr_backbone=1.521935e-07 elapsed=49:52:58 avg_step=3.68s recent_step=2.96s eta=01:12:20
|
| 4893 |
+
2026-09-25 19:06:58 | INFO | train rank=0 | step=48830/50000 progress=97.7% loss=0.081192 lr=1.496262e-07 lr_backbone=1.496262e-07 elapsed=49:53:42 avg_step=3.68s recent_step=4.44s eta=01:11:43
|
| 4894 |
+
2026-09-25 19:07:41 | INFO | train rank=0 | step=48840/50000 progress=97.7% loss=0.072107 lr=1.470806e-07 lr_backbone=1.470806e-07 elapsed=49:54:25 avg_step=3.68s recent_step=4.24s eta=01:11:07
|
| 4895 |
+
2026-09-25 19:08:19 | INFO | train rank=0 | step=48850/50000 progress=97.7% loss=0.083549 lr=1.445569e-07 lr_backbone=1.445569e-07 elapsed=49:55:03 avg_step=3.68s recent_step=3.81s eta=01:10:30
|
| 4896 |
+
2026-09-25 19:08:53 | INFO | train rank=0 | step=48860/50000 progress=97.7% loss=0.073466 lr=1.420550e-07 lr_backbone=1.420550e-07 elapsed=49:55:37 avg_step=3.68s recent_step=3.38s eta=01:09:53
|
| 4897 |
+
2026-09-25 19:09:27 | INFO | train rank=0 | step=48870/50000 progress=97.7% loss=0.075560 lr=1.395749e-07 lr_backbone=1.395749e-07 elapsed=49:56:11 avg_step=3.68s recent_step=3.44s eta=01:09:16
|
| 4898 |
+
2026-09-25 19:10:03 | INFO | train rank=0 | step=48880/50000 progress=97.8% loss=0.080531 lr=1.371166e-07 lr_backbone=1.371166e-07 elapsed=49:56:47 avg_step=3.68s recent_step=3.56s eta=01:08:39
|
| 4899 |
+
2026-09-25 19:10:38 | INFO | train rank=0 | step=48890/50000 progress=97.8% loss=0.094883 lr=1.346801e-07 lr_backbone=1.346801e-07 elapsed=49:57:22 avg_step=3.68s recent_step=3.56s eta=01:08:03
|
| 4900 |
+
2026-09-25 19:11:07 | INFO | train rank=0 | step=48900/50000 progress=97.8% loss=0.082648 lr=1.322654e-07 lr_backbone=1.322654e-07 elapsed=49:57:51 avg_step=3.68s recent_step=2.92s eta=01:07:26
|
| 4901 |
+
2026-09-25 19:11:54 | INFO | train rank=0 | step=48910/50000 progress=97.8% loss=0.090574 lr=1.298726e-07 lr_backbone=1.298726e-07 elapsed=49:58:38 avg_step=3.68s recent_step=4.62s eta=01:06:49
|
| 4902 |
+
2026-09-25 19:12:31 | INFO | train rank=0 | step=48920/50000 progress=97.8% loss=0.102146 lr=1.275015e-07 lr_backbone=1.275015e-07 elapsed=49:59:15 avg_step=3.68s recent_step=3.76s eta=01:06:12
|
| 4903 |
+
2026-09-25 19:12:56 | INFO | train rank=0 | step=48930/50000 progress=97.9% loss=0.095820 lr=1.251523e-07 lr_backbone=1.251523e-07 elapsed=49:59:40 avg_step=3.68s recent_step=2.47s eta=01:05:35
|
| 4904 |
+
2026-09-25 19:13:37 | INFO | train rank=0 | step=48940/50000 progress=97.9% loss=0.097126 lr=1.228249e-07 lr_backbone=1.228249e-07 elapsed=50:00:21 avg_step=3.68s recent_step=4.12s eta=01:04:59
|
| 4905 |
+
2026-09-25 19:14:26 | INFO | train rank=0 | step=48950/50000 progress=97.9% loss=0.082658 lr=1.205193e-07 lr_backbone=1.205193e-07 elapsed=50:01:10 avg_step=3.68s recent_step=4.86s eta=01:04:22
|
| 4906 |
+
2026-09-25 19:15:03 | INFO | train rank=0 | step=48960/50000 progress=97.9% loss=0.076475 lr=1.182355e-07 lr_backbone=1.182355e-07 elapsed=50:01:47 avg_step=3.68s recent_step=3.77s eta=01:03:45
|
| 4907 |
+
2026-09-25 19:15:31 | INFO | train rank=0 | step=48970/50000 progress=97.9% loss=0.093003 lr=1.159736e-07 lr_backbone=1.159736e-07 elapsed=50:02:15 avg_step=3.68s recent_step=2.81s eta=01:03:08
|
| 4908 |
+
2026-09-25 19:16:04 | INFO | train rank=0 | step=48980/50000 progress=98.0% loss=0.089393 lr=1.137334e-07 lr_backbone=1.137334e-07 elapsed=50:02:48 avg_step=3.68s recent_step=3.26s eta=01:02:31
|
| 4909 |
+
2026-09-25 19:16:44 | INFO | train rank=0 | step=48990/50000 progress=98.0% loss=0.113835 lr=1.115151e-07 lr_backbone=1.115151e-07 elapsed=50:03:28 avg_step=3.68s recent_step=3.99s eta=01:01:55
|
| 4910 |
+
2026-09-25 19:17:23 | INFO | train rank=0 | step=49000/50000 progress=98.0% loss=0.113550 lr=1.093186e-07 lr_backbone=1.093186e-07 elapsed=50:04:07 avg_step=3.68s recent_step=3.91s eta=01:01:18
|
| 4911 |
+
2026-09-25 19:17:54 | INFO | train rank=0 | step=49010/50000 progress=98.0% loss=0.092670 lr=1.071440e-07 lr_backbone=1.071440e-07 elapsed=50:04:38 avg_step=3.68s recent_step=3.11s eta=01:00:41
|
| 4912 |
+
2026-09-25 19:18:28 | INFO | train rank=0 | step=49020/50000 progress=98.0% loss=0.097503 lr=1.049911e-07 lr_backbone=1.049911e-07 elapsed=50:05:12 avg_step=3.68s recent_step=3.35s eta=01:00:04
|
| 4913 |
+
2026-09-25 19:19:09 | INFO | train rank=0 | step=49030/50000 progress=98.1% loss=0.084238 lr=1.028601e-07 lr_backbone=1.028601e-07 elapsed=50:05:54 avg_step=3.68s recent_step=4.19s eta=00:59:28
|
| 4914 |
+
2026-09-25 19:19:40 | INFO | train rank=0 | step=49040/50000 progress=98.1% loss=0.125338 lr=1.007509e-07 lr_backbone=1.007509e-07 elapsed=50:06:24 avg_step=3.68s recent_step=3.07s eta=00:58:51
|
| 4915 |
+
2026-09-25 19:20:14 | INFO | train rank=0 | step=49050/50000 progress=98.1% loss=0.098815 lr=9.866358e-08 lr_backbone=9.866358e-08 elapsed=50:06:58 avg_step=3.68s recent_step=3.35s eta=00:58:14
|
| 4916 |
+
2026-09-25 19:20:46 | INFO | train rank=0 | step=49060/50000 progress=98.1% loss=0.093969 lr=9.659805e-08 lr_backbone=9.659805e-08 elapsed=50:07:30 avg_step=3.68s recent_step=3.22s eta=00:57:37
|
| 4917 |
+
2026-09-25 19:21:29 | INFO | train rank=0 | step=49070/50000 progress=98.1% loss=0.097909 lr=9.455435e-08 lr_backbone=9.455435e-08 elapsed=50:08:13 avg_step=3.68s recent_step=4.34s eta=00:57:00
|
| 4918 |
+
2026-09-25 19:22:04 | INFO | train rank=0 | step=49080/50000 progress=98.2% loss=0.071403 lr=9.253248e-08 lr_backbone=9.253248e-08 elapsed=50:08:48 avg_step=3.68s recent_step=3.47s eta=00:56:23
|
| 4919 |
+
2026-09-25 19:22:38 | INFO | train rank=0 | step=49090/50000 progress=98.2% loss=0.108595 lr=9.053244e-08 lr_backbone=9.053244e-08 elapsed=50:09:22 avg_step=3.68s recent_step=3.41s eta=00:55:47
|
| 4920 |
+
2026-09-25 19:23:16 | INFO | train rank=0 | step=49100/50000 progress=98.2% loss=0.095352 lr=8.855423e-08 lr_backbone=8.855423e-08 elapsed=50:10:00 avg_step=3.68s recent_step=3.82s eta=00:55:10
|
| 4921 |
+
2026-09-25 19:24:07 | INFO | train rank=0 | step=49110/50000 progress=98.2% loss=0.076950 lr=8.659786e-08 lr_backbone=8.659786e-08 elapsed=50:10:51 avg_step=3.68s recent_step=5.06s eta=00:54:33
|
| 4922 |
+
2026-09-25 19:24:33 | INFO | train rank=0 | step=49120/50000 progress=98.2% loss=0.112244 lr=8.466332e-08 lr_backbone=8.466332e-08 elapsed=50:11:17 avg_step=3.68s recent_step=2.63s eta=00:53:56
|
| 4923 |
+
2026-09-25 19:25:02 | INFO | train rank=0 | step=49130/50000 progress=98.3% loss=0.108938 lr=8.275061e-08 lr_backbone=8.275061e-08 elapsed=50:11:46 avg_step=3.68s recent_step=2.90s eta=00:53:19
|
| 4924 |
+
2026-09-25 19:25:44 | INFO | train rank=0 | step=49140/50000 progress=98.3% loss=0.094711 lr=8.085974e-08 lr_backbone=8.085974e-08 elapsed=50:12:28 avg_step=3.68s recent_step=4.21s eta=00:52:43
|
| 4925 |
+
2026-09-25 19:26:35 | INFO | train rank=0 | step=49150/50000 progress=98.3% loss=0.088518 lr=7.899071e-08 lr_backbone=7.899071e-08 elapsed=50:13:19 avg_step=3.68s recent_step=5.12s eta=00:52:06
|
| 4926 |
+
2026-09-25 19:27:12 | INFO | train rank=0 | step=49160/50000 progress=98.3% loss=0.085159 lr=7.714351e-08 lr_backbone=7.714351e-08 elapsed=50:13:56 avg_step=3.68s recent_step=3.62s eta=00:51:29
|
| 4927 |
+
2026-09-25 19:27:39 | INFO | train rank=0 | step=49170/50000 progress=98.3% loss=0.071985 lr=7.531815e-08 lr_backbone=7.531815e-08 elapsed=50:14:23 avg_step=3.68s recent_step=2.72s eta=00:50:53
|
| 4928 |
+
2026-09-25 19:28:24 | INFO | train rank=0 | step=49180/50000 progress=98.4% loss=0.087510 lr=7.351463e-08 lr_backbone=7.351463e-08 elapsed=50:15:08 avg_step=3.68s recent_step=4.47s eta=00:50:16
|
| 4929 |
+
2026-09-25 19:29:00 | INFO | train rank=0 | step=49190/50000 progress=98.4% loss=0.088581 lr=7.173295e-08 lr_backbone=7.173295e-08 elapsed=50:15:44 avg_step=3.68s recent_step=3.64s eta=00:49:39
|
| 4930 |
+
2026-09-25 19:29:32 | INFO | train rank=0 | step=49200/50000 progress=98.4% loss=0.094214 lr=6.997311e-08 lr_backbone=6.997311e-08 elapsed=50:16:16 avg_step=3.68s recent_step=3.15s eta=00:49:02
|
| 4931 |
+
2026-09-25 19:30:03 | INFO | train rank=0 | step=49210/50000 progress=98.4% loss=0.102025 lr=6.823511e-08 lr_backbone=6.823511e-08 elapsed=50:16:47 avg_step=3.68s recent_step=3.14s eta=00:48:25
|
| 4932 |
+
2026-09-25 19:30:43 | INFO | train rank=0 | step=49220/50000 progress=98.4% loss=0.092232 lr=6.651896e-08 lr_backbone=6.651896e-08 elapsed=50:17:27 avg_step=3.68s recent_step=3.97s eta=00:47:49
|
| 4933 |
+
2026-09-25 19:31:32 | INFO | train rank=0 | step=49230/50000 progress=98.5% loss=0.090062 lr=6.482464e-08 lr_backbone=6.482464e-08 elapsed=50:18:16 avg_step=3.68s recent_step=4.95s eta=00:47:12
|
| 4934 |
+
2026-09-25 19:32:05 | INFO | train rank=0 | step=49240/50000 progress=98.5% loss=0.088008 lr=6.315217e-08 lr_backbone=6.315217e-08 elapsed=50:18:49 avg_step=3.68s recent_step=3.28s eta=00:46:35
|
| 4935 |
+
2026-09-25 19:32:31 | INFO | train rank=0 | step=49250/50000 progress=98.5% loss=0.085781 lr=6.150154e-08 lr_backbone=6.150154e-08 elapsed=50:19:15 avg_step=3.68s recent_step=2.62s eta=00:45:58
|
| 4936 |
+
2026-09-25 19:33:01 | INFO | train rank=0 | step=49260/50000 progress=98.5% loss=0.099902 lr=5.987276e-08 lr_backbone=5.987276e-08 elapsed=50:19:45 avg_step=3.68s recent_step=2.98s eta=00:45:21
|
| 4937 |
+
2026-09-25 19:33:49 | INFO | train rank=0 | step=49270/50000 progress=98.5% loss=0.114017 lr=5.826582e-08 lr_backbone=5.826582e-08 elapsed=50:20:33 avg_step=3.68s recent_step=4.81s eta=00:44:45
|
| 4938 |
+
2026-09-25 19:34:23 | INFO | train rank=0 | step=49280/50000 progress=98.6% loss=0.103914 lr=5.668073e-08 lr_backbone=5.668073e-08 elapsed=50:21:07 avg_step=3.68s recent_step=3.39s eta=00:44:08
|
| 4939 |
+
2026-09-25 19:34:56 | INFO | train rank=0 | step=49290/50000 progress=98.6% loss=0.097227 lr=5.511749e-08 lr_backbone=5.511749e-08 elapsed=50:21:40 avg_step=3.68s recent_step=3.28s eta=00:43:31
|
| 4940 |
+
2026-09-25 19:35:22 | INFO | train rank=0 | step=49300/50000 progress=98.6% loss=0.063164 lr=5.357609e-08 lr_backbone=5.357609e-08 elapsed=50:22:06 avg_step=3.68s recent_step=2.61s eta=00:42:54
|
| 4941 |
+
2026-09-25 19:36:06 | INFO | train rank=0 | step=49310/50000 progress=98.6% loss=0.065192 lr=5.205655e-08 lr_backbone=5.205655e-08 elapsed=50:22:50 avg_step=3.68s recent_step=4.47s eta=00:42:17
|
| 4942 |
+
2026-09-25 19:36:35 | INFO | train rank=0 | step=49320/50000 progress=98.6% loss=0.084106 lr=5.055885e-08 lr_backbone=5.055885e-08 elapsed=50:23:19 avg_step=3.68s recent_step=2.87s eta=00:41:41
|
| 4943 |
+
2026-09-25 19:37:12 | INFO | train rank=0 | step=49330/50000 progress=98.7% loss=0.103548 lr=4.908300e-08 lr_backbone=4.908300e-08 elapsed=50:23:56 avg_step=3.68s recent_step=3.69s eta=00:41:04
|
| 4944 |
+
2026-09-25 19:37:44 | INFO | train rank=0 | step=49340/50000 progress=98.7% loss=0.089238 lr=4.762900e-08 lr_backbone=4.762900e-08 elapsed=50:24:28 avg_step=3.68s recent_step=3.16s eta=00:40:27
|
| 4945 |
+
2026-09-25 19:38:22 | INFO | train rank=0 | step=49350/50000 progress=98.7% loss=0.080690 lr=4.619685e-08 lr_backbone=4.619685e-08 elapsed=50:25:06 avg_step=3.68s recent_step=3.83s eta=00:39:50
|
| 4946 |
+
2026-09-25 19:38:51 | INFO | train rank=0 | step=49360/50000 progress=98.7% loss=0.092329 lr=4.478655e-08 lr_backbone=4.478655e-08 elapsed=50:25:35 avg_step=3.68s recent_step=2.89s eta=00:39:13
|
| 4947 |
+
2026-09-25 19:39:26 | INFO | train rank=0 | step=49370/50000 progress=98.7% loss=0.063601 lr=4.339811e-08 lr_backbone=4.339811e-08 elapsed=50:26:10 avg_step=3.68s recent_step=3.50s eta=00:38:36
|
| 4948 |
+
2026-09-25 19:40:04 | INFO | train rank=0 | step=49380/50000 progress=98.8% loss=0.082234 lr=4.203152e-08 lr_backbone=4.203152e-08 elapsed=50:26:48 avg_step=3.68s recent_step=3.86s eta=00:38:00
|
| 4949 |
+
2026-09-25 19:40:47 | INFO | train rank=0 | step=49390/50000 progress=98.8% loss=0.089409 lr=4.068678e-08 lr_backbone=4.068678e-08 elapsed=50:27:31 avg_step=3.68s recent_step=4.28s eta=00:37:23
|
| 4950 |
+
2026-09-25 19:41:36 | INFO | train rank=0 | step=49400/50000 progress=98.8% loss=0.083184 lr=3.936389e-08 lr_backbone=3.936389e-08 elapsed=50:28:20 avg_step=3.68s recent_step=4.84s eta=00:36:46
|
| 4951 |
+
2026-09-25 19:42:05 | INFO | train rank=0 | step=49410/50000 progress=98.8% loss=0.077916 lr=3.806286e-08 lr_backbone=3.806286e-08 elapsed=50:28:49 avg_step=3.68s recent_step=2.94s eta=00:36:10
|
| 4952 |
+
2026-09-25 19:42:43 | INFO | train rank=0 | step=49420/50000 progress=98.8% loss=0.105731 lr=3.678369e-08 lr_backbone=3.678369e-08 elapsed=50:29:27 avg_step=3.68s recent_step=3.80s eta=00:35:33
|
| 4953 |
+
2026-09-25 19:43:16 | INFO | train rank=0 | step=49430/50000 progress=98.9% loss=0.071396 lr=3.552637e-08 lr_backbone=3.552637e-08 elapsed=50:30:00 avg_step=3.68s recent_step=3.27s eta=00:34:56
|
| 4954 |
+
2026-09-25 19:44:02 | INFO | train rank=0 | step=49440/50000 progress=98.9% loss=0.067300 lr=3.429090e-08 lr_backbone=3.429090e-08 elapsed=50:30:47 avg_step=3.68s recent_step=4.69s eta=00:34:19
|
| 4955 |
+
2026-09-25 19:44:30 | INFO | train rank=0 | step=49450/50000 progress=98.9% loss=0.079613 lr=3.307730e-08 lr_backbone=3.307730e-08 elapsed=50:31:15 avg_step=3.68s recent_step=2.80s eta=00:33:42
|
| 4956 |
+
2026-09-25 19:45:08 | INFO | train rank=0 | step=49460/50000 progress=98.9% loss=0.090951 lr=3.188555e-08 lr_backbone=3.188555e-08 elapsed=50:31:52 avg_step=3.68s recent_step=3.72s eta=00:33:06
|
| 4957 |
+
2026-09-25 19:45:41 | INFO | train rank=0 | step=49470/50000 progress=98.9% loss=0.107706 lr=3.071566e-08 lr_backbone=3.071566e-08 elapsed=50:32:25 avg_step=3.68s recent_step=3.30s eta=00:32:29
|
| 4958 |
+
2026-09-25 19:46:21 | INFO | train rank=0 | step=49480/50000 progress=99.0% loss=0.143258 lr=2.956762e-08 lr_backbone=2.956762e-08 elapsed=50:33:05 avg_step=3.68s recent_step=4.02s eta=00:31:52
|
| 4959 |
+
2026-09-25 19:46:57 | INFO | train rank=0 | step=49490/50000 progress=99.0% loss=0.075345 lr=2.844145e-08 lr_backbone=2.844145e-08 elapsed=50:33:41 avg_step=3.68s recent_step=3.56s eta=00:31:15
|
| 4960 |
+
2026-09-25 19:47:24 | INFO | train rank=0 | step=49500/50000 progress=99.0% loss=0.084145 lr=2.733713e-08 lr_backbone=2.733713e-08 elapsed=50:34:08 avg_step=3.68s recent_step=2.73s eta=00:30:38
|
| 4961 |
+
2026-09-25 19:48:07 | INFO | train rank=0 | step=49510/50000 progress=99.0% loss=0.089255 lr=2.625468e-08 lr_backbone=2.625468e-08 elapsed=50:34:51 avg_step=3.68s recent_step=4.33s eta=00:30:02
|
| 4962 |
+
2026-09-25 19:48:41 | INFO | train rank=0 | step=49520/50000 progress=99.0% loss=0.068525 lr=2.519408e-08 lr_backbone=2.519408e-08 elapsed=50:35:25 avg_step=3.68s recent_step=3.37s eta=00:29:25
|
| 4963 |
+
2026-09-25 19:49:16 | INFO | train rank=0 | step=49530/50000 progress=99.1% loss=0.071858 lr=2.415535e-08 lr_backbone=2.415535e-08 elapsed=50:36:00 avg_step=3.68s recent_step=3.52s eta=00:28:48
|
| 4964 |
+
2026-09-25 19:50:10 | INFO | train rank=0 | step=49540/50000 progress=99.1% loss=0.073557 lr=2.313847e-08 lr_backbone=2.313847e-08 elapsed=50:36:54 avg_step=3.68s recent_step=5.40s eta=00:28:11
|
| 4965 |
+
2026-09-25 19:50:44 | INFO | train rank=0 | step=49550/50000 progress=99.1% loss=0.104657 lr=2.214346e-08 lr_backbone=2.214346e-08 elapsed=50:37:28 avg_step=3.68s recent_step=3.40s eta=00:27:35
|
| 4966 |
+
2026-09-25 19:51:15 | INFO | train rank=0 | step=49560/50000 progress=99.1% loss=0.063693 lr=2.117031e-08 lr_backbone=2.117031e-08 elapsed=50:37:59 avg_step=3.68s recent_step=3.13s eta=00:26:58
|
| 4967 |
+
2026-09-25 19:51:53 | INFO | train rank=0 | step=49570/50000 progress=99.1% loss=0.073804 lr=2.021902e-08 lr_backbone=2.021902e-08 elapsed=50:38:37 avg_step=3.68s recent_step=3.78s eta=00:26:21
|
| 4968 |
+
2026-09-25 19:52:29 | INFO | train rank=0 | step=49580/50000 progress=99.2% loss=0.081224 lr=1.928960e-08 lr_backbone=1.928960e-08 elapsed=50:39:13 avg_step=3.68s recent_step=3.62s eta=00:25:44
|
| 4969 |
+
2026-09-25 19:53:12 | INFO | train rank=0 | step=49590/50000 progress=99.2% loss=0.090444 lr=1.838204e-08 lr_backbone=1.838204e-08 elapsed=50:39:56 avg_step=3.68s recent_step=4.31s eta=00:25:08
|
| 4970 |
+
2026-09-25 19:53:47 | INFO | train rank=0 | step=49600/50000 progress=99.2% loss=0.084460 lr=1.749634e-08 lr_backbone=1.749634e-08 elapsed=50:40:31 avg_step=3.68s recent_step=3.47s eta=00:24:31
|
| 4971 |
+
2026-09-25 19:54:18 | INFO | train rank=0 | step=49610/50000 progress=99.2% loss=0.081566 lr=1.663251e-08 lr_backbone=1.663251e-08 elapsed=50:41:02 avg_step=3.68s recent_step=3.10s eta=00:23:54
|
| 4972 |
+
2026-09-25 19:54:52 | INFO | train rank=0 | step=49620/50000 progress=99.2% loss=0.106247 lr=1.579054e-08 lr_backbone=1.579054e-08 elapsed=50:41:36 avg_step=3.68s recent_step=3.36s eta=00:23:17
|
| 4973 |
+
2026-09-25 19:55:34 | INFO | train rank=0 | step=49630/50000 progress=99.3% loss=0.069315 lr=1.497043e-08 lr_backbone=1.497043e-08 elapsed=50:42:18 avg_step=3.68s recent_step=4.24s eta=00:22:40
|
| 4974 |
+
2026-09-25 19:56:03 | INFO | train rank=0 | step=49640/50000 progress=99.3% loss=0.073461 lr=1.417219e-08 lr_backbone=1.417219e-08 elapsed=50:42:47 avg_step=3.68s recent_step=2.88s eta=00:22:04
|
| 4975 |
+
2026-09-25 19:56:37 | INFO | train rank=0 | step=49650/50000 progress=99.3% loss=0.081245 lr=1.339582e-08 lr_backbone=1.339582e-08 elapsed=50:43:21 avg_step=3.68s recent_step=3.38s eta=00:21:27
|
| 4976 |
+
2026-09-25 19:57:14 | INFO | train rank=0 | step=49660/50000 progress=99.3% loss=0.089245 lr=1.264131e-08 lr_backbone=1.264131e-08 elapsed=50:43:58 avg_step=3.68s recent_step=3.72s eta=00:20:50
|
| 4977 |
+
2026-09-25 19:57:53 | INFO | train rank=0 | step=49670/50000 progress=99.3% loss=0.117469 lr=1.190867e-08 lr_backbone=1.190867e-08 elapsed=50:44:37 avg_step=3.68s recent_step=3.91s eta=00:20:13
|
| 4978 |
+
2026-09-25 19:58:27 | INFO | train rank=0 | step=49680/50000 progress=99.4% loss=0.088088 lr=1.119789e-08 lr_backbone=1.119789e-08 elapsed=50:45:11 avg_step=3.68s recent_step=3.37s eta=00:19:36
|
| 4979 |
+
2026-09-25 19:58:58 | INFO | train rank=0 | step=49690/50000 progress=99.4% loss=0.089639 lr=1.050898e-08 lr_backbone=1.050898e-08 elapsed=50:45:42 avg_step=3.68s recent_step=3.10s eta=00:19:00
|
| 4980 |
+
2026-09-25 19:59:49 | INFO | train rank=0 | step=49700/50000 progress=99.4% loss=0.075313 lr=9.841942e-09 lr_backbone=9.841942e-09 elapsed=50:46:33 avg_step=3.68s recent_step=5.11s eta=00:18:23
|
| 4981 |
+
2026-09-25 20:00:22 | INFO | train rank=0 | step=49710/50000 progress=99.4% loss=0.074142 lr=9.196768e-09 lr_backbone=9.196768e-09 elapsed=50:47:06 avg_step=3.68s recent_step=3.35s eta=00:17:46
|
| 4982 |
+
2026-09-25 20:00:55 | INFO | train rank=0 | step=49720/50000 progress=99.4% loss=0.073637 lr=8.573461e-09 lr_backbone=8.573461e-09 elapsed=50:47:39 avg_step=3.68s recent_step=3.21s eta=00:17:09
|
| 4983 |
+
2026-09-25 20:01:25 | INFO | train rank=0 | step=49730/50000 progress=99.5% loss=0.069800 lr=7.972023e-09 lr_backbone=7.972023e-09 elapsed=50:48:09 avg_step=3.68s recent_step=3.00s eta=00:16:32
|
| 4984 |
+
2026-09-25 20:02:07 | INFO | train rank=0 | step=49740/50000 progress=99.5% loss=0.093147 lr=7.392452e-09 lr_backbone=7.392452e-09 elapsed=50:48:51 avg_step=3.68s recent_step=4.27s eta=00:15:56
|
| 4985 |
+
2026-09-25 20:02:44 | INFO | train rank=0 | step=49750/50000 progress=99.5% loss=0.107104 lr=6.834750e-09 lr_backbone=6.834750e-09 elapsed=50:49:28 avg_step=3.68s recent_step=3.66s eta=00:15:19
|
| 4986 |
+
2026-09-25 20:03:16 | INFO | train rank=0 | step=49760/50000 progress=99.5% loss=0.095656 lr=6.298917e-09 lr_backbone=6.298917e-09 elapsed=50:50:00 avg_step=3.68s recent_step=3.25s eta=00:14:42
|
| 4987 |
+
2026-09-25 20:03:52 | INFO | train rank=0 | step=49770/50000 progress=99.5% loss=0.085987 lr=5.784953e-09 lr_backbone=5.784953e-09 elapsed=50:50:36 avg_step=3.68s recent_step=3.53s eta=00:14:05
|
| 4988 |
+
2026-09-25 20:04:32 | INFO | train rank=0 | step=49780/50000 progress=99.6% loss=0.080097 lr=5.292858e-09 lr_backbone=5.292858e-09 elapsed=50:51:16 avg_step=3.68s recent_step=4.08s eta=00:13:29
|
| 4989 |
+
2026-09-25 20:05:18 | INFO | train rank=0 | step=49790/50000 progress=99.6% loss=0.083404 lr=4.822632e-09 lr_backbone=4.822632e-09 elapsed=50:52:02 avg_step=3.68s recent_step=4.52s eta=00:12:52
|
| 4990 |
+
2026-09-25 20:05:42 | INFO | train rank=0 | step=49800/50000 progress=99.6% loss=0.085078 lr=4.374276e-09 lr_backbone=4.374276e-09 elapsed=50:52:26 avg_step=3.68s recent_step=2.48s eta=00:12:15
|
| 4991 |
+
2026-09-25 20:06:08 | INFO | train rank=0 | step=49810/50000 progress=99.6% loss=0.075398 lr=3.947790e-09 lr_backbone=3.947790e-09 elapsed=50:52:52 avg_step=3.68s recent_step=2.60s eta=00:11:38
|
| 4992 |
+
2026-09-25 20:06:49 | INFO | train rank=0 | step=49820/50000 progress=99.6% loss=0.100558 lr=3.543173e-09 lr_backbone=3.543173e-09 elapsed=50:53:33 avg_step=3.68s recent_step=4.01s eta=00:11:01
|
| 4993 |
+
2026-09-25 20:07:43 | INFO | train rank=0 | step=49830/50000 progress=99.7% loss=0.078447 lr=3.160427e-09 lr_backbone=3.160427e-09 elapsed=50:54:27 avg_step=3.68s recent_step=5.44s eta=00:10:25
|
| 4994 |
+
2026-09-25 20:08:19 | INFO | train rank=0 | step=49840/50000 progress=99.7% loss=0.084698 lr=2.799551e-09 lr_backbone=2.799551e-09 elapsed=50:55:03 avg_step=3.68s recent_step=3.60s eta=00:09:48
|
| 4995 |
+
2026-09-25 20:08:48 | INFO | train rank=0 | step=49850/50000 progress=99.7% loss=0.085543 lr=2.460546e-09 lr_backbone=2.460546e-09 elapsed=50:55:32 avg_step=3.68s recent_step=2.95s eta=00:09:11
|
| 4996 |
+
2026-09-25 20:09:27 | INFO | train rank=0 | step=49860/50000 progress=99.7% loss=0.091802 lr=2.143411e-09 lr_backbone=2.143411e-09 elapsed=50:56:11 avg_step=3.68s recent_step=3.89s eta=00:08:34
|
| 4997 |
+
2026-09-25 20:10:13 | INFO | train rank=0 | step=49870/50000 progress=99.7% loss=0.077836 lr=1.848147e-09 lr_backbone=1.848147e-09 elapsed=50:56:57 avg_step=3.68s recent_step=4.52s eta=00:07:58
|
| 4998 |
+
2026-09-25 20:10:50 | INFO | train rank=0 | step=49880/50000 progress=99.8% loss=0.076599 lr=1.574754e-09 lr_backbone=1.574754e-09 elapsed=50:57:34 avg_step=3.68s recent_step=3.73s eta=00:07:21
|
| 4999 |
+
2026-09-25 20:11:27 | INFO | train rank=0 | step=49890/50000 progress=99.8% loss=0.073930 lr=1.323232e-09 lr_backbone=1.323232e-09 elapsed=50:58:11 avg_step=3.68s recent_step=3.76s eta=00:06:44
|
| 5000 |
+
2026-09-25 20:11:57 | INFO | train rank=0 | step=49900/50000 progress=99.8% loss=0.109948 lr=1.093581e-09 lr_backbone=1.093581e-09 elapsed=50:58:41 avg_step=3.68s recent_step=2.97s eta=00:06:07
|
| 5001 |
+
2026-09-25 20:12:38 | INFO | train rank=0 | step=49910/50000 progress=99.8% loss=0.064395 lr=8.858012e-10 lr_backbone=8.858012e-10 elapsed=50:59:22 avg_step=3.68s recent_step=4.08s eta=00:05:31
|
| 5002 |
+
2026-09-25 20:13:09 | INFO | train rank=0 | step=49920/50000 progress=99.8% loss=0.097854 lr=6.998928e-10 lr_backbone=6.998928e-10 elapsed=50:59:53 avg_step=3.68s recent_step=3.09s eta=00:04:54
|
| 5003 |
+
2026-09-25 20:13:34 | INFO | train rank=0 | step=49930/50000 progress=99.9% loss=0.075287 lr=5.358557e-10 lr_backbone=5.358557e-10 elapsed=51:00:18 avg_step=3.68s recent_step=2.48s eta=00:04:17
|
| 5004 |
+
2026-09-25 20:13:59 | INFO | train rank=0 | step=49940/50000 progress=99.9% loss=0.083422 lr=3.936901e-10 lr_backbone=3.936901e-10 elapsed=51:00:43 avg_step=3.68s recent_step=2.50s eta=00:03:40
|
| 5005 |
+
2026-09-25 20:14:25 | INFO | train rank=0 | step=49950/50000 progress=99.9% loss=0.110091 lr=2.733960e-10 lr_backbone=2.733960e-10 elapsed=51:01:09 avg_step=3.68s recent_step=2.63s eta=00:03:03
|
| 5006 |
+
2026-09-25 20:14:45 | INFO | train rank=0 | step=49960/50000 progress=99.9% loss=0.101113 lr=1.749735e-10 lr_backbone=1.749735e-10 elapsed=51:01:29 avg_step=3.68s recent_step=1.99s eta=00:02:27
|
| 5007 |
+
2026-09-25 20:15:09 | INFO | train rank=0 | step=49970/50000 progress=99.9% loss=0.079323 lr=9.842262e-11 lr_backbone=9.842262e-11 elapsed=51:01:53 avg_step=3.68s recent_step=2.42s eta=00:01:50
|
| 5008 |
+
2026-09-25 20:15:31 | INFO | train rank=0 | step=49980/50000 progress=100.0% loss=0.101932 lr=4.374339e-11 lr_backbone=4.374339e-11 elapsed=51:02:15 avg_step=3.68s recent_step=2.24s eta=00:01:13
|
| 5009 |
+
2026-09-25 20:15:57 | INFO | train rank=0 | step=49990/50000 progress=100.0% loss=0.073451 lr=1.093585e-11 lr_backbone=1.093585e-11 elapsed=51:02:41 avg_step=3.68s recent_step=2.54s eta=00:00:36
|
| 5010 |
+
2026-09-25 20:16:17 | INFO | train rank=0 | step=50000/50000 progress=100.0% loss=0.087691 lr=0.000000e+00 lr_backbone=0.000000e+00 elapsed=51:03:01 avg_step=3.68s recent_step=1.98s eta=00:00:00
|
| 5011 |
+
2026-09-25 20:16:55 | INFO | train rank=0 | Saved DeepSpeed checkpoint to /data/NTU_slab/draven/checkpoints/codebase/codebase_v8_droid/joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_50000
|
| 5012 |
+
2026-09-25 20:16:55 | INFO | train rank=0 | Finished training final_step=50000/50000 elapsed=51:03:39 avg_step=3.68s
|
| 5013 |
+
2026-09-25 20:16:55 | INFO | train rank=0 | Training finished
|
| 5014 |
+
2026-09-25 20:17:26 | INFO | train rank=0 | Saved final DeepSpeed checkpoint to /data/NTU_slab/draven/checkpoints/codebase/codebase_v8_droid/joint_50ksteps_bs128_qwen3vl2b_no_aug_tight_end_padding_mask_chunk16/ds_checkpoint_final
|