Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix CI
  • Loading branch information
ccilery committed Oct 21, 2025
commit bce3308887fdba259758a921532e4108a8e57da7
6 changes: 3 additions & 3 deletions verl/utils/checkpoint/megatron_checkpoint_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import logging
import os
import random
import transformer_engine
from collections.abc import Callable
from dataclasses import asdict

Expand All @@ -28,22 +29,21 @@
from transformers import GenerationConfig

# For load optimizer dist_ckpt
import transformer_engine
torch.serialization.add_safe_globals([torch.optim.AdamW])
torch.serialization.add_safe_globals([transformer_engine.pytorch.optimizers.fused_adam.FusedAdam])

from verl.models.weight_loader_registry import get_weight_saver

Check failure on line 35 in verl/utils/checkpoint/megatron_checkpoint_manager.py

View workflow job for this annotation

GitHub Actions / pre-commit (3.12)

Ruff (E402)

verl/utils/checkpoint/megatron_checkpoint_manager.py:35:1: E402 Module level import not at top of file
from verl.utils.device import get_device_name, get_torch_device

Check failure on line 36 in verl/utils/checkpoint/megatron_checkpoint_manager.py

View workflow job for this annotation

GitHub Actions / pre-commit (3.12)

Ruff (E402)

verl/utils/checkpoint/megatron_checkpoint_manager.py:36:1: E402 Module level import not at top of file
from verl.utils.fs import is_non_local, local_mkdir_safe

Check failure on line 37 in verl/utils/checkpoint/megatron_checkpoint_manager.py

View workflow job for this annotation

GitHub Actions / pre-commit (3.12)

Ruff (E402)

verl/utils/checkpoint/megatron_checkpoint_manager.py:37:1: E402 Module level import not at top of file
from verl.utils.logger import log_with_rank

Check failure on line 38 in verl/utils/checkpoint/megatron_checkpoint_manager.py

View workflow job for this annotation

GitHub Actions / pre-commit (3.12)

Ruff (E402)

verl/utils/checkpoint/megatron_checkpoint_manager.py:38:1: E402 Module level import not at top of file
from verl.utils.megatron.dist_checkpointing import load_dist_checkpointing, save_dist_checkpointing

Check failure on line 39 in verl/utils/checkpoint/megatron_checkpoint_manager.py

View workflow job for this annotation

GitHub Actions / pre-commit (3.12)

Ruff (E402)

verl/utils/checkpoint/megatron_checkpoint_manager.py:39:1: E402 Module level import not at top of file
from verl.utils.megatron_utils import (
get_dist_checkpoint_path,
get_hf_model_checkpoint_path,
get_transformer_config_checkpoint_path,
)

Check failure on line 44 in verl/utils/checkpoint/megatron_checkpoint_manager.py

View workflow job for this annotation

GitHub Actions / pre-commit (3.12)

Ruff (E402)

verl/utils/checkpoint/megatron_checkpoint_manager.py:40:1: E402 Module level import not at top of file

from .checkpoint_manager import BaseCheckpointManager

Check failure on line 46 in verl/utils/checkpoint/megatron_checkpoint_manager.py

View workflow job for this annotation

GitHub Actions / pre-commit (3.12)

Ruff (E402)

verl/utils/checkpoint/megatron_checkpoint_manager.py:46:1: E402 Module level import not at top of file

# Setup logging
logger = logging.getLogger(__file__)
Expand Down Expand Up @@ -240,7 +240,7 @@
generate_model: bool = True,
generate_optimizer: bool = True,
generate_extra: bool = True,
is_loading: bool = False
is_loading: bool = False,
):
# For save dist checkpointing
state_dict = {}
Expand Down Expand Up @@ -308,7 +308,7 @@
self.should_load_model and self.use_dist_checkpointing,
self.should_load_optimizer,
self.should_load_extra,
is_loading=True
is_loading=True,
)
log_with_rank(f"Generated state dict for loading: {sharded_state_dict.keys()}", rank=self.rank, logger=logger)

Expand Down
Loading