Skip to content

Conversation

@frederik-uni
Copy link
Contributor

having a src module did not work as expected, so I opted to use a helper crate. I didnt use all the features I implemented.

features disabled are

  • shared not tested
  • crt-dynamic on static builds
  • export-vendor
  • download releases(src code) instead of using the submodule

Compiling works on macOS, linux, windows. I also tested if vendor & using it works on macOS. I will test the vendor feature on linux tomorrow, but I expect it to work

@frederik-uni
Copy link
Contributor Author

I may add rocm builds in the future, but only as a vendor release(the rocm patches I found are forks of the original code/break cuda[cuda is the used backend, but the logic is replaced with rocm])

@frederik-uni
Copy link
Contributor Author

I tested it manually for macOS & linux(cuda). compiling works for all OSes. it can be assumed that the vendor feature works on every operating system & building from source too

@jkawamoto
Copy link
Owner

Thank you for this PR.

I really appreciate your contribution, but I don’t think we should merge it as-is. I’m currently working on the system feature (#108), which already makes use of the pre-compiled libraries you uploaded in Release v4.6.0 · frederik-uni/ctranslate2-src.

For example, on macOS I can pass all tests on the system branch with the following commands:

mkdir vendor
cd vendor
curl -LO https://github.com/frederik-uni/ctranslate2-src/releases/download/v4.6.0/ctranslate2-static-macos-arm64.tar.gz
tar -zxvf ctranslate2-static-macos-arm64.tar.gz

cd ..
export LIBRARY_PATH=$(pwd)/vendor/lib
cargo build --no-default-features -F hub,whisper,system -p ct2rs

And on Linux, after copying libdnnl.a and libiomp5.a into vendor/lib, the following works for me:

mkdir vendor
cd vendor
curl -LO https://github.com/frederik-uni/ctranslate2-src/releases/download/v4.6.0/ctranslate2-static-linux-x86_64.tar.gz
tar -zxvf ctranslate2-static-linux-x86_64.tar.gz
# copy libdnnl.a, libiomp5.a into lib

cd ..
export LIBRARY_PATH=$(pwd)/vendor/lib
export LD_LIBRARY_PATH=$(pwd)/vendor/dyn
export MKLROOT=/path/to/mklroot

cargo build --no-default-features -F whisper,hub,system,cuda,cudnn,dnnl,openmp-runtime-intel,cuda-dynamic-loading,mkl -p ct2rs

So instead of merging this PR, I think the better approach would be to provide pre-compiled libraries (using your ctranslate2-src-build-support) and distribute them (in https://github.com/frederik-uni/ctranslate2-src?).

Would that work for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants