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

Find ROCm on Fedora #5705

Merged
merged 3 commits into from
Jul 31, 2024
Merged

Find ROCm on Fedora #5705

merged 3 commits into from
Jul 31, 2024

Conversation

trixirt
Copy link
Contributor

@trixirt trixirt commented Jun 28, 2024

ROCm is packaged natively on Fedora. It's install location do not match the AMD release.

So add some Fedora specific logic to find the ROCm version and use rocminfo when attempts to use the AMD release fail.

@trixirt trixirt requested review from tjruwase and loadams as code owners June 28, 2024 13:00
@loadams
Copy link
Contributor

loadams commented Jul 1, 2024

@trixirt - can you please complete the CLA?

@@ -0,0 +1,28 @@
# Copyright (c) Tom Rix
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @trixirt - can you please run the formatting check (pre-commit run --all-files) - to pass that check on this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pre-commit errors out with

        File "<string>", line 22, in <module>
        File "/home/trix/.cache/pre-commit/repoyr3bl7h1/yapf/__init__.py", line 35, in <module>
          from yapf.yapflib import errors
        File "/home/trix/.cache/pre-commit/repoyr3bl7h1/yapf/yapflib/errors.py", line 16, in <module>
          from lib2to3.pgen2 import tokenize
      ModuleNotFoundError: No module named 'lib2to3'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Fedora/Rawhide is on python 3.13
The docs on lib2to3 say
removed from 3.13

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Running on 3.12 the license check fails because i believe this line
copyright check

It will pass if I use the Microsoft boilerplate.
There are examples of non Microsoft copyrights in the code, so I wonder how they passed this check.

Copy link
Contributor

Choose a reason for hiding this comment

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

@trixirt - our check requires there to be a license file on top of each file, we can use the standard Microsoft one here since that's most fitting here if you could add it? Or I can add a dummy test_rocm file with the header as well if that helps.

Copy link
Contributor

Choose a reason for hiding this comment

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

@trixirt - curious if you had any time to consider making these changes to pass the formatting check?

rocm_info = Path("/opt/rocm/bin/rocminfo")
if (not rocm_info.is_file()):
rocm_info = Path("rocminfo")
rocm_wavefront_size_cmd = str(rocm_info) + " | grep -Eo -m1 'Wavefront Size:[[:space:]]+[0-9]+' | grep -Eo '[0-9]+'"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should become available in torch.cuda.get_device_properties with pytorch/pytorch#128449

Copy link
Contributor

@jithunnair-amd jithunnair-amd left a comment

Choose a reason for hiding this comment

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

LGTM!

@trixirt
Copy link
Contributor Author

trixirt commented Jul 5, 2024

@microsoft-github-policy-service agree

Copy link
Contributor

@loadams loadams left a comment

Choose a reason for hiding this comment

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

Approving on behalf of @jithunnair-amd

@trixirt
Copy link
Contributor Author

trixirt commented Jul 17, 2024

Sorry for delay.
I took all the s2s formatting from the precommit checker as-is.

ROCm is packaged natively on Fedora. It's install location do not match
the AMD release.

So add some Fedora specific logic to find the ROCm version and use rocminfo
when attempts to use the AMD release fail.

Signed-off-by: Tom Rix <trix@redhat.com>
@trixirt
Copy link
Contributor Author

trixirt commented Jul 17, 2024

I have dropped the tests.

@loadams
Copy link
Contributor

loadams commented Jul 29, 2024

I have dropped the tests.

Understood, I'm still trying to confirm more about the copyright issue, but haven't made much progress yet. I appreciate the changes you've contributed though, and I'll work on getting this merged this week.

@loadams loadams added this pull request to the merge queue Jul 31, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 31, 2024
@loadams loadams merged commit 550f9c7 into microsoft:master Jul 31, 2024
11 checks passed
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.

3 participants