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

请提高 PyTorch 版本上限 #1643

Closed
hongbo-miao opened this issue Jan 31, 2025 · 3 comments
Closed

请提高 PyTorch 版本上限 #1643

hongbo-miao opened this issue Jan 31, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@hongbo-miao
Copy link

hongbo-miao commented Jan 31, 2025

Description of the bug | 错误描述

我之前发了个用 uv 安装的方法在 #1374 (comment)

但我发现里面默认会用 paddlepaddle,我现在希望安装 paddlepaddle-gpu:

pyproject.toml

[project]
name = "mineru"
version = "1.0.0"
requires-python = "~=3.12.0"
dependencies = [
  "paddlepaddle-gpu==3.0.0b2",
]

[project.optional-dependencies]
build = [
  "setuptools",
  "torch",
]
compile = [
  "detectron2",
  "magic-pdf[full]==1.1.0",
]

[tool.uv]
package = false
prerelease = "allow"
no-build-isolation-package = ["detectron2"]

[tool.uv.sources]
paddlepaddle-gpu = { index = "paddlepaddle-gpu" }
detectron2 = { git = "https://github.com/facebookresearch/detectron2.git", branch = "main" }

[[tool.uv.index]]
name = "paddlepaddle-gpu"
url = "https://www.paddlepaddle.org.cn/packages/stable/cu123"
explicit = true

在跑 uv sync --extra=build 时会报错

warning: Missing version constraint (e.g., a lower bound) for `setuptools`
warning: Missing version constraint (e.g., a lower bound) for `torch`
  × No solution found when resolving dependencies for split (python_full_version >= '3.12.0' and python_full_version < '3.13' and platform_machine != 'aarch64' and platform_system == 'Linux'):
  ╰─▶ Because torch>=2.2.2,<=2.3.1 depends on nvidia-nvtx-cu12{platform_machine == 'x86_64' and platform_system == 'Linux'}==12.1.105 and only the following versions of torch are available:
          torch<=2.2.2
          torch==2.3.0
          torch>=2.3.1
      we can conclude that torch>=2.2.2,<=2.3.1 depends on nvidia-nvtx-cu12{platform_machine == 'x86_64' and platform_system == 'Linux'}==12.1.105.
      And because magic-pdf[full]==1.1.0 depends on torch>=2.2.2,<=2.3.1, we can conclude that magic-pdf[full]==1.1.0 depends on nvidia-nvtx-cu12{platform_machine == 'x86_64' and platform_system == 'Linux'}==12.1.105.
      And because paddlepaddle-gpu==3.0.0b2 depends on nvidia-nvtx-cu12{platform_machine == 'x86_64' and platform_system == 'Linux'}==12.4.127 and mineru[compile] depends on magic-pdf[full]==1.1.0, we can conclude that mineru[compile] and paddlepaddle-gpu==3.0.0b2 are
      incompatible.
      And because mineru[compile] depends on paddlepaddle-gpu==3.0.0b2 and your project requires mineru[compile], we can conclude that your project's requirements are unsatisfiable.
error: Recipe `uv-install-dependencies` failed on line 8 with exit code 1

但由于 magic-pdf 依赖的 PyTorch 版本太低:

MinerU/setup.py

Lines 40 to 41 in 1e4d4b5

"torch>=2.2.2,<=2.3.1", # torch2.4.0及之后版本未测试,先卡住版本上限
"torchvision>=0.17.2,<=0.18.1", # torchvision 受torch版本约束

这个旧的 PyTorch 又依赖旧的 nvidia-nvtx-cu12。
而 paddlepaddle-gpu==3.0.0b2 需要更新的 nvidia-nvtx-cu12。

请提高 PyTorch 版本上限,谢谢!

How to reproduce the bug | 如何复现

如上

Operating system | 操作系统

Linux

Python version | Python 版本

3.12

Software version | 软件版本 (magic-pdf --version)

1.1.0

Device mode | 设备模式

cuda

@hongbo-miao hongbo-miao added the bug Something isn't working label Jan 31, 2025
@myhloli
Copy link
Collaborator

myhloli commented Jan 31, 2025

paddlegpu可以装3.0.0b1的cu118版本

@hongbo-miao hongbo-miao changed the title 提高 PyTorch 版本上限 请提高 PyTorch 版本上限 Jan 31, 2025
@hongbo-miao
Copy link
Author

@myhloli 多谢!改成

[[tool.uv.index]]
name = "paddlepaddle-gpu"
url = "https://www.paddlepaddle.org.cn/packages/stable/cu118"
explicit = true

确实可以安装成功了,不过还想希望将来有时间能提高 PyTorch 上限 ☺️

@hongbo-miao
Copy link
Author

(最新用 uv 的安装方法发在了 https://github.com/opendatalab/MinerU/discussions/1374)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants