Skip to content

Commit

Permalink
update files
Browse files Browse the repository at this point in the history
  • Loading branch information
DesmonDay committed Oct 25, 2024
1 parent b219ba6 commit 30fe038
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 17 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
except:
core = None

Check warning on line 36 in paddlenlp/trainer/unified_checkpoint/check_completion.py

View check run for this annotation

Codecov / codecov/patch

paddlenlp/trainer/unified_checkpoint/check_completion.py#L35-L36

Added lines #L35 - L36 were not covered by tests

from .uc_utils import (
from .utils import (
get_expected_state_dict,
is_sharding_split_param_mode,
select_model_weight_index,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
else:
from paddlenlp.utils.safetensors import fast_safe_open as safe_open

from .uc_utils import (
from .utils import (
FP32_MASTER,
get_expected_state_dict,
mapping_optimizer_tp_actions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
from paddlenlp.utils.log import logger
from paddlenlp.utils.nested import nested_copy

from .uc_sharding_v2 import load_unified_optimizer_split_param
from .uc_utils import (
from .sharding_split_param_utils import load_unified_optimizer_split_param
from .utils import (
FP32_MASTER,
get_expected_keys,
get_expected_state_dict,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
if is_safetensors_available():
from safetensors.numpy import save_file as safe_save_file

from .uc_utils import (
from .utils import (
FP32_MASTER,
generate_base_static_name,
get_expected_state_dict,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
)
from paddlenlp.utils.nested import nested_copy

from .uc_utils import (
from .utils import (
FP32_MASTER,
generate_base_static_name,
get_expected_state_dict,
Expand Down
17 changes: 7 additions & 10 deletions paddlenlp/trainer/unified_checkpoint/unified_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,21 @@
else:
from paddlenlp.utils.safetensors import fast_load_file as load_file

from .async_uc_hander import AsyncCheckpointHander
from .check_uc import check_unified_checkpoint, check_unified_optimizer
from .uc_dynamic import (
from .async_handler import AsyncCheckpointHander
from .check_completion import check_unified_checkpoint, check_unified_optimizer
from .load_dynamic import (
load_unified_checkpoint_dynamically,
load_unified_optimizer_dynamically,
)
from .uc_locally_load import (
load_unified_checkpoint_locally,
load_unified_optimizer_locally,
)
from .uc_sharding_v2 import gather_splited_param_for_optimizer
from .uc_single_card import (
from .load_local import load_unified_checkpoint_locally, load_unified_optimizer_locally
from .load_save_single_card import (
load_single_card_checkpoint,
load_single_card_optimizer,
save_single_card_checkpoint,
save_single_card_optimizer,
)
from .uc_utils import (
from .sharding_split_param_utils import gather_splited_param_for_optimizer
from .utils import (
FP32_MASTER,
UnifiedCheckpointOption,
filter_params,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/trainer/test_unified_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import numpy as np
import pytest

from paddlenlp.trainer.plugins.unified_checkpoint import UnifiedCheckpointOption
from paddlenlp.trainer.unified_checkpoint.utils import UnifiedCheckpointOption
from tests.parallel_launch import TestMultipleGpus
from tests.testing_utils import (
require_paddle_at_least_2_gpu,
Expand Down

0 comments on commit 30fe038

Please sign in to comment.