• ananas@sopuli.xyz
    link
    fedilink
    arrow-up
    2
    ·
    1 年前

    That page makes Firefox’s Reader mode really worth its weight in gold, but the content is interesting.

    Has anyone used MLIR for anything yet?

    • TheLinuxGuy
      link
      fedilink
      English
      arrow-up
      2
      arrow-down
      1
      ·
      edit-2
      1 年前

      Yup, been writing a new shader language to replace GLSL and HLSL for Vulkan Compute purposed, but I eventually switch from SPIR-V IR to MLIR and use IREE Compiler which accepts the MLIR and compile it to any of CUDA, ROCm, SPIR-V and so forth.

      A lot of it was because of my unadulterated hatred toward our current Machine Learning Frameworks...

      It’s one of the project that I’ve been working on to outright replace Pytorch/Tensorflow and ban those two framework from my office forever. I got fed up not knowing how much exactly do I need in memory allocation, computational cost, and so forth when running or training neural net models. Plus I want an easier way to split the model across lower-end GPU too that doesn’t rely on Nvidia-only GPU for CUDA code. I also wanted to have SPIR-V as a fallback compute kernel, because if CUDA/ROCm is too new for GPU, you’re SOL, but if you have SPIR-V, chances are, any GPU made in the last 10 years that have a Vulkan Driver, would likely be supported.

      One of the biggest plus with MLIR is that you are also future proofing your code, because that code could feasibly be recompiled for new devices like Neural Net accelerator cards, ASIC, FPGA, and so forth.

      • ananas@sopuli.xyz
        link
        fedilink
        arrow-up
        2
        ·
        1 年前

        Interesting, I definitely need to check out MLIR stuff more. I’ve always been a bit dissuaded that it’s one more step in my IR -> MLIR -> LLVM chain, but ability to compile it to multiple GPUs is a very good selling point.

        • TheLinuxGuy
          link
          fedilink
          English
          arrow-up
          1
          arrow-down
          1
          ·
          1 年前

          Yeah, MLIR is more or less an “IR with Dialects”, a lot of IR language spec share a lot in common with one another, so MLIR try to standardize that similarity between IR. Because of that feature, it reduce amount of IR code that developer have to worry about and they can progressively expand the available dialects for MLIR as they develop a compiler like IREE.

          • ananas@sopuli.xyz
            link
            fedilink
            arrow-up
            2
            ·
            1 年前

            Yeah, MLIR is more or less an “IR with Dialects”, a lot of IR language spec share a lot in common with one another, so MLIR try to standardize that similarity between IR

            Oh, shit, that sounds like C all over again, just for GPUs this time.

            But that note aside, definitely sounds like something I need to learn more about.

            • TheLinuxGuy
              link
              fedilink
              English
              arrow-up
              2
              arrow-down
              1
              ·
              1 年前

              Lol, that one way to put it. Basically a language convergence, not a bad thing to be honest.