Unverified Commit f21da849 authored by Yang Yong (雍洋)'s avatar Yang Yong (雍洋) Committed by GitHub
Browse files
parent 3efc43f5
......@@ -8,7 +8,6 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -8,7 +8,6 @@ export CUDA_VISIBLE_DEVICES=0
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -8,7 +8,6 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -8,7 +8,6 @@ export CUDA_VISIBLE_DEVICES=0
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -8,7 +8,6 @@ export CUDA_VISIBLE_DEVICES=0
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -8,7 +8,6 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -9,7 +9,6 @@ export CUDA_VISIBLE_DEVICES=0
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -9,7 +9,6 @@ export CUDA_VISIBLE_DEVICES=0
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -8,7 +8,6 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -8,7 +8,6 @@ export CUDA_VISIBLE_DEVICES=0
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -8,7 +8,6 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -8,7 +8,6 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export SENSITIVE_LAYER_DTYPE=None
......
......@@ -5,7 +5,6 @@ lightx2v_path=
model_path=
export CUDA_VISIBLE_DEVICES=0
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
# set environment variables
source ${lightx2v_path}/scripts/base/base.sh
export DTYPE=FP16
......
......@@ -800,7 +800,7 @@ def main():
parser.add_argument(
"-t",
"--model_type",
choices=["wan_dit", "hunyuan_dit", "wan_t5", "wan_clip", "wan_animate_dit", "qwen_image_dit"],
choices=["wan_dit", "hunyuan_dit", "wan_t5", "wan_clip", "wan_animate_dit", "qwen_image_dit", "qwen25vl_llm"],
default="wan_dit",
help="Model type",
)
......@@ -897,16 +897,17 @@ def main():
"key_idx": 2,
"target_keys": [
"img_mod",
"img_attn_qkv",
"img_attn_q",
"img_attn_k",
"img_attn_v",
"img_attn_proj",
"img_mlp",
"txt_mod",
"txt_attn_qkv",
"txt_attn_q",
"txt_attn_k",
"txt_attn_v",
"txt_attn_proj",
"txt_mlp",
"linear1",
"linear2",
"modulation",
],
"ignore_key": None,
},
......@@ -914,7 +915,12 @@ def main():
"wan_clip": {
"key_idx": 3,
"target_keys": ["attn", "mlp"],
"ignore_key": "textual",
"ignore_key": ["textual"],
},
"qwen25vl_llm": {
"key_idx": 3,
"target_keys": ["self_attn", "mlp"],
"ignore_key": ["visual"],
},
}
......
......@@ -14,6 +14,7 @@ A powerful model weight conversion tool that supports format conversion, quantiz
## Supported Model Types
- `hunyuan_dit`: hunyuan DiT 1.5 models
- `wan_dit`: Wan DiT series models (default)
- `wan_animate_dit`: Wan Animate DiT models
- `qwen_image_dit`: Qwen Image DiT models
......@@ -242,6 +243,38 @@ python converter.py \
--quantized
```
#### 1.5 Qwen25_vl llm Quantization
**INT8 Quantization**
```bash
python converter.py \
--source /path/to/hunyuanvideo-1.5/text_encoder/llm \
--output /path/to/output \
--output_ext .safetensors \
--output_name qwen25vl-llm-int8 \
--linear_dtype torch.int8 \
--non_linear_dtype torch.float16 \
--model_type qwen25vl_llm \
--quantized \
--single_file
```
**FP8 Quantization**
```bash
python converter.py \
--source /path/to/hunyuanvideo-1.5/text_encoder/llm \
--output /path/to/output \
--output_ext .safetensors \
--output_name qwen25vl-llm-fp8 \
--linear_dtype torch.float8_e4m3fn \
--non_linear_dtype torch.float16 \
--model_type qwen25vl_llm \
--quantized \
--single_file
```
### 2. LoRA Merging
#### 2.1 Merge Single LoRA
......
......@@ -14,6 +14,7 @@
## 支持的模型类型
- `hunyuan_dit`: hunyuan DiT 1.5模型
- `wan_dit`: Wan DiT 系列模型(默认)
- `wan_animate_dit`: Wan Animate DiT 模型
- `qwen_image_dit`: Qwen Image DiT 模型
......@@ -242,6 +243,36 @@ python converter.py \
--quantized
```
#### 1.5 Qwen25_vl 語言部分量化
**INT8 量化**
```bash
python converter.py \
--source /path/to/hunyuanvideo-1.5/text_encoder/llm \
--output /path/to/output \
--output_ext .safetensors \
--output_name qwen25vl-llm-int8 \
--linear_dtype torch.int8 \
--non_linear_dtype torch.float16 \
--model_type qwen25vl_llm \
--quantized \
--single_file
```
**FP8 量化**
```bash
python converter.py \
--source /path/to/hunyuanvideo-1.5/text_encoder/llm \
--output /path/to/output \
--output_ext .safetensors \
--output_name qwen25vl-llm-fp8 \
--linear_dtype torch.float8_e4m3fn \
--non_linear_dtype torch.float16 \
--model_type qwen25vl_llm \
--quantized \
--single_file
```
### 2. LoRA 融合
#### 2.1 融合单个 LoRA
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment