Skip to content

Fix build on AMD GPUs (related to DeepCompile) #7224

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

Merged
merged 1 commit into from
Apr 17, 2025

Conversation

HollowMan6
Copy link
Contributor

We should use torch.utils.cpp_extension.ROCM_HOME for ROCm pytorch.

  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "DeepSpeed/setup.py", line 195, in <module>
      builder.hipify_extension()
    File "DeepSpeed/op_builder/builder.py", line 750, in hipify_extension
      header_include_dirs=self.include_paths(),
                          ^^^^^^^^^^^^^^^^^^^^
    File "DeepSpeed/op_builder/dc.py", line 32, in include_paths
      return ['csrc/includes', os.path.join(torch.utils.cpp_extension.CUDA_HOME, "include")]
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<frozen posixpath>", line 76, in join
  TypeError: expected str, bytes or os.PathLike object, not NoneType

We should use `torch.utils.cpp_extension.ROCM_HOME`
for ROCm pytorch.

```log
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "DeepSpeed/setup.py", line 195, in <module>
      builder.hipify_extension()
    File "DeepSpeed/op_builder/builder.py", line 750, in hipify_extension
      header_include_dirs=self.include_paths(),
                          ^^^^^^^^^^^^^^^^^^^^
    File "DeepSpeed/op_builder/dc.py", line 32, in include_paths
      return ['csrc/includes', os.path.join(torch.utils.cpp_extension.CUDA_HOME, "include")]
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<frozen posixpath>", line 76, in join
  TypeError: expected str, bytes or os.PathLike object, not NoneType
```

Signed-off-by: Hollow Man <[email protected]>
@loadams loadams added this pull request to the merge queue Apr 17, 2025
@loadams loadams removed this pull request from the merge queue due to a manual request Apr 17, 2025
@loadams loadams added this pull request to the merge queue Apr 17, 2025
Merged via the queue into deepspeedai:master with commit 0f224d7 Apr 17, 2025
11 checks passed
@HollowMan6 HollowMan6 deleted the amd_build branch April 17, 2025 19:42
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