Skip to main content

Weed (Loader) - Minimalist AI/ML inference and backprogation

Project description

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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weed_loader_cpu-0.6.3.tar.gz (11.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

weed_loader_cpu-0.6.3-py3-none-win_amd64.whl (832.0 kB view details)

Uploaded Python 3Windows x86-64

weed_loader_cpu-0.6.3-py3-none-manylinux_2_39_x86_64.whl (2.9 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

weed_loader_cpu-0.6.3-py3-none-manylinux_2_35_x86_64.whl (2.9 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

weed_loader_cpu-0.6.3-py3-none-macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded Python 3macOS 15.0+ ARM64

weed_loader_cpu-0.6.3-py3-none-macosx_14_0_arm64.whl (1.9 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

File details

Details for the file weed_loader_cpu-0.6.3.tar.gz.

File metadata

  • Download URL: weed_loader_cpu-0.6.3.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for weed_loader_cpu-0.6.3.tar.gz
Algorithm Hash digest
SHA256 efa035caf58bebf05cc1b3e5098a4b42da99b5a61748faf09b19c8ae4b9defad
MD5 334c8b9dfb4ca6b732b9f0fff54fddde
BLAKE2b-256 a115f0bdae3128999f2b4daac8abe1123be29ff67767f619be15e45ec6a2fc19

See more details on using hashes here.

File details

Details for the file weed_loader_cpu-0.6.3-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for weed_loader_cpu-0.6.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ef803acdd11b7372a0ed4f439d85138406e0a9784471f862687e84a05a224e74
MD5 94f5360be5cda8b366e6c8e9ad14b9a9
BLAKE2b-256 f4cbe0a0e9a8b32b32395cb8d0fa0511ac66757fb4cd1a87e12bbae97a32e5be

See more details on using hashes here.

File details

Details for the file weed_loader_cpu-0.6.3-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for weed_loader_cpu-0.6.3-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 38e66360f72cbd2bacff5ac35d13d7c2cb927baef008eff145da81bb28a937d8
MD5 9652c45eb5ba2fa3b356850effc4c112
BLAKE2b-256 e5ed31371cab24ccad12f7f47040c051b1682d06988facc64e112fbd9be62b16

See more details on using hashes here.

File details

Details for the file weed_loader_cpu-0.6.3-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for weed_loader_cpu-0.6.3-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 caf47619ae0f5bd81f281090e36f8486b469a2b24f1512202007ebb592cccaba
MD5 9e3ff9dca03c16194c0c4ce2c6d7e804
BLAKE2b-256 8ce74f898fe5648f5aa8963dd9cf982fbb8a475bcd1ec00fe9bd4352f0547161

See more details on using hashes here.

File details

Details for the file weed_loader_cpu-0.6.3-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for weed_loader_cpu-0.6.3-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8c5e56ec6b8f534380c5c4dfbbc71ba65f24a4a539343ef4587e0eac1b9d59cf
MD5 0a10ebc1b2b78edec53b672b1b381f71
BLAKE2b-256 5c003a4e7c302f0d8bb6039f9ecf190e6c0cc487c724bcb92c55bbcf126d477a

See more details on using hashes here.

File details

Details for the file weed_loader_cpu-0.6.3-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for weed_loader_cpu-0.6.3-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e3271a368ebf5f1f2ff4789e23efb6118ff1ec1481c01da7e8244ba3307c979c
MD5 7d07947a0dc815354e611383444aea47
BLAKE2b-256 dcdecb7538581218b143b9264bdd68bffb44157a9c291645fa63cf9a78c6f0b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page