base.sh 2.04 KB
Newer Older
helloyongyang's avatar
helloyongyang committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

if [ -z "${lightx2v_path}" ]; then
    echo "Error: lightx2v_path is not set. Please set this variable first."
    exit 1
fi

if [ -z "${model_path}" ]; then
    echo "Error: model_path is not set. Please set this variable first."
    exit 1
fi

export PYTHONPATH=${lightx2v_path}:$PYTHONPATH

# always set false to avoid some warnings
export TOKENIZERS_PARALLELISM=false
Yang Yong (雍洋)'s avatar
Yang Yong (雍洋) committed
17
18
# set expandable_segments to True to avoid OOM
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
helloyongyang's avatar
helloyongyang committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

# =====================================================================================
# ⚠️  IMPORTANT CONFIGURATION PARAMETERS - READ CAREFULLY AND MODIFY WITH CAUTION ⚠️
# =====================================================================================

# Model Inference Data Type Setting (IMPORTANT!)
# Key parameter affecting model accuracy and performance
# Available options: [BF16, FP16]
# If not set, default value: BF16
export DTYPE=BF16

# Sensitive Layer Data Type Setting (IMPORTANT!)
# Used for layers requiring higher precision
# Available options: [FP32, None]
# If not set, default value: None (follows DTYPE setting)
34
export SENSITIVE_LAYER_DTYPE=None
helloyongyang's avatar
helloyongyang committed
35

36
# Performance Profiling Debug Level (Debug Only)
helloyongyang's avatar
helloyongyang committed
37
# Enables detailed performance analysis output, such as time cost and memory usage
38
39
40
41
# Available options: [0, 1, 2]
# If not set, default value: 0
# Note: This option can be set to 0 for production.
export PROFILING_DEBUG_LEVEL=2
helloyongyang's avatar
helloyongyang committed
42
43
44


echo "==============================================================================="
45
echo "LightX2V Base Environment Variables Summary:"
helloyongyang's avatar
helloyongyang committed
46
47
48
49
50
51
echo "-------------------------------------------------------------------------------"
echo "lightx2v_path: ${lightx2v_path}"
echo "model_path: ${model_path}"
echo "-------------------------------------------------------------------------------"
echo "Model Inference Data Type: ${DTYPE}"
echo "Sensitive Layer Data Type: ${SENSITIVE_LAYER_DTYPE}"
52
echo "Performance Profiling Debug Level: ${PROFILING_DEBUG_LEVEL}"
helloyongyang's avatar
helloyongyang committed
53
echo "==============================================================================="