Announcement

Collapse
No announcement yet.

LLVM's HIPSPV Coming Together For AMD HIP To SPIR-V For OpenCL Execution

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LLVM's HIPSPV Coming Together For AMD HIP To SPIR-V For OpenCL Execution

    Phoronix: LLVM's HIPSPV Coming Together For AMD HIP To SPIR-V For OpenCL Execution

    Last week I wrote about the interesting HIPSPV back-end for LLVM to take AMD HIP code -- which generally starts off as NVIDIA CUDA code to begin with before the HIP-ification -- and to be able to output that from the LLVM compiler stack as the SPIR-V intermediate representation used across OpenCL and Vulkan drivers. The goal with this is to be able to take AMD HIP code and ultimately be able to run it on Intel graphics processors but potentially other vendors/drivers too given the vendor-neutral SPIR-V. More of that HIPSPV work is now hitting mainline LLVM...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    So many layers...

    CUDA to HIP to LLVM IR to SPIR-V to TGSI to NIR to LLVM IR to AMD architecture to graphics card...

    Comment


    • #3
      This is going to scare the sh_t out of end users. Will there be any one on earth able to debug this when it goes wrong? This has fail written all over it.

      Comment


      • #4
        Can't compute be done with Vulkan API or with a few more extensions added to it ?
        I mean AMD pretty much invented Vulkan, can't they just add a few more extensions to it for the compute part like somebody is doing for the video (de|en)code part ?

        Comment


        • #5
          Originally posted by tildearrow View Post
          So many layers...

          CUDA to HIP to LLVM IR to SPIR-V to TGSI to NIR to LLVM IR to AMD architecture to graphics card...
          Is there not a direct PTX -> SPIR-V path? That would be the most logical approach, assuming there are no huge gotchas.

          (PTX is CUDA's own native IR)

          Comment


          • #6
            Originally posted by Danny3 View Post
            Can't compute be done with Vulkan API or with a few more extensions added to it ?
            I mean AMD pretty much invented Vulkan, can't they just add a few more extensions to it for the compute part like somebody is doing for the video (de|en)code part ?
            Technically yes, and it has been done (NCNN is able to use Vulkan Compute for example).
            The only problem is that it is harder to code using Vulkan than CUDA (like lack of structs)...

            Comment


            • #7
              Originally posted by Danny3 View Post
              Can't compute be done with Vulkan API or with a few more extensions added to it ?
              I just answered this same point in the previous thread on this project. You can see my reply, there:

              Phoronix: LLVM Working On "HIPSPV" So AMD HIP Code Can Turn Into SPIR-V And Run On OpenCL Upstreaming progress is being made on a new "HIPSPV" toolchain for AMD's HIP path so that SPIR-V kernels can be executed and ultimately allowing for execution by OpenCL drivers. This HIPSPV effort driven outside of AMD


              Originally posted by Danny3 View Post
              I mean AMD pretty much invented Vulkan, can't they just add a few more extensions to it for the compute part
              Perhaps, but it was created primarily as a graphics API.

              The main issue with supporting compute APIs, like OpenCL, isn't that it's a big deal for vendors to implement, which is the problem you seem interested in solving.

              Look at it this way: if you're Nvidia, why would you willingly implement any Vulkan extensions that enable people to circumvent CUDA for compute workloads? Same thing with AMD and HIP.

              Comment


              • #8
                Originally posted by tildearrow View Post
                Technically yes, and it has been done (NCNN is able to use Vulkan Compute for example).
                NCNN isn't a great example, since deep learning has almost uniquely low precision requirements. As such, it's more the exception than the rule.

                Comment


                • #9
                  Originally posted by tildearrow View Post
                  So many layers...

                  CUDA to HIP to LLVM IR to SPIR-V to TGSI to NIR to LLVM IR to AMD architecture to graphics card...
                  There's always the ROCm stack... CUDA to HIP (pretty much 1:1) to LLVM IR (inside the compiler) to hardware ISA.

                  HIPSPV is about running HIP code on non-AMD and non-CUDA hardware.
                  Last edited by bridgman; 21 December 2021, 01:53 PM.
                  Test signature

                  Comment


                  • #10
                    Originally posted by coder View Post


                    Look at it this way: if you're Nvidia, why would you willingly implement any Vulkan extensions that enable people to circumvent CUDA for compute workloads? Same thing with AMD and HIP.
                    If I'm AMD I'd be able to get rid of all the ROCm nonsense and support GPU computation on all of its graphics cards rather than the tiny minority ROCm currently supports. This would keep AMD loyalists like me (who has never owned a an Intel processor in his life and been using AMD CPUs since the 5x86-133 and ATI/AMD GPUs since the All-In-Wonder) from being sorely tempted to get an NVIDIA card once it's cheaper to buy a GPU than a house again.

                    Comment

                    Working...
                    X