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

Build fails on python 3.12 on darwin, caused by sentencepiece #2274

Open
apullin opened this issue Sep 10, 2024 · 0 comments
Open

Build fails on python 3.12 on darwin, caused by sentencepiece #2274

apullin opened this issue Sep 10, 2024 · 0 comments

Comments

@apullin
Copy link

apullin commented Sep 10, 2024

🐛 Bug

Describe the bug A clear and concise description of what the bug is.
Building on Darwin with python 3.12 and clang, the build will fail due to an error in sentencepiece.

There's another recent issue about pip install being broken. But I also see the RFC about EoL for this package.
This is causing some version hell, I think.
That's how I came trying to build it from source.

An apparently easy fix is to change the sentencepiece commit to the v0.2.0 tag. Everything builds and works then.

To Reproduce Steps to reproduce the behavior:

  1. git clone https://github.com/pytorch/text.git
  2. cd text
  3. python setup.py build

Build will fail due to bad code style in sentencepiece:

.../text/third_party/sentencepiece/src/trainer_interface.cc:211:7: error: integer value -1 is outside the valid range of values [0, 255] for this enumeration type [-Wenum-constexpr-conversion]
      static_cast<unicode_script::ScriptType>(-1);

Expected behavior A clear and concise description of what you expected to happen.
Build should work and I should be able to install torchtext 0.18.0 from source. Or the 0.17.something version that is pinned, per the RFC.

Environment

PyTorch version: 2.4.0
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 14.6.1 (arm64)
GCC version: Could not collect
Clang version: 15.0.0 (clang-1500.3.9.4)
CMake version: version 3.28.1
Libc version: N/A

Python version: 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:35:20) [Clang 16.0.6 ] (64-bit runtime)
Python platform: macOS-14.6.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Apple M2 Max

Versions of relevant libraries:
[pip3] flake8==7.0.0
[pip3] mypy==1.11.2
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.26.4
[pip3] numpydoc==1.7.0
[pip3] onnx==1.16.0
[pip3] pytorch-lightning==2.3.3
[pip3] torch==2.4.0
[pip3] torchaudio==2.4.0
[pip3] torchmetrics==1.4.0.post0
[pip3] torchtext==0.17.0a0+e96441e
[pip3] torchtext==0.17.0a0+e96441e
[pip3] torchvision==0.19.0
[conda] numpy                     1.26.4          py312h7f4fdc5_0  
[conda] numpy-base                1.26.4          py312he047099_0  
[conda] numpydoc                  1.7.0           py312hca03da5_0  
[conda] pytorch                   2.4.0                  py3.12_0    pytorch
[conda] pytorch-lightning         2.3.3              pyhd8ed1ab_0    conda-forge
[conda] torchaudio                2.4.0                 py312_cpu    pytorch
[conda] torchmetrics              1.4.0.post0        pyhd8ed1ab_0    conda-forge
[conda] torchtext                 0.17.0a0+e96441e          pypi_0    pypi
[conda] torchvision               0.19.0                py312_cpu    pytorch

Additional context Add any other context about the problem here.

Fix is easy. But since this repo is semi-abandoned, not sure what to do.

Changing the sentencepiece commit to the v0.2.0 tag seems to make the build work.

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

No branches or pull requests

1 participant