Skip to content

Add both absolute and relative rocm paths to include clang headers#3195

Open
hsharsha wants to merge 4 commits intor2.18-rocm-enhancedfrom
r2.18-fix-clang-headers-include
Open

Add both absolute and relative rocm paths to include clang headers#3195
hsharsha wants to merge 4 commits intor2.18-rocm-enhancedfrom
r2.18-fix-clang-headers-include

Conversation

@hsharsha
Copy link
Copy Markdown

Motivation

On MI355 with new 7.1.1 and 7.2 docker images TF 2.18 fails to build with clang include path not found. Adding rocm relative path /opt/rocm is not sufficient as it looks for absolute path as well.

Technical Details

Add both relative and absolute paths for clang headers to be included

Submission Checklist

Copy link
Copy Markdown
Collaborator

@i-chaochen i-chaochen left a comment

Choose a reason for hiding this comment

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

Seems CI still has these build errors?

[2026-03-13T01:22:02.471Z] //tensorflow/compiler/mlir/tools/kernel_gen/tests:buffer_deallocation.mlir.test FAILED TO BUILD
[2026-03-13T01:22:02.471Z] //tensorflow/compiler/mlir/tools/kernel_gen/tests:buffer_reuse.mlir.test FAILED TO BUILD
[2026-03-13T01:22:02.471Z] //tensorflow/compiler/mlir/tools/kernel_gen/tests:bufferize.mlir.test FAILED TO BUILD
[2026-03-13T01:22:02.471Z] //tensorflow/compiler/mlir/tools/kernel_gen/tests:copy_cleanup.mlir.test FAILED TO BUILD
[2026-03-13T01:22:02.471Z] //tensorflow/compiler/mlir/tools/kernel_gen/tests:embed_tf_framework.mlir.test FAILED TO BUILD
[2026-03-13T01:22:02.471Z] (Skipping other failed to build tests)

@i-chaochen i-chaochen requested a review from alekstheod March 13, 2026 09:23
@hsharsha
Copy link
Copy Markdown
Author

Failures are due to

# Configuration: 220b3b198b74c1f779fd5797602095dbe99c565ac10f4f60431d7f246d347cb6
# Execution platform: @local_execution_config_platform//:platform
external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:963:10: fatal error: 'amdgpu_device_lib_data.inc' file not found
  963 | #include "amdgpu_device_lib_data.inc"
      |   

related to embedded device libs. Looks like data is not generated.

@hsharsha
Copy link
Copy Markdown
Author

@alekstheod Looks like r2.18 still has a mix of gcc and clang support. So -no-canonical-prefixes doesn't seems to work.

@hsharsha
Copy link
Copy Markdown
Author

This happens because config=rocm is not passed to cpu tests

@i-chaochen
Copy link
Copy Markdown
Collaborator

# Configuration: 220b3b198b74c1f779fd5797602095dbe99c565ac10f4f60431d7f246d347cb6
# Execution platform: @local_execution_config_platform//:platform
external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:963:10: fatal error: 'amdgpu_device_lib_data.inc' file not found
  963 | #include "amdgpu_device_lib_data.inc"
      |   

we shouldn't not run these gpu related tests in our CPU pipeline, isn't? I thought we already fixed this issue before?

@mmakevic-amd does it ring any bell?

@hsharsha
Copy link
Copy Markdown
Author

# Configuration: 220b3b198b74c1f779fd5797602095dbe99c565ac10f4f60431d7f246d347cb6
# Execution platform: @local_execution_config_platform//:platform
external/local_xla/xla/service/gpu/llvm_gpu_backend/gpu_backend_lib.cc:963:10: fatal error: 'amdgpu_device_lib_data.inc' file not found
  963 | #include "amdgpu_device_lib_data.inc"
      |   

we shouldn't not run these gpu related tests in our CPU pipeline, isn't? I thought we already fixed this issue before?

@mmakevic-amd does it ring any bell?

These were marked manual and the code is refactored in r2.19 and above into amdgpu_backend.cc. For r2.18 it is still part of llvm_backend_lib.cc. This can be fixed for r2.18 passing config=rocm so that if_rocm_configured path in bazel is taken.

@hsharsha hsharsha force-pushed the r2.18-fix-clang-headers-include branch from 240e421 to 395c6b3 Compare March 13, 2026 14:31
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.

2 participants