[go: nahoru, domu]

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

Fix configure.py to more directly specify the find_cuda_config.py instead of using glob() #6427

Closed
wants to merge 1 commit into from

Conversation

joker-eph
Copy link
Contributor

We know the exact location and don't need to glob() here. The issue with glob is that it can be slow, in particular when re-running the configure script after building with Bazel: the glob will process tens of GB of build directories!

…tead of using `glob()`

We know the exact location and don't need to glob() here.
The issue with glob is that it can be slow, in particular when re-running the
configure script after building with Bazel: the glob will process tens of GB
of build directories!
@github-actions github-actions bot added the kokoro:force-run Forces CI to rerun label Oct 18, 2023
@kokoro-team kokoro-team removed the kokoro:force-run Forces CI to rerun label Oct 18, 2023
@reedwm reedwm requested a review from ddunl October 18, 2023 23:10
@reedwm
Copy link
Member
reedwm commented Oct 18, 2023

@angerson, tensorflow/tensorflow@b1f946a added the uncodntional glob. Before that commit, there was specific logic to try to find find_cuda_config.py with a glob run if not found in the original location. Do you know why this logic existed? Is find_cuda_config.py ever not in the normal place?

Copy link
Member
@ddunl ddunl left a comment

Choose a reason for hiding this comment

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

Going to import this now while waiting for @angerson 's reply

@angerson
Copy link
Contributor

This is the PR that suggested a glob of some kind would be useful: tensorflow/tensorflow#46075

I've never seen it brought up again, though.

@ddunl
Copy link
Member
ddunl commented Oct 19, 2023

Ok great, I think I'm going to merge this then. Thanks!!

@reedwm
Copy link
Member
reedwm commented Oct 19, 2023

Even if TensorFlow or XLA is included in another project, the fact this PR uses __file__ to get the root directory of TF/XLA should make everything work. So I don't think this PR will cause issues.

copybara-service bot pushed a commit to tensorflow/tensorflow that referenced this pull request Oct 19, 2023
…fig.py instead of using `glob()`

Imported from GitHub PR openxla/xla#6427

We know the exact location and don't need to glob() here. The issue with glob is that it can be slow, in particular when re-running the configure script after building with Bazel: the glob will process tens of GB of build directories!
Copybara import of the project:

--
d0ccab91c465871c6c87f9bcf1746cbd5da47967 by Mehdi Amini <mamini@nvidia.com>:

Fix configure.py to more directly specify the find_cuda_config.py instead of using `glob()`

We know the exact location and don't need to glob() here.
The issue with glob is that it can be slow, in particular when re-running the
configure script after building with Bazel: the glob will process tens of GB
of build directories!

Merging this change closes #6427

PiperOrigin-RevId: 575020900
@hmonishN
Copy link
Contributor
hmonishN commented Oct 27, 2023

Shouldn't the path be: 'third_party/tsl/third_party/gpus/find_cuda_config.py' instead of: 'third_party/gpus/find_cuda_config.py'?

Currently it is throwing "FileNotFoundError: Can't find 'find_cuda_config.py' script inside working directory, expected in /xla/third_party/gpus/find_cuda_config.py"
when trying to execute configure.py file in XLA

@joker-eph
Copy link
Contributor Author

Shouldn't the path be: 'third_party/tsl/third_party/gpus/find_cuda_config.py' instead of: 'third_party/gpus/find_cuda_config.py'?

Currently it is throwing "FileNotFoundError: Can't find 'find_cuda_config.py' script inside working directory, expected in /xla/third_party/gpus/find_cuda_config.py" when trying to execute configure.py file in XLA

You're right, seems like edd97f346c08c69616719d72606ec6e97d15aced broke it yesterday by removing the path used here. I'll fix it.
@jakeharmon8 FYI

@joker-eph
Copy link
Contributor Author

The double nesting of third_party in third_party/tsl/third_party/ is a bit weird, intentional @jakeharmon8 ?

@joker-eph
Copy link
Contributor Author

#6610 for the fix.

@jakeharmon8
Copy link
Member

Intentional, but controversial. We have workspace macros that should automatically load TSL's/XLA's dependencies. Just like TF has workspace{0,1,2,3}.bzl, XLA/TSL also have workspace macros that do the same thing. e.g. XLA calls TSL here: https://github.com/openxla/xla/blob/main/workspace2.bzl#L90

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.

None yet

9 participants