Qwen image with magcache#998
Open
quic-amitraj wants to merge 24 commits into
Open
Conversation
Signed-off-by: Dipankar Sarkar <quic_dipankar@quicinc.com> Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <quic_dipankar@quicinc.com> Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <quic_dipankar@quicinc.com> Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <quic_dipankar@quicinc.com> Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <quic_dipankar@quicinc.com> Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <quic_dipankar@quicinc.com> Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <quic_dipankar@quicinc.com> Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
- Refactor to inline with Diffusers design
- Adding npi, scale factor changes
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Support for Wan Image to video model Model card: "Wan-AI/Wan2.2-I2V-A14B-Diffusers" --------- Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <quic_dipankar@quicinc.com> Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
Signed-off-by: Dipankar Sarkar <quic_dipankar@quicinc.com> Signed-off-by: Dipankar Sarkar <dipankar@qti.qualcomm.com>
- Refactor to inline with Diffusers design
- Adding npi, scale factor changes
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
- Updated text encoder to return padded, fixed shaped embeddings - Refactored modeling changes, onnx params, qwen pipeline - Added pytest with dummy config Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
- Clean and refactor most of the Qwen image files Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Signed-off-by: vtirumal <vtirumal@qti.qualcomm.com>
Signed-off-by: Amit Raj <amitraj@qti.qualcomm.com>
Signed-off-by: Amit Raj <amitraj@qti.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds runtime MagCache support for Qwen-Image in QEfficient and demonstrates a strong latency reduction on AI100 while preserving visual quality.
Why This Matters
Qwen-Image denoising is transformer-heavy. By reducing expensive transformer executions in later denoise phases, this PR delivers a meaningful inference-time win with minimal image drift.
Benchmark:
Without MagCache:
With MagCache:
magcache_thresh=0.06magcache_K=2magcache_retention_ratio=0.2Common setup for both runs:
examples/diffusers/qwen_image/qwen_config.json1664 x 92850true_cfg_scale=4.0max_sequence_length=128seed=42Observed differences are minor generation-level variations, while the large latency reduction is retained.
Compile Configuration Used:
aic_num_cores=16mdp_ts_num_devices=4mos=1,mdts_mos=1convert_to_fp16=true