LightX2V icon indicating copy to clipboard operation
LightX2V copied to clipboard

flashinfer relevant error when run_hy15_i2v_720p.sh

Open tianlan-ltd opened this issue 1 month ago • 2 comments

./scripts/hunyuan_video_15/run_hy15_i2v_720p.sh

LightX2V Base Environment Variables Summary:

lightx2v_path: /root/autodl-tmp/LightX2V model_path: /root/autodl-tmp/HunyuanVideo-1.5/ckpts

Model Inference Data Type: BF16 Sensitive Layer Data Type: None Performance Profiling Debug Level: 2

2025-12-02 00:20:35.624 | INFO | lightx2v.models.networks.hunyuan_video.infer.attn_no_pad::11 - flash_attn_varlen_func_v3 not available 2025-12-02 00:20:35.666 | INFO | lightx2v.models.networks.hunyuan_video.infer.attn_no_pad::29 - sageattn3 not found, please install sageattention first 2025-12-02 00:20:36.313 | INFO | lightx2v.common.ops.attn.flash_attn::15 - flash_attn_varlen_func_v3 not found, please install flash_attn3 first 2025-12-02 00:20:36.313 | INFO | lightx2v.common.ops.attn.flash_attn::21 - torch_mlu_ops not found. 2025-12-02 00:20:36.323 | INFO | lightx2v.common.ops.attn.sage_attn::26 - sageattn3 not found, please install sageattention first 2025-12-02 00:20:36.323 | INFO | lightx2v.common.ops.attn.sage_attn::33 - torch_mlu_ops not found. 2025-12-02 00:20:36.632 | WARNING | lightx2v.utils.quant_utils::7 - qtorch not found, please install qtorch.Please install qtorch (pip install qtorch). 2025-12-02 00:20:36.712 | INFO | lightx2v.utils.set_config:set_config:41 - Loading some config from /root/autodl-tmp/LightX2V/configs/hunyuan_video_15/hunyuan_video_i2v_720p.json 2025-12-02 00:20:36.712 | INFO | lightx2v.utils.set_config:print_config:115 - config: { "do_mm_calib": false, "cpu_offload": false, "max_area": false, "vae_stride": [ 4, 16, 16 ], "patch_size": [ 1, 1, 1 ], "feature_caching": "NoCaching", "teacache_thresh": 0.26, "use_ret_steps": false, "use_bfloat16": true, "lora_configs": null, "use_prompt_enhancer": false, "parallel": false, "seq_parallel": false, "cfg_parallel": false, "enable_cfg": true, "use_image_encoder": true, "model_cls": "hunyuan_video_1.5", "task": "i2v", "model_path": "/root/autodl-tmp/HunyuanVideo-1.5/ckpts", "sf_model_path": null, "config_json": "/root/autodl-tmp/LightX2V/configs/hunyuan_video_15/hunyuan_video_i2v_720p.json", "infer_steps": 50, "transformer_model_name": "720p_i2v", "fps": 24, "target_video_length": 121, "sample_shift": 7.0, "sample_guide_scale": 6.0, "attn_type": "sage_attn2", "transformer_model_path": "/root/autodl-tmp/HunyuanVideo-1.5/ckpts/transformer/720p_i2v", "_class_name": "HunyuanVideo_1_5_DiffusionTransformer", "_diffusers_version": "0.35.0", "attn_mode": "flash", "attn_param": null, "concat_condition": true, "glyph_byT5_v2": true, "guidance_embed": false, "heads_num": 16, "hidden_size": 2048, "ideal_resolution": "720p", "ideal_task": "i2v", "in_channels": 32, "is_reshape_temporal_channels": false, "mlp_act_type": "gelu_tanh", "mlp_width_ratio": 4, "mm_double_blocks_depth": 54, "mm_single_blocks_depth": 0, "out_channels": 32, "qk_norm": true, "qk_norm_type": "rms", "qkv_bias": true, "rope_dim_list": [ 16, 56, 56 ], "rope_theta": 256, "text_pool_type": null, "text_projection": "single_refiner", "text_states_dim": 3584, "text_states_dim_2": null, "use_attention_mask": true, "use_cond_type_embedding": true, "use_meanflow": false, "vision_projection": "linear", "vision_states_dim": 1152 } 2025-12-02 00:20:36.835 | INFO | lightx2v.models.runners.default_runner:init_modules:38 - Initializing runner modules... 2025-12-02 00:20:36.835 | INFO | lightx2v.utils.custom_compiler:_discover_compiled_methods:120 - [Compile] Discovering compiled methods for HunyuanVideo15Model... 2025-12-02 00:20:36.836 | INFO | lightx2v.models.networks.hunyuan_video.model:_load_ckpt:170 - Loading weights from /root/autodl-tmp/HunyuanVideo-1.5/ckpts/transformer/720p_i2v/diffusion_pytorch_model.safetensors 2025-12-02 00:20:42.585 | INFO | lightx2v.models.runners.hunyuan_video.hunyuan_video_15_runner:load_text_encoder:81 - Loading text encoder from /root/autodl-tmp/HunyuanVideo-1.5/ckpts/text_encoder/llm Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:01<00:00, 2.89it/s] 2025-12-02 00:20:51.140 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level2_Log Load models cost 14.304974 seconds 2025-12-02 00:20:51.412 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level1_Log Run Image Encoder cost 0.258388 seconds 2025-12-02 00:20:51.617 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level1_Log Run VAE Encoder cost 0.204709 seconds 2025-12-02 00:20:51.971 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level2_Log Run Encoders cost 0.829852 seconds 2025-12-02 00:20:51.978 | INFO | lightx2v.models.runners.default_runner:run_main:300 - 🔄 start segment 1/1 2025-12-02 00:20:51.979 | INFO | lightx2v.models.runners.default_runner:run_segment:150 - ==> step_index: 1 / 50 2025-12-02 00:20:51.979 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level1_Log step_pre cost 0.000009 seconds 2025-12-02 00:20:52.319 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level1_Log 🚀 infer_main cost 0.340484 seconds 2025-12-02 00:20:52.319 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level1_Log Run Dit every step cost 0.340732 seconds 2025-12-02 00:20:52.319 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level1_Log segment end2end 1/1 cost 0.340804 seconds 2025-12-02 00:20:52.319 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level2_Log Run DiT cost 0.348629 seconds 2025-12-02 00:20:52.319 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level1_Log RUN pipeline cost 1.178721 seconds 2025-12-02 00:20:52.319 | INFO | lightx2v.utils.profiler:exit:43 - [Profile] Single GPU - Level1_Log Total Cost cost 15.484251 seconds Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/root/autodl-tmp/LightX2V/lightx2v/infer.py", line 133, in main() File "/root/autodl-tmp/LightX2V/lightx2v/infer.py", line 124, in main runner.run_pipeline(input_info) File "/root/autodl-tmp/LightX2V/lightx2v/utils/profiler.py", line 77, in sync_wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/models/runners/default_runner.py", line 386, in run_pipeline gen_video_final = self.run_main() ^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/utils/profiler.py", line 77, in sync_wrapper return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/models/runners/default_runner.py", line 311, in run_main latents = self.run_segment(segment_idx) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/utils/memory_profiler.py", line 18, in wrapper result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/models/runners/default_runner.py", line 156, in run_segment self.model.infer(self.inputs) File "/root/miniconda3/envs/lightx2v/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/models/networks/hunyuan_video/model.py", line 226, in infer noise_pred_cond = self._infer_cond_uncond(inputs, infer_condition=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/lightx2v/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/models/networks/hunyuan_video/model.py", line 250, in _infer_cond_uncond x = self.transformer_infer.infer(self.transformer_weights, pre_infer_out) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/lightx2v/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/models/networks/hunyuan_video/infer/transformer_infer.py", line 126, in infer self.infer_func(weights, infer_module_out) File "/root/miniconda3/envs/lightx2v/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/models/networks/hunyuan_video/infer/transformer_infer.py", line 133, in infer_without_offload infer_module_out.img, infer_module_out.txt = self.infer_double_block(weights.double_blocks[i], infer_module_out) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/lightx2v/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/models/networks/hunyuan_video/infer/transformer_infer.py", line 146, in infer_double_block img_q, img_k, img_v, img_branch_out = self._infer_img_branch_before_attn(weights, infer_module_out) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/lightx2v/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 120, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/models/networks/hunyuan_video/infer/transformer_infer.py", line 173, in _infer_img_branch_before_attn img_q, img_k = self.apply_rope_func(img_q.unsqueeze(0), img_k.unsqueeze(0), cos_sin_cache=self.scheduler.cos_sin) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/autodl-tmp/LightX2V/lightx2v/models/networks/hunyuan_video/infer/transformer_infer.py", line 53, in apply_hunyuan_rope_with_flashinfer apply_rope_with_cos_sin_cache_inplace( TypeError: 'NoneType' object is not callable

tianlan-ltd avatar Dec 01 '25 16:12 tianlan-ltd

I meet this error too

Jingwei-Bao avatar Dec 14 '25 15:12 Jingwei-Bao

same with me. I've just installed flashinfer. But the problem could with the type of attention in the config. You could try to install different attention implementations and change type in the config, like sage_attn2/3 and flash_attn2

Tomas542 avatar Dec 22 '25 09:12 Tomas542