Skip to content

Speed up ernie model by a bit on nvidia and use higher quality rope.#14192

Merged
comfyanonymous merged 2 commits into
masterfrom
temp_pr
May 31, 2026
Merged

Speed up ernie model by a bit on nvidia and use higher quality rope.#14192
comfyanonymous merged 2 commits into
masterfrom
temp_pr

Conversation

@comfyanonymous
Copy link
Copy Markdown
Member

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 30, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4b5deaab-69dd-4b45-b51d-2c3d94645def

📥 Commits

Reviewing files that changed from the base of the PR and between 08e93a3 and c7bc94d.

📒 Files selected for processing (2)
  • comfy/ldm/cosmos/predict2.py
  • comfy/ldm/ernie/model.py

📝 Walkthrough

Walkthrough

This PR migrates rotary embedding computation and application from local implementations to the shared comfy.quant_ops library. The Ernie and Cosmos models now import comfy.quant_ops and use its apply_rope_split_half function. The local apply_rotary_emb helper is removed, and ErnieImageEmbedND3 is refactored to build rotary embeddings with a new tensor structure (stacked and reshaped to include explicit [..., 2, 2] dimensions). Type casting behavior is simplified by removing the .to(x.dtype) conversion in ErnieImageModel.forward().

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess relevance to the changeset. Add a description explaining the performance improvements, rope quality enhancements, and any testing or benchmark results to provide context for reviewers.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: optimizing the ernie model performance on NVIDIA GPUs and improving the rope (rotary positional embedding) implementation quality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@comfyanonymous comfyanonymous merged commit 81aa5a3 into master May 31, 2026
21 checks passed
@comfyanonymous comfyanonymous deleted the temp_pr branch May 31, 2026 00:53
@Ph0rk0z
Copy link
Copy Markdown

Ph0rk0z commented May 31, 2026

Rope stuff broke nunchaku since it's looking for the old rope. At least the version I was using.

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