[PR #22] feat: add mps support #67

Open
opened 2026-10-26 21:09:20 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/DeepSeek-VL/pull/22
Author: @Fodark
Created: 3/13/2024
Status: 🔄 Open

Base: main ← Head: mps-support


📝 Commits (5)

  • c99e9f1 automatically detect the Python version, if above 3.10 patch collections to use collections.abc
  • 5db8156 use transformers 4.38.1 instead of 4.38.2 as autocast fails on mps on latest version
  • 494e622 add an util function to detect platflorm and suitable dtype
  • 40ec649 load model on detected device and use correct dtype
  • 4eac5b5 modify example in README to use the new device and dtype function

📊 Changes

7 files changed (+49 additions, -11 deletions)

View changed files

📝 README.md (+4 -2)
📝 cli_chat.py (+3 -3)
📝 deepseek_vl/__init__.py (+11 -0)
📝 deepseek_vl/utils/io.py (+24 -1)
📝 inference.py (+5 -3)
📝 pyproject.toml (+1 -1)
📝 requirements.txt (+1 -1)

📄 Description

Detect the platform where the model is loaded and adjust torch.device and torch.dtype appropriately.
I was able to run the model on an M1 Macbook Pro (with poor performance at the moment).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/DeepSeek-VL/pull/22 **Author:** [@Fodark](https://github.com/Fodark) **Created:** 3/13/2024 **Status:** 🔄 Open **Base:** `main` ← **Head:** `mps-support` --- ### 📝 Commits (5) - [`c99e9f1`](https://github.com/deepseek-ai/DeepSeek-VL/commit/c99e9f1184cb3eab824e5dfd030007767e0fd492) automatically detect the Python version, if above 3.10 patch collections to use collections.abc - [`5db8156`](https://github.com/deepseek-ai/DeepSeek-VL/commit/5db8156747f82d67ea3f70e771619c53ae85d795) use transformers 4.38.1 instead of 4.38.2 as autocast fails on mps on latest version - [`494e622`](https://github.com/deepseek-ai/DeepSeek-VL/commit/494e622544b7aefd5634fdc72878a0289d4e548f) add an util function to detect platflorm and suitable dtype - [`40ec649`](https://github.com/deepseek-ai/DeepSeek-VL/commit/40ec6491d4b3c0667e427622fb185878d3e98127) load model on detected device and use correct dtype - [`4eac5b5`](https://github.com/deepseek-ai/DeepSeek-VL/commit/4eac5b59982e37dfdb8fe9c06e763235a09c64d3) modify example in README to use the new device and dtype function ### 📊 Changes **7 files changed** (+49 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+4 -2) 📝 `cli_chat.py` (+3 -3) 📝 `deepseek_vl/__init__.py` (+11 -0) 📝 `deepseek_vl/utils/io.py` (+24 -1) 📝 `inference.py` (+5 -3) 📝 `pyproject.toml` (+1 -1) 📝 `requirements.txt` (+1 -1) </details> ### 📄 Description Detect the platform where the model is loaded and adjust `torch.device` and `torch.dtype` appropriately. I was able to run the model on an M1 Macbook Pro (with poor performance at the moment). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepSeek-VL#67
No description provided.