Wan support to skip compilation#734
Conversation
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>
fe02ec8 to
12fbac7
Compare
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
c5b0424 to
973c2b0
Compare
| @@ -304,9 +305,6 @@ def compile( | |||
| ): | |||
| self.export(use_onnx_subfunctions=use_onnx_subfunctions) | |||
|
|
|||
There was a problem hiding this comment.
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, |
|
|
||
|
|
||
| def set_module_device_ids(cls): | ||
| def set_module_device_ids_and_qpc_paths(cls): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Why these changes? Any sepcific reason
| 4: "latent_width", | ||
| }, | ||
| "timestep": {0: "steps"}, | ||
| "encoder_hidden_states": {0: "batch_size", 1: "sequence_length"}, |
QEfficient/utils/constants.py
Outdated
| 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 |
There was a problem hiding this comment.
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, |
97caf8b to
811b0fe
Compare
|
Reverted the changes done for 90p onnx export |
811b0fe to
7684bf5
Compare
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
7684bf5 to
2ec739a
Compare
quic-amitraj
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Update the comment as well.
| 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 |
There was a problem hiding this comment.
We should throw error if qpc path is not correct.
| # When to use: | ||
| # - When you want to skip export, compile if you already had compiled qpc |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
update qpc_path of desired module
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
bde6882 to
71d1c93
Compare
- added num layers fix - updated wan example script Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
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)
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>
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>
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>
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>
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>
Support to skip export, compilation if qpc already exists