Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Performance Issues with Fooocus on Mac Mini M2 pro #2975

Closed
3 of 5 tasks
tornado2800 opened this issue May 21, 2024 · 1 comment
Closed
3 of 5 tasks

[Bug]: Performance Issues with Fooocus on Mac Mini M2 pro #2975

tornado2800 opened this issue May 21, 2024 · 1 comment
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@tornado2800
Copy link

Checklist

  • The issue has not been resolved by following the troubleshooting guide
  • The issue exists on a clean installation of Fooocus
  • The issue exists in the current version of Fooocus
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

I am experiencing significant performance issues while running Fooocus on my Mac Mini M2. The application seems to rely heavily on RAM instead of utilizing the GPU (MPS), resulting in very slow image generation compared to other tools like AUTOMATIC1111’s Web UI.

Steps to reproduce the problem

1.	Set up Fooocus environment on a Mac Mini M2.
2.	Run the following command:
3. python entry_with_update.py --disable-offload-from-vram --always-gpu --attention-split --all-in-fp16
4. 	3.	Observe the resource usage and performance during image generation.

Expected Behavior:
Fooocus should efficiently utilize the GPU (MPS) for image generation, leading to faster performance and reduced RAM usage.

Actual Behavior:
Fooocus primarily uses RAM, causing slow performance and high memory consumption. The GPU (MPS) is not being utilized effectively.

Environment:

•	Device: Mac Mini M2
•	OS: macOS 13.4
•	Python: 3.10.12
•	Fooocus Version: 2.3.1
•	PyTorch Version: 2.0.0+cpu

What should have happened?

•	Improve MPS support for better GPU utilization.

What browsers do you use to access Fooocus?

Apple Safari

Where are you running Fooocus?

Locally

What operating system are you using?

macOS 13.4

Console logs

Unfortunately, I do not have specific console logs. However, here are the steps I followed:

	1.	Activated the Fooocus environment using conda activate fooocus.
	2.	Ran the command:
python entry_with_update.py --disable-offload-from-vram --always-gpu --attention-split --all-in-fp16

	3.	Observed high RAM usage and slow performance.

Additional information

Potential Solutions:

•	Improve MPS support for better GPU utilization.
•	Optimize memory management to reduce RAM usage.

Thank you for your attention to this issue. Please let me know if any further information is needed.

@tornado2800 tornado2800 added bug Something isn't working triage This needs an (initial) review labels May 21, 2024
@mashb1t
Copy link
Collaborator

mashb1t commented May 21, 2024

The GPU (MPS) is not being utilized effectively.

Pytorch is still missing support for quite a few functions for the MPS backend, see tracking issue pytorch/pytorch#77764.

This is also why Fooocus does not offer official support for MacOS. Please discuss this issue in #129, as also described in the readme. You might find a solution there.

side note: running python entry_with_update.py --disable-offload-from-vram works flawlessly for me on an Macbook M1 Max 32GB (Sonoma 14.4.1 and 14.5), but this might not be the case for you, especially with less RAM.

@mashb1t mashb1t closed this as not planned Won't fix, can't repro, duplicate, stale May 21, 2024
@mashb1t mashb1t added duplicate This issue or pull request already exists and removed triage This needs an (initial) review labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants