Skip to content

Wan support to skip compilation#734

Merged
quic-amitraj merged 12 commits intoquic:mainfrom
tv-karthikeya:wan_skip_compile
Jan 28, 2026
Merged

Wan support to skip compilation#734
quic-amitraj merged 12 commits intoquic:mainfrom
tv-karthikeya:wan_skip_compile

Conversation

@tv-karthikeya
Copy link
Contributor

Support to skip export, compilation if qpc already exists

  • Updated Flux, wan configs, pipelines with qpc_path changes

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
  - Updated export dim from 180p to 90p for wan
  - Updated flux, wan configs

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
@@ -304,9 +305,6 @@ def compile(
):
self.export(use_onnx_subfunctions=use_onnx_subfunctions)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How it will deal with the config file I will share with direct compile call?

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
custom_config_path: Optional[str] = None,
use_onnx_subfunctions: bool = False,
parallel_compile: bool = True,
skip_compile: bool = False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need



def set_module_device_ids(cls):
def set_module_device_ids_and_qpc_paths(cls):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rename this to set_execute_params? This name became so long and generic name gives us more flexiblity to add params in later stage.

latent_frames = constants.WAN_ONNX_EXPORT_LATENT_FRAMES
latent_height = constants.WAN_ONNX_EXPORT_LATENT_HEIGHT_180P
latent_width = constants.WAN_ONNX_EXPORT_LATENT_WIDTH_180P
latent_height = constants.WAN_ONNX_EXPORT_LATENT_HEIGHT_90P
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these changes? Any sepcific reason

4: "latent_width",
},
"timestep": {0: "steps"},
"encoder_hidden_states": {0: "batch_size", 1: "sequence_length"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

WAN_ONNX_EXPORT_HEIGHT_180P = 192
WAN_ONNX_EXPORT_WIDTH_180P = 320
# Wan dims for 90p
WAN_ONNX_EXPORT_CL_90P = 960 # for 16 latent frames
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these changes in this PR?

num_inference_steps=4,
generator=torch.manual_seed(0),
custom_config_path="examples/diffusers/wan/wan_config.json",
height=480,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why removed?

@tv-karthikeya
Copy link
Contributor Author

Reverted the changes done for 90p onnx export

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Copy link
Contributor

@quic-amitraj quic-amitraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets address these minor comments, and merge this on priority.

# Load compilation configuration
config_manager(self, config_source=compile_config, use_onnx_subfunctions=use_onnx_subfunctions)

# Set device IDs for all modules based on configuration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the comment as well.

Comment on lines 128 to 134
module_obj.qpc_path = config_modules[module_name]["execute"]["qpc_path"]
if module_obj.qpc_path:
if not os.path.exists(module_obj.qpc_path):
logger.warning(
f"Given qpc path: {module_obj.qpc_path} does not exist, considering {module_name} for compilation"
)
module_obj.qpc_path = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should throw error if qpc path is not correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment on lines 133 to 134
# When to use:
# - When you want to skip export, compile if you already had compiled qpc
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this line with this-> Use this when you want to skip export and compilation if you have already compiled QPC.

# When to use:
# - When you want to skip export, compile if you already had compiled qpc
#
# Changes needed in config.json: update qpc_path for each module
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update qpc_path of desired module

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Copy link
Contributor

@quic-amitraj quic-amitraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tv-karthikeya tv-karthikeya force-pushed the wan_skip_compile branch 2 times, most recently from bde6882 to 71d1c93 Compare January 27, 2026 17:39
 - added num layers fix
 - updated wan example script
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
@quic-amitraj quic-amitraj merged commit b777e8b into quic:main Jan 28, 2026
4 checks passed
tv-karthikeya added a commit to tv-karthikeya/efficient-transformers that referenced this pull request Jan 28, 2026
Support to skip export, compilation if qpc already exists
 - Updated Flux, wan configs, pipelines with qpc_path changes

---------

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
(cherry picked from commit b777e8b)
tchawada pushed a commit to tchawada/QEff_tanisha that referenced this pull request Feb 4, 2026
Support to skip export, compilation if qpc already exists
 - Updated Flux, wan configs, pipelines with qpc_path changes

---------

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
tchawada pushed a commit to tchawada/QEff_tanisha that referenced this pull request Feb 4, 2026
Support to skip export, compilation if qpc already exists
 - Updated Flux, wan configs, pipelines with qpc_path changes

---------

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
tchawada pushed a commit to tchawada/QEff_tanisha that referenced this pull request Feb 4, 2026
Support to skip export, compilation if qpc already exists
 - Updated Flux, wan configs, pipelines with qpc_path changes

---------

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
qcdipankar pushed a commit to qcdipankar/efficient-transformers that referenced this pull request Feb 8, 2026
Support to skip export, compilation if qpc already exists
 - Updated Flux, wan configs, pipelines with qpc_path changes

---------

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
tchawada pushed a commit to tchawada/QEff_tanisha that referenced this pull request Feb 16, 2026
Support to skip export, compilation if qpc already exists
 - Updated Flux, wan configs, pipelines with qpc_path changes

---------

Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments