mirror of
https://github.com/deepseek-ai/Janus.git
synced 2026-11-05 00:57:18 +00:00
[PR #231] [CLOSED] fix: use float32 on CPU to avoid half-precision convolution error #231
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/Janus#231
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/Janus/pull/231
Author: @Mr-Neutr0n
Created: 2/6/2026
Status: ❌ Closed
Base:
main← Head:fix-cpu-half-precision-conv📝 Commits (1)
b530551fix: use float32 on CPU to avoid half-precision convolution error📊 Changes
4 files changed (+6 additions, -5 deletions)
View changed files
📝
demo/app.py(+1 -1)📝
demo/app_janusflow.py(+1 -1)📝
demo/app_januspro.py(+3 -2)📝
demo/fastapi_app.py(+1 -1)📄 Description
Summary
Fixed CPU compatibility issue in demo scripts by using
float32instead offloat16when CUDA is not available.Problem
When running on macOS or other CPU-only systems, users encounter:
This happens because PyTorch's CPU backend doesn't support half-precision (fp16) convolutions.
Solution
Changed the dtype fallback from
torch.float16totorch.float32for CPU in:demo/app_januspro.py(model loading and input preparation)demo/app.pydemo/app_janusflow.pydemo/fastapi_app.pyFixes #196
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.