Skip to content

Fix ernie on devices that don't support fp64.#13414

Merged
comfyanonymous merged 1 commit into
masterfrom
comfyanonymous-patch-1
Apr 15, 2026
Merged

Fix ernie on devices that don't support fp64.#13414
comfyanonymous merged 1 commit into
masterfrom
comfyanonymous-patch-1

Conversation

@comfyanonymous
Copy link
Copy Markdown
Member

No description provided.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

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: 053c18fc-7599-43bd-b661-a0e6f5524ef9

📥 Commits

Reviewing files that changed from the base of the PR and between 7ce3f64 and 745ef2b.

📒 Files selected for processing (1)
  • comfy/ldm/ernie/model.py

📝 Walkthrough

Walkthrough

The rope() function in the rotary embedding implementation has been modified to ensure positional inputs are moved to the specified device before the einsum operation. Previously, position tensors were passed directly to torch.einsum(). Now they are explicitly cast to the target device via .to(device) prior to computation. The function's output remains returned as torch.float32 on the position tensor's device. This change affects device consistency during the rotary embedding calculation with minimal code impact.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess whether descriptive content relates to the changeset. Add a pull request description explaining the issue being fixed and how the change addresses device compatibility problems.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main fix: resolving fp64 device compatibility issues in the ernie model, which directly relates to the changeset's purpose.

✏️ 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 cb0bbde into master Apr 15, 2026
16 checks passed
@comfyanonymous comfyanonymous deleted the comfyanonymous-patch-1 branch April 15, 2026 02:54
pollockjj pushed a commit to pollockjj/ComfyUI that referenced this pull request Apr 20, 2026
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