Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Chris Penner
    @ChrisPenner
    BTW export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" before stack build works :+1: , now trying llvm-9
    Chris Penner
    @ChrisPenner
    Everything's working great, just needed llvm-hs-9.0.1 👍
    Trevor L. McDonell
    @tmcdonell
    brilliant! have fun writing your app; let us know how it goes (:
    Alex Mouton
    @AlexMouton
    I have an Acc that runs on CPU but not GPU. any thoughts on how to progress?
    LLVM ERROR: Cannot select: 0x7fbf6047eb18: ch = AtomicStore<(store release 4 into %ir.26, addrspace 1)> 0x7fbf604807f8, 0x7fbf6047ebe8, Constant:i32<0>
      0x7fbf6047ebe8: i64,ch = CopyFromReg 0x7fbf60451958, Register:i64 %16
        0x7fbf6047f470: i64 = Register %16
      0x7fbf6047ee58: i32 = Constant<0>
    In function: permute_mutex
    Alex Mouton
    @AlexMouton
    ahh looks like my shapes arent good?
    Alex Mouton
    @AlexMouton
    Is there a way to lift Linear.V3 into Acc.Linear.V3? unsafeCoerce??
    Alex Mouton
    @AlexMouton
    let vec = A.fromList (A.Z A.:. 2) [AL.V3 1 1 1, AL.V3 0 0 0] ::  A.Array (A.Z A.:. Int) (AL.V3 Float)
    timeItNamed "cpu" $ print $ CPU.run $ A.filter (\_ -> A.lift True) (A.lift vec)
    timeItNamed "gpu" $ print $ GPU.run $ A.filter (\_ -> A.lift True) (A.lift vec)
    Alex Mouton
    @AlexMouton
    same for Tuples?
    Lars
    @sakehl
    @AlexMouton The code you provided seems to run OK for me, so that's the correct way to lift Linear.V3. I'm unsure about what you mean for tuples?
    This should work aswell:
    let vec2 = A.fromList (A.Z A.:. 2) [(1, 1, 1), (0, 0, 0)] ::  A.Array (A.Z A.:. Int) (Float, Float, Float)
    Lars
    @sakehl

    I have an Acc that runs on CPU but not GPU. any thoughts on how to progress?

    LLVM ERROR: Cannot select: 0x7fbf6047eb18: ch = AtomicStore<(store release 4 into %ir.26, addrspace 1)> 0x7fbf604807f8, 0x7fbf6047ebe8, Constant:i32<0>
      0x7fbf6047ebe8: i64,ch = CopyFromReg 0x7fbf60451958, Register:i64 %16
        0x7fbf6047f470: i64 = Register %16
      0x7fbf6047ee58: i32 = Constant<0>
    In function: permute_mutex

    About this, this is something I ran into recently as well, I believe this commit fixed it (ivogabe/accelerate-llvm@267ec25)

    Lars
    @sakehl
    Anyway, I made a pull request for it on the main-accelerate branch. Thus, for it to work, you will need to use the version on github (as soon as the pull request is accepted)
    Lars
    @sakehl
    (And a better way to time it, without the compilation overhead, would be like:
      let vec = A.fromList (A.Z A.:. 2) [(1, 1, 1), (0, 0, 0)] ::  A.Array (A.Z A.:. Int) (Float, Float, Float)
          funcC = CPU.runN $ A.filter (\_ -> A.lift True)
          funcG = GPU.runN $ A.filter (\_ -> A.lift True)
      evaluate funcC
      evaluate funcG
    
    
      timeItNamed "cpu" $ print $ funcC vec
      timeItNamed "gpu" $ print $ funcG vec
    Trevor L. McDonell
    @tmcdonell
    @AlexMouton @sakehl PR merged, thanks!
    @AlexMouton in the GitHub branch of linear-accelerate there are also pattern synonyms you can use, instead of lift and unlift
    and the base accelerate package has pattern synonyms for tuples as well, but these are named T2, T3 etc... (we can't reused the existing (,) syntax, unfortunately)
    (oh, the linear pattern synonyms are like V3_, V2_, etc.)
    Alex Mouton
    @AlexMouton
    rad thanks Lars, Trevor. Thats some service!!
    will take a look at HEAD for accelerate-linear and see if that clears it up for me
    Alex Mouton
    @AlexMouton
    I am trying to write a non-trivial acc program for a company hack day. Presentations are in ~5 hrs. wish me luck!
    Alex Mouton
    @AlexMouton
    ahh HEAD. like an expedition into the wilderness
    Alex Mouton
    @AlexMouton
    @sakehl do you have matching versions of acc-linear, llvm-hs to go with that? I am at head for everything now and its not looking happy at all
    e.g.
    linear-accelerate     >       Expected type: Exp (Plain (V3 a0))
    linear-accelerate     >         Actual type: Exp (V3 a)
    Alex Mouton
    @AlexMouton
    not even @tmcdonell private stash working for me?
    Trevor L. McDonell
    @tmcdonell
    ah, lift and unlift \:
    is this an error compiling linear-accelerate?
    Alex Mouton
    @AlexMouton
    yeah, Quaternion?
    Trevor L. McDonell
    @tmcdonell
    this stack.yaml should work:
    resolver: lts-14.16
    
    packages:
    - .
    
    extra-deps:
    - github: tmcdonell/accelerate
      commit: 2693873fbf7f94ee408d9f2017ff47251ee064ef
    
    - github: tmcdonell/accelerate-llvm
      commit: 0f92cd6ad324f87378bffbb9b74bbd0722cee417
      subdirs:
        - accelerate-llvm
        - accelerate-llvm-native
        - accelerate-llvm-ptx
    
    - github: tmcdonell/linear-accelerate
      commit: 2f4dfe92854f53c2aac9be51c9da25899a659273
    
    # Override default flag values for local packages and extra-deps
    flags:
      accelerate:
        debug: true
    (you can probably change the resolver, it's just one I copy/pasted from a project)
    Alex Mouton
    @AlexMouton
    looks like this is working out! thanks Trevor
    i am on llvm-config 9. is that an issue?
    Trevor L. McDonell
    @tmcdonell
    Add this in the extra-deps section and it should be fine:
    - llvm-hs-9.0.1
    - llvm-hs-pure-9.0.0
    Alex Mouton
    @AlexMouton
    closer now but failing in linker. bah.
    accelerate-llvm...downcast1.... FSub_closure/FAdd_closure
    (Thanks for all the help btw)
    Trevor L. McDonell
    @tmcdonell
    in the linker? that's weird...
    what's your platform etc.? I haven't seen that error before...
    Alex Mouton
    @AlexMouton
    fedora 31
    HP dual xeon, Nvidia 1070
    Trevor L. McDonell
    @tmcdonell
    I haven't used fedora in a while. what's the full error?
    Alex Mouton
    @AlexMouton
    @sakehl in your precompiled example you are calling evaluate seemingly out in space, and I didnt need it to do the same locally. is that necessary somehow?
    Lars
    @sakehl
    Ah yes, I got it from the Control.Exception library. And no it's not necessary to do, but it forces to do the compilation of the program, so you don't time it.
    But it works without it as well, but then the first time the function is called it will compile and take some additional time.
    Alex Mouton
    @AlexMouton
    ah ok so thats the sauce there. thanks
    Lars
    @sakehl
    Btw, you can also compile the function at Haskell compile time, with runQ (see https://hackage.haskell.org/package/accelerate-llvm-ptx-1.1.0.1/docs/Data-Array-Accelerate-LLVM-PTX.html#v:runQ), to get rid of any compile overhead at runtime
    Alex Mouton
    @AlexMouton
    Screen Shot 2020-02-28 at 1.11.32 PM.png
    Thanks everyone for the help, I hope I can get my libs lined up and have this run soon.
    Jonathan Fraser
    @JonathanFraser
    well this is a thing
    looks to have a bunch of documentation for the AMD GPU chain