{"by":"nirw4nna","descendants":28,"id":44310678,"kids":[44312239,44311123,44311852,44315365,44312647,44313538,44312968,44315703],"score":119,"text":"Hi HN,<p>Over the past few months, I&#x27;ve been building `dsc`, a tensor library from scratch in C++&#x2F;CUDA. My main focus has been on getting the basics right, prioritizing a clean API, simplicity, and clear observability for running small LLMs locally.<p>The key features are:\n- C++ core with CUDA support written from scratch.\n- A familiar, PyTorch-like Python API.\n- Runs real models: it&#x27;s complete enough to load a model like Qwen from HuggingFace and run inference on both CUDA and CPU with a single line change[1].\n- Simple, built-in observability for both Python and C++.<p>Next on the roadmap is adding BF16 support and then I&#x27;ll be working on visualization for GPU workloads.<p>The project is still early and I would be incredibly grateful for any feedback, code reviews, or questions from the HN community!<p>GitHub Repo: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;nirw4nna&#x2F;dsc\">https:&#x2F;&#x2F;github.com&#x2F;nirw4nna&#x2F;dsc</a><p>[1]: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;nirw4nna&#x2F;dsc&#x2F;blob&#x2F;main&#x2F;examples&#x2F;models&#x2F;qwen2_5.py\">https:&#x2F;&#x2F;github.com&#x2F;nirw4nna&#x2F;dsc&#x2F;blob&#x2F;main&#x2F;examples&#x2F;models&#x2F;qw...</a>","time":1750260005,"title":"Show HN: I built a tensor library from scratch in C++/CUDA","type":"story","url":"https://github.com/nirw4nna/dsc"}