Support weight loading without mmap (#7469)

This commit is contained in:
Yuhong Guo
2025-06-24 06:13:59 +08:00
committed by GitHub
parent e5ddeb04d5
commit e5afb88b1c
4 changed files with 21 additions and 2 deletions

View File

@@ -237,6 +237,7 @@ class ServerArgs:
# For model weight update
custom_weight_loader: Optional[List[str]] = None
weight_loader_disable_mmap: bool = False
def __post_init__(self):
# Expert parallelism
@@ -1599,6 +1600,11 @@ class ServerArgs:
default=None,
help="The custom dataloader which used to update the model. Should be set with a valid import path, such as my_package.weight_load_func",
)
parser.add_argument(
"--weight-loader-disable-mmap",
action="store_true",
help="Disable mmap while loading weight using safetensors.",
)
@classmethod
def from_cli_args(cls, args: argparse.Namespace):