mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-05 08:37:06 +08:00
[docs] Update environment variables documentation (#3957)
Some checks failed
CE Compile Job / ce_job_pre_check (push) Has been cancelled
CE Compile Job / print_ce_job_pre_check_outputs (push) Has been cancelled
CE Compile Job / FD-Clone-Linux (push) Has been cancelled
CE Compile Job / Show Code Archive Output (push) Has been cancelled
CE Compile Job / BUILD_SM8090 (push) Has been cancelled
CE Compile Job / BUILD_SM8689 (push) Has been cancelled
CE Compile Job / CE_UPLOAD (push) Has been cancelled
Deploy GitHub Pages / deploy (push) Has been cancelled
Some checks failed
CE Compile Job / ce_job_pre_check (push) Has been cancelled
CE Compile Job / print_ce_job_pre_check_outputs (push) Has been cancelled
CE Compile Job / FD-Clone-Linux (push) Has been cancelled
CE Compile Job / Show Code Archive Output (push) Has been cancelled
CE Compile Job / BUILD_SM8090 (push) Has been cancelled
CE Compile Job / BUILD_SM8689 (push) Has been cancelled
CE Compile Job / CE_UPLOAD (push) Has been cancelled
Deploy GitHub Pages / deploy (push) Has been cancelled
This commit is contained in:
@@ -79,7 +79,7 @@ def is_weight_cache_enabled(fd_config, weight_cache_path=".cache"):
|
||||
weight_cache_context = contextlib.nullcontext()
|
||||
weight_cache_dir = None
|
||||
enable_cache = False
|
||||
if envs.FD_ENABLE_MODEL_CACHE:
|
||||
if envs.FD_ENABLE_MODEL_LOAD_CACHE:
|
||||
model_weight_cache_path = os.path.join(fd_config.model_config.model, weight_cache_path)
|
||||
# model_type + quantization + tp_size + ep_size
|
||||
weight_cache_key = "_".join(
|
||||
@@ -132,7 +132,11 @@ def save_model(model_arg_name="model", config_arg_name="fd_config"):
|
||||
|
||||
with context:
|
||||
result = func(*args, **kwargs)
|
||||
if envs.FD_ENABLE_MODEL_CACHE and weight_cache_dir is not None and not os.path.exists(weight_cache_dir):
|
||||
if (
|
||||
envs.FD_ENABLE_MODEL_LOAD_CACHE
|
||||
and weight_cache_dir is not None
|
||||
and not os.path.exists(weight_cache_dir)
|
||||
):
|
||||
assert fd_config.quant_config is not None and getattr(
|
||||
fd_config.quant_config, "is_checkpoint_bf16", False
|
||||
), "Save cache only for dynamic quantization"
|
||||
|
Reference in New Issue
Block a user