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

[python-package] drop Python 3.6 support, add Python 3.12 #6459

Merged
merged 7 commits into from
May 27, 2024

Conversation

jameslamb
Copy link
Collaborator

@jameslamb jameslamb commented May 18, 2024

Inspired by this discussion: #6375 (comment)

Proposes the following:

  • bump python-requires to >= 3.7
  • run the one "oldest versions of everything" job on Python 3.7 instead of Python 3.6
  • run most CI jobs on 1 minor version of Python newer than what it's currently on
    • which includes adding the first Python 3.12 jobs here!
  • narrowly pin dependencies in Python 3.8 jobs to a specific, known-working environment

Notes for Reviewers

Why these versions?

I picked the oldest versions where pip install run in the python:3.7 docker image found a wheel. Found that building those old versions scipy and pandas from their sdists failed with a variety of errors.

Summary:

cuda_version: "11.8.0"
task: cuda
- method: source
compiler: gcc
python_version: "3.9"
python_version: "3.12"
Copy link
Collaborator Author

@jameslamb jameslamb May 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proposing swapping this one and the wheel task, so we're always testing newest CUDA together with newest Python

@jameslamb jameslamb changed the title WIP: [python-package] drop Python 3.6 support, add Python 3.12 [python-package] drop Python 3.6 support, add Python 3.12 May 19, 2024
@jameslamb jameslamb marked this pull request as ready for review May 19, 2024 05:26
Copy link
Collaborator

@borchero borchero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jameslamb
Copy link
Collaborator Author

Thanks for the review!

For breaking changes like this, I'd like to try to get 2 reviews. @jmoralez I know you'd supported this general idea in #6375 (comment), could you take a look at this PR and let us know what you think about the choices I made here?

Copy link
Collaborator

@jmoralez jmoralez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks!

@jameslamb
Copy link
Collaborator Author

jameslamb commented May 24, 2024

hmmmmm all the gcc CUDA jobs are the CUDA 11.8 gcc job is failing with errors like this:

__________________ ERROR collecting tests/c_api_test/test_.py __________________
tests/c_api_test/test_.py:10: in <module>
    from lightgbm.basic import _LIB as LIB
/github/home/.local/lib/python3.10/site-packages/lightgbm/__init__.py:8: in <module>
    from .basic import Booster, Dataset, Sequence, register_logger
/github/home/.local/lib/python3.10/site-packages/lightgbm/basic.py:278: in <module>
    _LIB = _load_lib()
/github/home/.local/lib/python3.10/site-packages/lightgbm/basic.py:262: in _load_lib
    lib = ctypes.cdll.LoadLibrary(lib_path[0])
/tmp/miniforge/envs/test-env/lib/python3.10/ctypes/__init__.py:452: in LoadLibrary
    return self._dlltype(name)
/tmp/miniforge/envs/test-env/lib/python3.10/ctypes/__init__.py:374: in __init__
    self._handle = _dlopen(self._name, mode)
E   OSError: libomp.so.5: cannot open shared object file: No such file or directory

(example build link)

I see this in the CMake logs:

-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")

It's surprising to see LightGBM linking against libomp, not libgomp, using gcc. I have a feeling this is a result of building inside a conda environment but not using conda's compilers (ref: #5106 (comment)).

I'm gonna push a commit setting LD_DEBUG=libs so we can see more information.

@jameslamb
Copy link
Collaborator Author

I'm moving the testing of the CUDA CI issue to a separate PR, I don't think it's related to this PR's changes: #6465

@jameslamb
Copy link
Collaborator Author

I've merged in #6465, which fixes the CUDA CI issues, and reverted all the debugging stuff I'd pushed here.

Will merge this once CI (hopefully) passes.

@jameslamb jameslamb merged commit 69b5bd3 into master May 27, 2024
39 checks passed
@jameslamb jameslamb deleted the ci/drop-python36 branch May 27, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants