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-0.5.3.tar.gz (11.6 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-0.5.3-py3-none-win_amd64.whl (1.1 MB view details)

Uploaded Python 3Windows x86-64

weed_loader-0.5.3-py3-none-manylinux_2_39_x86_64.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

weed_loader-0.5.3-py3-none-manylinux_2_35_x86_64.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

weed_loader-0.5.3-py3-none-macosx_15_0_x86_64.whl (2.1 MB view details)

Uploaded Python 3macOS 15.0+ x86-64

weed_loader-0.5.3-py3-none-macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded Python 3macOS 15.0+ ARM64

weed_loader-0.5.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-0.5.3.tar.gz.

File metadata

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

File hashes

Hashes for weed_loader-0.5.3.tar.gz
Algorithm Hash digest
SHA256 7d4578ff54e5d446e53a162da87775fc4da1bdc4fbc7d21b60d6ce50628cd24f
MD5 40689cbd3d5e2c559e7a734b77632cec
BLAKE2b-256 155cb0914e1618d4e48c315eb4942ca75ec7f4ffd126b0f0e9aa53f4e08cce38

See more details on using hashes here.

File details

Details for the file weed_loader-0.5.3-py3-none-win_amd64.whl.

File metadata

  • Download URL: weed_loader-0.5.3-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for weed_loader-0.5.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 759c40a0770a6ed52c56e03e7957a10b533523c4b35e038212396f119fc065e1
MD5 50afc4c6efb43595352452f25d0f9640
BLAKE2b-256 fc55333c31d13318f24d0c500c35221bef3ed8a72fdb044b0fe3e1ddcd0b3ede

See more details on using hashes here.

File details

Details for the file weed_loader-0.5.3-py3-none-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for weed_loader-0.5.3-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 8db95a0412a0c57f77f218bda0f80d8441155e085f0e0102617ee7f84863b237
MD5 05b52df89f42aed2b10d0b7d00f61ad0
BLAKE2b-256 6e6eb69197e7b92083265d0216f0d96081de25027c3b25e91d3ab7d51b65bb41

See more details on using hashes here.

File details

Details for the file weed_loader-0.5.3-py3-none-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for weed_loader-0.5.3-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 2a9fe96e5a7af4ac03908a39bcee96f5137aad05417969025c3cd5d3dcfa61d2
MD5 0b7b6b9d6d912f1be7be8f743869517e
BLAKE2b-256 10a7f0620742d20f3ef52b347e0cbb030c9c9e728adc3f60fadfc9941ddfccb1

See more details on using hashes here.

File details

Details for the file weed_loader-0.5.3-py3-none-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for weed_loader-0.5.3-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 79af54ae2e6035ac985e609d0c184a09363158c7295bdba169e4a9471349201e
MD5 3b2f08f0fd95d127cb76a75862f9a4ed
BLAKE2b-256 eef1e66aa23fd6aa5ae9ae8f24977676d4a2083722e2785e2fd594544b2c472c

See more details on using hashes here.

File details

Details for the file weed_loader-0.5.3-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for weed_loader-0.5.3-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 b4dd539ffff5bf4ffd0c9e69015926fd88496199fb75655b9078eb9999c0abb8
MD5 6282dbe74812398f834a23344cc7a66b
BLAKE2b-256 8d89114944df8d8df3e92e3c0e0b547dfa67cc9fbc19871b5b41d689c445b067

See more details on using hashes here.

File details

Details for the file weed_loader-0.5.3-py3-none-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for weed_loader-0.5.3-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 a75eff56f4bad4ebb4b825e617956e412c2a2baed0268b7ffa34eccae55c27ae
MD5 eda5e9cb6bdbe90cef24ea45320f7450
BLAKE2b-256 dafb1c7699e4458db151672cf8856a235786ea18a49adbee64d9329066637086

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