Skip to main content
weed_logo

Weed

Minimalist AI/ML inference and backprogation in the style of Qrack

Weed Loader

This repository is for the Python loader for (C++) Weed models. Once you have trained models in C++, you can load them for use by Python with this project. See the Weed repository for more information.

Development Status

Weed is a rapidly-developing work-in-progress. Its ABI may change drastically and without notice.

The project provides a set of essential CPU and GPU kernels, used by Tensor instances that perform autograd. We also provide stochastic gradient descent (SGD) and Adam optimizer implementations. (Build and check the API reference to get started.)

GPT-2, BERT, and Qwen loading is experimental and mostly provided as proof-of-concept, also of the fine-tuning pipeline. Implementation was from published literature design, rather than direct analysis of any open source, to implement these model architectures. Their outputs, in Weed, are not yet coherent English, as a result.

Why try Weed?

With the growing popularity of AI/ML tools and workflows (including LLMs), legacy frameworks often carry "code debt" from over a decade of rapidly developing research history. This has led them to "bolt on" new features and advancements to design principles decided before the latest research. Popular frameworks also commonly started based in Python (maybe to capture early adoption), only later potentially "tacking on" a C++ library for special-case deployment needs. These conditions have produced libraries and frameworks with complicated dependency trees that occupy upward of a GB of disk footprint. This entire ecosystem might be due for a "refresh."

Weed does not seek to fully replace or supplant established frameworks. However, it aims for minimalist complete closure on the primitives necessary for high-performance AI/ML inference and back-propagation. Chiefly, this includes kernels, and a Tensor interface that immediately produces an autograd graph appropriate for training. Allowing optional OpenCL for hardware acceleration, it will remain free of required dependencies outside of C++(11) language standard.

Rethinking AI/ML library design this way, Weed has realized a rather unique and powerful form of sparsification of Tensor storage. Sparseness should not be a Tensor interface concern, but rather a Storage concern. Inspired by the design of the Qrack quantum computer simulation framework, the Tensor interface treats sparse and dense tensors as functionally equivalent. Sparse optimization is so "transparently streamlined," this way, that it defaults to enabled for CPU-based tensors, and we recommend you leave it enabled at all times.

Much like Qrack, Weed is designed to make the correct thing the default—and the expensive thing explicit.

Useful environment variables

If a transformer model you load or train runs into an OpenCL "out-of-resources" error (code -5), try setting environment variable WEED_TELESCOPE_TRANSFORMERS to any truthy value (like 1) so that Weed will "telescope" transformer encoder layers, by migrating each parameter in each layer to CPU (off of GPU memory) once its immediate usefulness is done.

Copyright, License, and Acknowledgments

Copyright (c) Daniel Strano and the Qrack contributors 2017-2026. All rights reserved.

