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

llama.cpp: add model_converters variant #27526

Open
wants to merge 47 commits into
base: master
Choose a base branch
from

Conversation

i0ntempest
Copy link
Member

Description

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS x.y
Xcode x.y / Command Line Tools x.y.z

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL in commit message?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@macportsbot
Copy link

Notifying maintainers:
@blair for port py-tensorflow_estimator.
@mdouze for port libfaiss.
@beauby for port libfaiss.
@emcrisostomo for port py-absl, py-tensorboard.
@cjones051073 for port py-blis, py-confection, py-plac, py-preshed, py-srsly, py-thinc, py-wasabi.
@reneeotten for port py-cookiecutter.
@stromnov for port py-scikit-learn.

@macportsbot macportsbot added type: enhancement type: submission maintainer: open Affects an openmaintainer port by: member Created by a member with commit rights labels Jan 27, 2025
@i0ntempest i0ntempest force-pushed the llama branch 3 times, most recently from 5209a36 to 409ad9a Compare January 27, 2025 17:58
@i0ntempest
Copy link
Member Author

@mascguy Please take a look!
This massive PR took me like 2 days, and there's almost certainly something that I fricked up. For one I cannot track the dependency relations of all the python ports I changed anymore.
What I've done:
Ran through all the dependencies needed for the four conversion scripts to work, adding compatibility up to Python 3.12 (or 3.13 if the package supports it), and updating them if possible.

What I've tested and works:

  1. Importing gguf, torch, tensorflow, transformers in python
  2. Running the tensorflow test script from Apple here
  3. Running all the conversion scripts without args (that is I did not test any actual conversions)

Some notes:

  1. py-preshed must be downgraded for py-spaCy to build
  2. py-tensorflow-macos was updated to use tensorflow pypi instead of tensorflow-macos, which seems defunct. This is the only way we can get to python 3.12, and I didn't dare touch the actual py-tensorflow port
  3. Multiple build workarounds needed because our numpy is ancient
  4. Old protobuf3-cpp blocked me from updating grpc

@mascguy
Copy link
Member

mascguy commented Jan 27, 2025

I'll take a closer look.

Also adding @essandess for review/comment, as he's contributed to a number of Python ports in this space.

@i0ntempest i0ntempest changed the title llama.cpp 4567, add model_converters variant llama.cpp: add model_converters variant Jan 28, 2025
@i0ntempest i0ntempest force-pushed the llama branch 2 times, most recently from ec91fe7 to 6dad512 Compare January 29, 2025 02:27
@i0ntempest
Copy link
Member Author

i0ntempest commented Jan 29, 2025

I haven’t ironed out all the problems yet but all 3 CI tests fail at 381 minutes, is this a timeout?
Also I can’t see any log from 15.0 CI.

@i0ntempest
Copy link
Member Author

i0ntempest commented Jan 31, 2025

Have you tried updating py-pytorch to v2.6.0?

Just pushed

The two macos-specific patches also need to be updated.

Done. There might be fetch errors caused by missing github.tarball_from tho, will address later.

EDIT: They should be fixed now

@i0ntempest i0ntempest force-pushed the llama branch 2 times, most recently from 88108dc to 3f64461 Compare February 1, 2025 05:15
@i0ntempest
Copy link
Member Author

Yea it's still py312-spaCy failing

@mascguy
Copy link
Member

mascguy commented Feb 1, 2025

Yea it's still py312-spaCy failing

Would it be possible to update some of the more core dependencies - like py-onyx, etc - to get us closer? Maybe move those to a separate PR, which can pass CI?

@i0ntempest
Copy link
Member Author

i0ntempest commented Feb 1, 2025

Yea it's still py312-spaCy failing

Would it be possible to update some of the more core dependencies - like py-onyx, etc - to get us closer? Maybe move those to a separate PR, which can pass CI?

I can but I doubt that'll fix anything, the failure is not caused by the 6h timeout. If you download the full log of the 14.0 check you may see a bunch of cython related errors (like I said above). I could not repro those errors on my system as the port builds just fine here. Can you check if you get this error?

@mascguy
Copy link
Member

mascguy commented Feb 2, 2025

Yea it's still py312-spaCy failing

Would it be possible to update some of the more core dependencies - like py-onyx, etc - to get us closer? Maybe move those to a separate PR, which can pass CI?

I can but I doubt that'll fix anything, the failure is not caused by the 6h timeout. If you download the full log of the 14.0 check you may see a bunch of cython related errors (like I said above). I could not repro those errors on my system as the port builds just fine here. Can you check if you get this error?

Unfortunately py-pytorch is still failing to build on Ventura, so the patches may need to be adjusted.

@i0ntempest
Copy link
Member Author

Unfortunately py-pytorch is still failing to build on Ventura, so the patches may need to be adjusted.

Well, better tag some C/C++ (and cython) experts for help. Debugging this kind of build is pretty much above my skill level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
by: member Created by a member with commit rights maintainer: open Affects an openmaintainer port type: enhancement type: submission type: update
Development

Successfully merging this pull request may close these issues.

8 participants