Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support setuptools 74.0.0 or later#8583

Merged
takagi merged 7 commits into
cupy:mainfrom
kmaehashi:fix-setuptools-74-runtime
Oct 7, 2024
Merged

Support setuptools 74.0.0 or later#8583
takagi merged 7 commits into
cupy:mainfrom
kmaehashi:fix-setuptools-74-runtime

Conversation

@kmaehashi

@kmaehashi kmaehashi commented Sep 3, 2024

Copy link
Copy Markdown
Member

Closes #8568. Follows-up #8574. Reverts #8567.

edit: This PR adopts recent setuptools changes, specifically v74.0.0 (which removed setuptools.msvc) and v74.1.0+ (which reverted setuptools.msvc but requires explicit module import instead of import setuptools).

Original description

On Windows platform with setuptools 74+, it will now take 2-3 seconds to find cl.exe. This overhead happens only once per process, and only when the use of nvcc is requested.

setuptools.msvc (which we rely on for years and is now removed) was able to discover cl.exe very quickly as it directly reads the Windows registry. The new approach introduced in this PR (which only uses the public/documented setuptools API) retrives the compiler path through vcvarsall.bat, which incurs subprocess invocation.

@kmaehashi kmaehashi added to-be-backported Pull-requests to be backported to stable branch blocking Issue/pull-request is mandatory for the upcoming release prio:high labels Sep 3, 2024
@kmaehashi

Copy link
Copy Markdown
Member Author

Oops, I just noticed setuptools.msvc removal has been reverted...

pypa/setuptools#4626

@takagi takagi self-assigned this Sep 4, 2024
@kmaehashi kmaehashi added prio:medium and removed blocking Issue/pull-request is mandatory for the upcoming release labels Sep 4, 2024
@takagi takagi removed the prio:high label Sep 4, 2024
@takagi

takagi commented Sep 5, 2024

Copy link
Copy Markdown
Contributor

/test mini

@kmaehashi kmaehashi changed the title Allow discovering cl.exe at runtime with setuptools 74 Allow discovering cl.exe at runtime with setuptools 74.0.0 Sep 8, 2024
@kmaehashi kmaehashi marked this pull request as draft September 8, 2024 07:59
@kmaehashi kmaehashi changed the title Allow discovering cl.exe at runtime with setuptools 74.0.0 Allow discovering cl.exe at runtime with setuptools 74.0.0 or later Sep 8, 2024
@kmaehashi

Copy link
Copy Markdown
Member Author

/test mini

@kmaehashi kmaehashi added blocking Issue/pull-request is mandatory for the upcoming release prio:high and removed prio:medium labels Sep 8, 2024
@kmaehashi

Copy link
Copy Markdown
Member Author

Changing priority to high as this impacts Windows users with setuptools 74.0.0+.

@kmaehashi kmaehashi added the cat:enhancement Improvements to existing features label Sep 8, 2024
@kmaehashi kmaehashi changed the title Allow discovering cl.exe at runtime with setuptools 74.0.0 or later Support setuptools 74.0.0 or later Sep 8, 2024
@kmaehashi kmaehashi marked this pull request as ready for review September 8, 2024 08:19
@kmaehashi

Copy link
Copy Markdown
Member Author

/test mini

@mergify

mergify Bot commented Sep 26, 2024

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it @kmaehashi? 🙏

@kmaehashi

Copy link
Copy Markdown
Member Author

/test mini

This one is review ready!

@takagi

takagi commented Oct 7, 2024

Copy link
Copy Markdown
Contributor

/test mini

@takagi takagi added this to the v14.0.0a1 milestone Oct 7, 2024

@takagi takagi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@takagi takagi enabled auto-merge October 7, 2024 05:54
@kmaehashi

Copy link
Copy Markdown
Member Author

/test mini

@takagi takagi merged commit a552466 into cupy:main Oct 7, 2024
@chainer-ci

Copy link
Copy Markdown
Member

@takagi Failed to backport automatically.


Not cleanly cherry-picked

@chainer-ci

Copy link
Copy Markdown
Member

@takagi This pull-request is marked as to-be-backported, but the corresponding backport PR could not be found. Could you check?

@kmaehashi kmaehashi deleted the fix-setuptools-74-runtime branch October 7, 2024 10:53
kmaehashi pushed a commit to kmaehashi/cupy that referenced this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocking Issue/pull-request is mandatory for the upcoming release cat:enhancement Improvements to existing features prio:high to-be-backported Pull-requests to be backported to stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CuPy fails with setuptools 74.0.0

3 participants