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 (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 1.0.0

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 1.0.0
File Size Uploaded Provenance Actions
weed_loader_cpu-1.0.0.tar.gz 12.0 kB Without provenance Details for weed_loader_cpu-1.0.0.tar.gz

Built distributions (wheels)

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

Total release size: 8.9 MB

Release files / weed_loader_cpu-1.0.0.tar.gz

Download URL weed_loader_cpu-1.0.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
74c14108b20042588f4b1438c6ca36fac98f75296bbe8a7db75da6dc6afdcca0
BLAKE2b-256 checksum
How to use checksums
731fa0cadc53b181e48fd3cddd97129dbabcc0759d3205dba1dd304f7c1d2b43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

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

Download URL weed_loader_cpu-1.0.0-py3-none-win_amd64.whl
Size 866.6 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
ff8ac0347ef9f3b5879d866f415f7b4a880a46dc2c0cb649231abfd0fe50dcc1
BLAKE2b-256 checksum
How to use checksums
76e07c4ac2f6af0bb0e019a96e7ef5a57282fa528c5db5388ae718742e7dfa1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

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

Download URL weed_loader_cpu-1.0.0-py3-none-manylinux_2_39_x86_64.whl
Size 3.0 MB
Tags Linux glibc 2.39+ x86-64 Python 3
SHA-256 checksum
How to use checksums
d8afdb5593c5c369f4da596fa3b13375b98f896fb509aa9e20c5b8fd45ec4b0c
BLAKE2b-256 checksum
How to use checksums
f579af21511c98fa743f65e65a8abf0d88a677d4bd1e8bf0416c692376fa38d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

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

Download URL weed_loader_cpu-1.0.0-py3-none-manylinux_2_35_x86_64.whl
Size 3.0 MB
Tags Linux glibc 2.35+ x86-64 Python 3
SHA-256 checksum
How to use checksums
069c5752ca94fb9f211ecef95b852b29e4426d80929fd1994ffa81b26dd7e285
BLAKE2b-256 checksum
How to use checksums
fcc9e38808266f144ae60e0f37b77b8ea29b245dec2b365257f8c60632922dc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

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

Download URL weed_loader_cpu-1.0.0-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
b6b6076298668229170ff8f377f2eafff8fcec65253d57dab49706a8507001dc
BLAKE2b-256 checksum
How to use checksums
0052403c4549ffc3693dcd8ecfade425d904ef47be5c6adec0b6da2415bb5aee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for weed-loader-cpu 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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