Skip to content

Fix PyTorch ROCm library linking - #10826

Closed
EmanueleCoradin wants to merge 1 commit into
cms-sw:IB/CMSSW_20_1_X/masterfrom
EmanueleCoradin:amd-support
Closed

Fix PyTorch ROCm library linking#10826
EmanueleCoradin wants to merge 1 commit into
cms-sw:IB/CMSSW_20_1_X/masterfrom
EmanueleCoradin:amd-support

Conversation

@EmanueleCoradin

Copy link
Copy Markdown

PR description

This PR adds two additional linker settings:

  • FORCE_LINK ensures that the ROCm backend library is kept in the final dependency chain even when no symbol from it is referenced directly.
  • -L$TOOL_BASE/lib gives priority to the libraries shipped with the ROCm PyTorch package when linking a ROCm target. This ensures that libtorch_hip, libtorch_cpu, libc10, etc. all come from the same ROCm PyTorch build, instead of accidentally mixing ROCm-specific libraries with the generic PyTorch libraries.

@cmsbuild

cmsbuild commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

cms-bot internal usage

@EmanueleCoradin

Copy link
Copy Markdown
Author

type ngt

@cmsbuild cmsbuild added the ngt label Sep 3, 2026
@fwyzard

fwyzard commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@EmanueleCoradin can you drop [NGT] from the PR title ?

Comment thread scram-tools.file/tools/py3-torch-rocm/pytorch-rocm.xml
@EmanueleCoradin EmanueleCoradin changed the title [NGT] Fix PyTorch ROCm library linking Fix PyTorch ROCm library linking Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants