[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: remaining issues for pytorch-rocm



Hi Mo,

On 2024-10-12 13:43, Cordell Bloor wrote:
On 2024-10-12 10:27, Mo Zhou wrote:
And it seems that the roctracer is missing since it needs roctx.h
On salsa roctracer was packaged but not yet uploaded:
https://salsa.debian.org/rocm-team/roctracer/-/blob/master/debian/changelog?ref_type=heads

Do you need help here?

Yes, roctracer is one of the items listed as "help needed" [1].

roctracer is a small library that will need to be packaged to enable GPU profiling. For this, it needs to be ported from the deprecated cppheaderparser to the newer cxxheaderparser, which is available in Debian as python3-cxxheaderparser.

I was reviewing the roctracer library and I noticed that cppheaderparser is used to generate header files libroctracer, but they do not seem to be needed for libroctx. This introduces a new option, which I've described in (4) below.

Let's consider some possible solutions:

  1. Patch all calls to roctx from PyTorch out of the Debian sources
    This is the most expedient solution for getting pytorch-rocm uploaded and a patch to upstream that made roctx optional might be well-received. However, the PyTorch binaries distributed through PyPI are still going to require roctx, so this only fixes the problem for users of the Debian package and users that build PyTorch from source. That is probably a small fraction of users, so this is not a complete solution.
  2. Update roctracer to use python3-cxxheaderparser
    This is the best solution, but it didn't look easy. I only gave it a cursory examination, though.
  3. Vendor cppheaderparser in roctracer
    The deprecated cppheaderparser library could be vendored until roctracer has successfully migrated to python3-cxxheaderparser. While I am not a huge fan of this solution, it's difficult to imagine any major problems due to this vendoring. The deprecated python library is used only at package build time for parsing the HIP headers. There is no run-time dependency and it only operates on trusted input controlled by the Debian ROCm Team.
  4. Patch src:roctracer to build only bin:libroctx64-4 and bin:libroctx-dev
    PyTorch only needs roctx, but roctx doesn't need cppheaderparser. If you patch roctracer to build only roctx, then the part that PyTorch needs could be packaged for Debian without requiring all of roctracer.

Honestly, any of these seem like reasonable solutions. You could also do (1) in combination with any other option.

Sincerely,
Cory Bloor


Reply to: