22 comments

  • MarcLore4 hours ago
    Bypassing CPU for NVMe-to-GPU transfer is clever. The bottleneck for running large models locally has always been the memory hierarchy — this essentially treats NVMe as extended VRAM with direct DMA.<p>I wonder how this compares to Apple&#x27;s unified memory approach on M-series chips for similar workloads. The M4 Max can fit 70B models entirely in memory without any offloading tricks, though at lower throughput than a 3090.<p>Would be interesting to see comparative benchmarks: this NVMe approach on a 3090 vs M4 Max native, especially for batch inference where the NVMe latency might be amortized.
    • xaskasdf1 hour ago
      I got an m3, I will test it on metal and check how it goes
  • 0110001113 hours ago
    Yeah, GPUdirect should allow you to dma straight to a storage device.<p>I wonder... what if the m.2 storage was actually DRAM? You probably don&#x27;t need persistence for spilling a model off the GPU. How would it fare vs just adding more host memory? The m.2 ram would be less flexible, but would keep the system ram free for the CPU.
    • javchz12 hours ago
      Yeah a ramdisk would probably work wonders. It&#x27;s a shame Intel optane didn&#x27;t became a standard, those type of workflows would be amazing for it.
      • xaskasdf30 minutes ago
        Ya know, here on the local market there are a bunch of optanes hanging around, I&#x27;ll try to manage one to check if there&#x27;s any improvement
      • TechSquidTV11 hours ago
        Ahhh damn it. Intel! Come back!
    • lmeyerov7 hours ago
      This is exactly what I was wondering<p>I gave a talk a few years ago at dask summit (conf?) on making the stars align with dask-cudf here. We were helping a customer accelerate log analytics by proving out our stack for nodes that look roughly like: parallel ssd storage arrays (30 x 3 GB&#x2F;s?) -&gt; GPUDirect Storage -&gt; 4 x 30 GB&#x2F;s PCIe (?) -&gt; 8 x A100 GPUs, something like that. It&#x27;d be cool to see the same thing now in the LLM world, such as a multi-GPU MoE, or even a single-GPU one for that matter!
    • ElectricalUnion10 hours ago
      Isn&#x27;t m.2 storage but DRAM - hopefully, meaning NVMe&#x2F;PCIe not SATA speed - already exists as Compute Express Link (CXL), just not in this specific m.2 form factor? If only RAM wasn&#x27;t silly expensive right now, one could use 31GB&#x2F;s of additional bandwidth per NVMe connector.
  • umairnadeem12311 hours ago
    0.2 tok&#x2F;s is slow for chat but perfectly fine for batch&#x2F;async workloads. I run automated content generation pipelines where a single job kicks off dozens of LLM calls (script generation, metadata, descriptions) and none of them need to be interactive. The whole job takes 20 minutes anyway because of image generation bottlenecks. Being able to run a 70B model locally for those batch calls instead of paying per-token API costs would be a significant cost reduction, even at this speed.
    • esquire_90010 hours ago
      Cost wise it does not seem very effective. .5 token &#x2F; sec (the optimized one) is 3600 tokens an hour, which costs about 200-300 watts for an active 3090+system. Running 3600 tokens on open router @.4$ for llama 3.1 (3.3 costs less), is about $0,00144. That money buys you about 2-3 watts (in the Netherlands).<p>Great achievement for privacy inference nonetheless.
      • teo_zero9 hours ago
        I think we use different units. In my system there are 3600 seconds per hour, and watts measure power.
        • IsTom6 hours ago
          OP probably means watt-hours.
          • dotancohen51 minutes ago
            And 0.5 tokens&#x2F;s should work out to 1800 tokens at the end of the hour. Not 3600 as stated.
      • qoez3 hours ago
        Open router is highly subsidized. This might be cheaper in the long run once these companies shift to taking profits
      • Aerroon10 hours ago
        Something to consider is that input tokens have a cost too. They are typically processed much faster than output tokens. If you have long conversations then input tokens will end up being a significant part of the cost.<p>It probably won&#x27;t matter much here though.
      • thatwasunusual5 hours ago
        &gt; Cost wise it does not seem very effective.<p>Why is this so damn important? Isn&#x27;t it more important to end up with the best result?<p>I (in Norway) use a homelab with Ollama to generate a report every morning. It&#x27;s slow, but it runs between 5-6 am, energy prices are at a low, and it doesn&#x27;t matter if it takes 5 or 50 minutes.
    • eleventyseven9 hours ago
      Are you taking into account energy costs of running a 3090 at 350 watts for a very long time?
      • teaearlgraycold4 hours ago
        I doubt it’s at full TDP if it’s running at 0.2 tokens per second.
        • xaskasdf40 minutes ago
          Actually I can&#x27;t go full tdp with a 650w PSU, I got to upgrade it asap
      • ekianjo7 hours ago
        You can run a RTX3090 at 250w and still get a lot of its performance with nvidia-smi.
  • randomtoast16 hours ago
    0.2 tok&#x2F;s is fine for experimentation, but it is not interactive in any meaningful sense. For many use cases, a well-quantized 8B or 13B that stays resident will simply deliver a better latency-quality tradeoff
    • xaskasdf14 hours ago
      yeah, actually I wanted to see if this was possible at all. I managed to get around 3000 tokens&#x2F;s on a ps2 with classic transformers, since the emotion engine is capable of 32 bit addresses, but it has like 32gb of ram. So I ran into the question of why was that fast and I couldn&#x27;t get that speed even with small models, and the deal is that the instructions went right of the memory to the gpu and that&#x27;s the main difference that does when a regular computer does inference: it has to request the instructions to the cpu every time. As I mentioned too, on professional cards you can avoid these problems naturally, since they got instructions precisely for this, but sadly I don&#x27;t have 30k bucks to spare on a gpu :(
      • derstander14 hours ago
        *32MB of RAM (plus 4MB of video RAM and a little sound and IOP memory).
      • eleventyseven9 hours ago
        &gt; I don&#x27;t have 30k bucks to spare on a gpu :(<p>Do you have $2&#x2F;hr to rent an RTX 6000 96GB or $5&#x2F;hr for B200 180GB on the cloud?
        • xaskasdf37 minutes ago
          I thought about that, but idk if they allow me to modify the linux kernel and nvidia cuda kernel at all
        • superkuh9 hours ago
          I&#x27;d rather not give money to scalper barons if I can avoid it. Fab capacity is going to that for rental rather than hardware for humans.
      • anoncow11 hours ago
        3000 tokens per sec on 32 mb Ram?
        • fc417fc80210 hours ago
          fast != practical<p>You can get lots of tokens per second on the CPU if the entire network fits in L1 cache. Unfortunately the sub 64 kiB model segment isn&#x27;t looking so hot.<p>But actually ... 3000? Did GP misplace one or two zeros there?
    • Wuzado15 hours ago
      I can imagine a couple scenarios in which a high-quality, large model would be much preferred over lower latency models, primarily when you need the quality.
    • fluoridation11 hours ago
      That&#x27;s slower than just running it off CPU+GPU. I can easily hit 1.5 tokens&#x2F;s on a 7950X+3090 and a 20480-token context.
    • tyfon16 hours ago
      I didn&#x27;t really understand the performance table until I saw the top ones were 8B models.<p>But 5 seconds &#x2F; token is quite slow yeah. I guess this is for low ram machines? I&#x27;m pretty sure my 5950x with 128 gb ram can run this faster on the CPU with some layers &#x2F; prefill on the 3060 gpu I have.<p>I also see that they claim the process is compute bound at 2 seconds&#x2F;token, but that doesn&#x27;t seem correct with a 3090?
      • tgrowazay15 hours ago
        LLM speed is roughly &lt;memory_bandwidth&gt; &#x2F; &lt;model_size&gt; tok&#x2F;s.<p>DDR4 tops out about 27Gbs<p>DDR5 can do around 40Gbs<p>So for 70B model at 8 bit quant, you will get around 0.3-0.5 tokens per second using RAM alone.
        • uf00lme14 hours ago
          Channels matter a lot, quad channel ddr4 is going to beat ddr5 in dual channel most of the time.
          • wtallis13 hours ago
            Four channels of DDR4-3200 vs two channels of DDR5-6400 (four subchannels) should come out pretty close. I don&#x27;t see any reason why the DDR4 configuration would be consistently faster; you <i>might</i> have more bank groups on DDR4, but I&#x27;m not sure that would outweigh other factors like the topology and bandwidth of the interconnects between the memory controller and the CPU cores.
        • someguy202615 hours ago
          DRAM speeds is one thing, but you should also account for the data rate of the PCIe bus (and&#x2F;or VRAM speed). But yes, holding it &quot;lukewarm&quot; in DRAM rather than on NVMe storage is obviously faster.
        • vlovich12315 hours ago
          Faster than the 0.2tok&#x2F;s this approach manages
        • zozbot23415 hours ago
          Should be active param size, not model size.
        • xaskasdf14 hours ago
          yeah, actually, I&#x27;m bottlenecked af since my mobo got pcie3 only :(
  • davideom04142 hours ago
    Really interesting experiment i should have done this before Do you have numbers on effective throughput vs PCIe theoretical bandwidth? I’m curious whether this is primarily latency-bound or bandwidth-bound in practice Can some tell me??
    • xaskasdf34 minutes ago
      Actually is purely bandwidth-bound, the major bottleneck of the whole process, for me in this case, is the B450 mobo I got that&#x27;s only capable of pcie3 and 1x8 in the pcie lanes for gpu instead of 1x16; so I&#x27;m capped until I get an X570 maybe. I should get around twice or triple the tok speed with that upgrade alone
  • 7777777phil3 hours ago
    Cool hack but 0.5 tok&#x2F;s on 70B when a 7B does 30+ on the same card. NVIDIA&#x27;s own research says 40-70% of agentic tasks could run on sub-10B models and the quality gap has closed fast.
  • jacquesm13 hours ago
    This is an interesting area for experiments. I suspect that in the longer term model optimization (knowing which bits you can leave out without affecting the functioning of the model) will become the dominant area of research just like it did with compression algorithms because effectively a model <i>is</i> a lossy compression scheme.<p>And that&#x27;s good because that increases democratization of AI away from the silos that are being created.
    • serendip-ml9 hours ago
      The compression analogy is interesting. Another way of looking at it could be fine-tuning as &quot;knowing what to leave out&quot; - a 3B model for example tuned for a narrow task doesn&#x27;t need the capacity that makes 70B good at many things.
  • civicsquid10 hours ago
    Really cool. I&#x27;m wondering: what background did you need to be able to think of the question that resulted in this project?<p>I know you said you&#x27;re involved in some retrogaming and were experimenting, but as someone who works in a world where hardware is pretty heavily abstracted away, even if I got into retrogaming I don&#x27;t know that I&#x27;d consider that there may be a systems improvement lying around. Beyond the creative aspect, it feels like there is some systems and hardware background that helped put the idea together (and I&#x27;d be interested to go learn about of that systems&#x2F;hardware knowledge myself).
    • xaskasdf1 hour ago
      This was the experiment itself <a href="https:&#x2F;&#x2F;github.com&#x2F;xaskasdf&#x2F;ps2-llm" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;xaskasdf&#x2F;ps2-llm</a><p>The idea was basically to run a llm on a ps2, then I ran into some problems as the 32mb ram cap with 4mb vram cap; so I had to figure out a way to stream layers on the forward pass. Given that ps2 manages to give instructions directly to the vram that&#x27;s capable of 32bit addresses, it gave an insane amount of tok&#x2F;s, then I wondered if I could do the same on my puter
    • rustyhancock9 hours ago
      I wonder too, DMA plays a huge role in most older gaming consoles when the CPUs were far more sluggish.<p>Perhaps that&#x27;s what made them think to try.<p>Perhaps the current batch of smart memory cards which on the PS2 I believe have quite complex DMA capabilities to stream from the SD card game data.
      • charcircuit8 hours ago
        Why not the PS5? That&#x27;s when games started streaming assets straight from the NVME SSD to the GPU. In this case the assets are weights.
        • xaskasdf1 hour ago
          Actually I&#x27;m thinking about buyin an AMD BC-250 that&#x27;s bassically a ps5 with pcie factor format; and it&#x27;s linux capable by default, maybe next month
  • rl315 hours ago
    Nice. I&#x27;ve been looking at doing something similar, more on the order of running a 1T model with less than half the available VRAM.<p>One workup indicated it was theoretically possible to modify a piece of SGLang&#x27;s routing layer to support JIT predict-ahead expert swaps from Gen5 NVMe storage straight into GPU memory.<p>I&#x27;m hoping that proves true. The setup relies on NVIDIA Dynamo, so NIXL primitives are available to support that.<p>Curious if anyone&#x27;s tried this already.
    • xaskasdf14 hours ago
      That would be nice to see. Actually I was thinking about getting another 3090 and a mobo upgrade since I&#x27;m bottlenecked by pcie3 to tryna run glm 4.7 or 5 at q4_k_m, it should be possible.
  • Aurornis9 hours ago
    Cool project. Can you provide more details about your DKMS patching process for consumer GPUs? This would be fun to try out, but I’d need some more details on that patch process first.
    • xaskasdf53 minutes ago
      I updated the documentation to provide more info for the patching process, I added the patches themselves too and provided some risk info about the patches
    • Maxious6 hours ago
      the nvidia open source driver has been modded previously to unlock enterprise paywalled features like p2p gpu comms <a href="https:&#x2F;&#x2F;blog.chlc.cc&#x2F;p&#x2F;rtx4090-p2p-unlocked" rel="nofollow">https:&#x2F;&#x2F;blog.chlc.cc&#x2F;p&#x2F;rtx4090-p2p-unlocked</a> and vGPU splitting <a href="https:&#x2F;&#x2F;open-iov.org&#x2F;index.php&#x2F;VGPU_Unlock" rel="nofollow">https:&#x2F;&#x2F;open-iov.org&#x2F;index.php&#x2F;VGPU_Unlock</a>
  • stuaxo4 hours ago
    Interesting. Can AMD GPUs do direct io like this?
  • Wuzado15 hours ago
    I wonder - could this be used for multi-tier MoE? Eg. active + most used in VRAM, often used in RAM and less used in NVMe?
    • rao-v15 hours ago
      Yeah I’ve often wondered why folks aren’t training two tier MoEs for VRAM + RAM. We already have designs for shared experts so it cannot be hard to implement a router that allocated 10x or 100x as often to “core” experts vs the “nice to have” experts. I suppose balancing during training is tricky but some sort of custom loss on the router layers should work.<p>I’ve also wondered why the routers aren’t training to be serially consistent so you can predict layers to swap into VRAM a few layers ahead to maximize available bandwidth.
      • reitzensteinm15 hours ago
        I think part of the issue is that in production deployments, you&#x27;re batching high enough that you&#x27;ll be paging in those long tail experts constantly.<p>Unless you&#x27;re handing that in some kind of fancy way, you&#x27;ll be holding up the batch while waiting for host memory which will kill your throughout.<p>It makes much more sense for non batched local inference, especially if you can keep the MoE routing stable like you say, but most folks aren&#x27;t optimising for that.
        • zozbot23415 hours ago
          Ideally, you should rearrange batches so that inference steps that rely on the same experts get batched together, then inferences that would &quot;hold up&quot; a batch simply wait for that one &quot;long tail&quot; expert to be loaded, whereupon they can progress. This might require checkpointing partial inference steps more often, but that ought to be doable.
          • reitzensteinm14 hours ago
            I think this is doable for very long tail experts that get swapped in for specialised topics - say, orbital mechanics.<p>But for experts that light up at, say, 1% frequency per batch, you&#x27;re doing an awful lot of transfers from DRAM which you amortize over a single token, instead of reads from HBM which you amortize over 32 tokens.
      • svnt15 hours ago
        Maybe I am misunderstanding something but:<p>1) This is basically the intention of several recent MoE models: keep particular generally useful experts hot in VRAM.<p>2) Unless you can swap layers in faster than you consume them there is no point to predicting layers (what does this even really mean? did you mean predicting experts?).<p>It seems at the moment the best you can do is keep experts and layers more likely to be used for a given query in VRAM and offload the rest, but this is work-dependent.
      • hedgehog15 hours ago
        I don&#x27;t have links handy but there is active research in this area.
  • throwaway202716 hours ago
    Didn&#x27;t DirectX add an API for loading assets directly to GPU memory? Would that work?
    • someguy202616 hours ago
      My impression is that that is limited to assets and really needs to fit into the DirectX framework. From what I can tell, the gpu-nvme-direct is mostly similar to <a href="https:&#x2F;&#x2F;github.com&#x2F;enfiskutensykkel&#x2F;ssd-gpu-dma" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;enfiskutensykkel&#x2F;ssd-gpu-dma</a> and <a href="https:&#x2F;&#x2F;github.com&#x2F;ZaidQureshi&#x2F;bam" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ZaidQureshi&#x2F;bam</a>
      • xaskasdf12 hours ago
        Actually this idea was fueled by those since I went to check if there was anything near to what I wanted to achieve, pretty useful tho
        • jonassm6 hours ago
          nvmlib&#x2F;ssd-gpu-dma and BaM (based on the same code base) are pretty cool as they allow you to initiate disk reads&#x2F;writes directly from a CUDA kernel (so not only reading&#x2F;writing directly to GPU memory but also allowing the GPU to initiate IO on its own). Sometimes called GPU-initiated I&#x2F;O or accelerator-initiated I&#x2F;O.
  • exabrial14 hours ago
    I feel like we need an entirely new type of silicon for LLMs. Something completely focused on bandwidth and storage probably at the sacrifice of raw computation power.
    • garethsprice2 hours ago
      Something like this? (Llama 3.1-8B etched into custom silicon delivering 16,000 tok&#x2F;s, doesn&#x27;t use much PCIe bandwidth):<p>- <a href="https:&#x2F;&#x2F;taalas.com&#x2F;the-path-to-ubiquitous-ai&#x2F;" rel="nofollow">https:&#x2F;&#x2F;taalas.com&#x2F;the-path-to-ubiquitous-ai&#x2F;</a> - <a href="https:&#x2F;&#x2F;chatjimmy.ai&#x2F;" rel="nofollow">https:&#x2F;&#x2F;chatjimmy.ai&#x2F;</a>
      • exabrial23 minutes ago
        Wowsa that’s amazing! Exactly what I was imagining. To do that with 2500 watts is incredible.
  • spwa45 hours ago
    I&#x27;ve often wondered doing this with extreme compression. What if you did extreme compression + decompression on the GPU? Because you&#x27;re leaving a lot of compute unused.
    • xaskasdf55 minutes ago
      I did it, but with different quantization compressions, It ran into quality issues, I will try to rerun with the same quants if that fixes the issue, but the most that looks unused, its being used by rotating layers that are being swapped by the cpu from the ram itself, that manages to keep layers warm, ready to use while inferencing and discarding already used ones
    • nathan_compton34 minutes ago
      I&#x27;m not sure, but I suspect that LLM weights don&#x27;t compress all that well. The intuition here is that training an LLM <i>is</i> compression of the training data into the weights, so they are probably very information dense already. Can&#x27;t squeeze them down much.
  • sylware6 hours ago
    Isn&#x27;t that linux DMA buf?
  • timzaman8 hours ago
    Umm sorry but the cpu can easily keep up shuttling around to&#x2F;from your nvme. Especially ancient gen3 pcie. Not sure why ud do this.
    • xaskasdf57 minutes ago
      Did you even read anything? hahaha
  • jauntywundrkind16 hours ago
    Could be neat to see what giving the 8b like 6gb ram instead of 10gb. Something in-between, where you still need NVMe, but not like the 3x ratio of the 70b model on 23GB.<p>Nice work. PCI-P2P (GPU-Direct (tm)) is such great stuff. Cool to see!
  • ai_hack3r5 minutes ago
    [dead]
  • builderhq_io37 minutes ago
    [dead]
  • dhjjdjjjd8 hours ago
    [flagged]
  • turingsroot10 hours ago
    [flagged]
    • Aurornis9 hours ago
      &gt; No cuBLAS means they wrote their own GEMM kernels, which is a massive undertaking<p>Not to diminish the impressiveness of this overall project, but it says right up front that these were vibe coded and the Opus 4.6 co-author lines are right in the commit messages. Those pieces were adapted from existing work via LLM, which is exactly the right use in a proof of concept project like this.
    • snovv_crash7 hours ago
      Please don&#x27;t use LLMs to post on HN...
      • flux31255 hours ago
        or at least don&#x27;t make it too obvious.
      • IshKebab7 hours ago
        Yeah I don&#x27;t even get the motivation for that. Are HN accounts valuable in any way?