Skip to content

add acceleration inference docs#1371

Open
mi804 wants to merge 2 commits intomodelscope:mainfrom
mi804:acce_docs
Open

add acceleration inference docs#1371
mi804 wants to merge 2 commits intomodelscope:mainfrom
mi804:acce_docs

Conversation

@mi804
Copy link
Copy Markdown
Collaborator

@mi804 mi804 commented Mar 25, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the DiffSynth-Studio documentation by adding comprehensive guides on accelerating diffusion model inference. The new content covers practical methods such as multi-GPU parallel processing and PyTorch's computation graph compilation, offering users clear instructions and examples to optimize model performance and reduce inference times.

Highlights

  • New Documentation for Inference Acceleration: Introduced comprehensive documentation covering various techniques to accelerate inference for diffusion models within DiffSynth-Studio.
  • Multi-GPU Parallel Inference: Detailed the implementation and usage of Unified Sequence Parallel (USP) for multi-GPU inference, leveraging xDiT to split token sequences across GPUs.
  • Computation Graph Compilation with PyTorch 2.0: Provided guidance on utilizing torch.compile for just-in-time compilation, including regional compilation strategies for Diffusion Transformers (DiT) and explanations of key compilation parameters like mode, dynamic, and fullgraph.
  • Documentation Index Updates: Integrated the new acceleration guides into both the English and Chinese documentation indices for easy access.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces new documentation for inference acceleration techniques in diffusion models, covering multi-GPU parallel inference and computation graph compilation, in both English and Chinese. The navigation has also been updated to include these new pages. Feedback indicates that several links in the English documentation are broken due to incorrect Google search URL wrapping, and the Python code examples in both language versions contain unused imports. Additionally, the Chinese documentation file is missing a trailing newline character.


DiffSynth-Studio adopts a multi-GPU inference solution using Unified Sequence Parallel (USP). It splits the token sequence in the DiT across multiple GPUs for parallel processing. The underlying implementation is based on [xDiT](https://github.com/xdit-project/xDiT). Please note that unified sequence parallelism introduces additional communication overhead, so the actual speedup ratio is usually lower than the number of GPUs.

Currently, DiffSynth-Studio supports unified sequence parallel acceleration for the [Wan](https://www.google.com/search?q=../Model_Details/Wan.md) and [MOVA](https://www.google.com/search?q=../Model_Details/Wan.md) models.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The links for the "Wan" and "MOVA" models are broken. They appear to be wrapped in a Google search URL. Please correct them to be direct relative links.

Suggested change
Currently, DiffSynth-Studio supports unified sequence parallel acceleration for the [Wan](https://www.google.com/search?q=../Model_Details/Wan.md) and [MOVA](https://www.google.com/search?q=../Model_Details/Wan.md) models.
Currently, DiffSynth-Studio supports unified sequence parallel acceleration for the [Wan](../Model_Details/Wan.md) and [MOVA](../Model_Details/Wan.md) models.

Comment on lines +33 to +34
from PIL import Image
from diffsynth.utils.data import save_video, VideoData
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The Image and VideoData imports are unused in this code snippet. It's good practice to remove unused imports to keep the example code clean and focused.

Suggested change
from PIL import Image
from diffsynth.utils.data import save_video, VideoData
from diffsynth.utils.data import save_video

Comment on lines +28 to +29
from PIL import Image
from diffsynth.utils.data import save_video, VideoData
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The Image and VideoData imports are unused in this code snippet. It's good practice to remove unused imports to keep the example code clean and focused.

Suggested change
from PIL import Image
from diffsynth.utils.data import save_video, VideoData
from diffsynth.utils.data import save_video

```python
class QwenImageDiT(torch.nn.Module):
_repeated_blocks = ["QwenImageTransformerBlock"]
``` No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

It is a good practice to end files with a newline character for POSIX compatibility.

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.

1 participant