In its include/common folder, Weed bundles a copy of rapidcsv by Kristofer Berggren, reused under a BSD 3-Clause License. (This is a convenience and suggestion to Weed's users, for loading CSVs.)

The Weed logo was produced with assistance from "Elara," an OpenAI custom GPT, and it is in the public domain. Elara has also been responsible for a huge amount of coaching and implementation drafts for Dan Strano to review and bring into line with standards, so she should be credited with coauthorship in any capacity that can be allowed. (Anthropic) Claude has also helped mostly with debugging, as well as developing an LLM front-end, fine-tuning interface, and modules for popular transformer model architectures, so they should rightly be credited similarly as a coauthor. KV cache improvements are based on TurboQuant (Zandieh et al., arXiv:2504.19874) and an Apache 2.0 open-source implementation by TheTom (github.com/TheTom/turboquant_plus), adapted for complex quantum state vectors by (Anthropic) Claude, with limited guidance and input from Dan Strano.

Licensed under the GNU Lesser General Public License V3.

See LICENSE.md in the project root or https://www.gnu.org/licenses/lgpl-3.0.en.html for details.

Release files for weed-loader-cpu 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for weed-loader-cpu 0.7.3
File Size Uploaded
weed_loader_cpu-0.7.3.tar.gz 12.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for weed-loader-cpu 0.7.3
File
weed_loader_cpu-0.7.3-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
weed_loader_cpu-0.7.3-py3-none-manylinux_2_39_x86_64.whl Python 3 none Linux glibc 2.39+ x86-64 Details
weed_loader_cpu-0.7.3-py3-none-manylinux_2_35_x86_64.whl Python 3 none Linux glibc 2.35+ x86-64 Details
weed_loader_cpu-0.7.3-py3-none-macosx_15_0_arm64.whl Python 3 none macOS 15.0+ ARM64 Details
weed_loader_cpu-0.7.3-py3-none-macosx_14_0_arm64.whl Python 3 none macOS 14.0+ ARM64 Details

Total release size: 10.7 MB

Release files / weed_loader_cpu-0.7.3.tar.gz

Download URL weed_loader_cpu-0.7.3.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9905eb6196b88f3691ffa5e3dbfb06ed53f909d694f909a2ca4b3c077ece9068
BLAKE2b-256 checksum
How to use checksums
65d7924d1413f1c768d1d0aea6f98aa7bf314f4189b1a24b6d45360a9b7d1008
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / weed_loader_cpu-0.7.3-py3-none-win_amd64.whl

Download URL weed_loader_cpu-0.7.3-py3-none-win_amd64.whl
Size 852.1 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
d0f006c645b0ba5f4e9b4766516a057eb67302a8c2eb4b2b9dd2f2fb8e64057e
BLAKE2b-256 checksum
How to use checksums
1e508f7d3b030950c3e9f9da92f6858023464211dc83e5bbea3e6c6df8cb1c6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / weed_loader_cpu-0.7.3-py3-none-manylinux_2_39_x86_64.whl

Download URL weed_loader_cpu-0.7.3-py3-none-manylinux_2_39_x86_64.whl
Size 2.9 MB
Tags Linux glibc 2.39+ x86-64 Python 3
SHA-256 checksum
How to use checksums
4e82f16d7b807aadffe4ba4492ecb5b23b6562322bdfec1cb1ba2b63358f102e
BLAKE2b-256 checksum
How to use checksums
87df73e99a05dd36ea75a4bf13aa3a5274aba4bb8a38710fb32d56eb118e15d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / weed_loader_cpu-0.7.3-py3-none-manylinux_2_35_x86_64.whl

Download URL weed_loader_cpu-0.7.3-py3-none-manylinux_2_35_x86_64.whl
Size 2.9 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
c7ee8e98271d54b39a50e816ba99247c5a735d7ca27c26c750033af80361722d
BLAKE2b-256 checksum
How to use checksums
8a3d2fe5d7ca2590c7b1cc41fbd2821f7c20143184cd61ce19e6478598714fb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / weed_loader_cpu-0.7.3-py3-none-macosx_15_0_arm64.whl

Download URL weed_loader_cpu-0.7.3-py3-none-macosx_15_0_arm64.whl
Size 2.0 MB
Tags Python 3 macOS 15.0+ ARM64
SHA-256 checksum
How to use checksums
9d4b707b10fd39e60987b8ea23e9ae69ef53ea1e20326116cd4a320343c02dd2
BLAKE2b-256 checksum
How to use checksums
6c67331eb71f7110345ccc8711e5a9c9f5d897def3fd1c4f3d06d341986dabc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / weed_loader_cpu-0.7.3-py3-none-macosx_14_0_arm64.whl

Download URL weed_loader_cpu-0.7.3-py3-none-macosx_14_0_arm64.whl
Size 2.0 MB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
f24caa317ea651ea71ff78823bbf7ad0dbe51363dc5c66ada065339c3297f0c6
BLAKE2b-256 checksum
How to use checksums
2273bf89ed8fe1036339bd79ec8401b2c495d53fa566d89de31f89f892166eff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.7.3 This release

6 release files

0.7.2

6 release files

0.7.1

6 release files

0.7.0

6 release files

0.6.3

6 release files

0.6.2

6 release files

0.6.1

6 release files

0.6.0

6 release files

0.5.4

7 release files

0.5.3

7 release files

0.5.2

7 release files

0.5.1

7 release files

0.5.0

7 release files

0.4.0

7 release files

0.3.2

7 release files

0.3.1

7 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page