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.5.2.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.5.2-py3-none-win_amd64.whl (823.6 kB view details)

Uploaded Python 3Windows x86-64

weed_loader_cpu-0.5.2-py3-none-manylinux_2_39_x86_64.whl (2.8 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

weed_loader_cpu-0.5.2-py3-none-manylinux_2_35_x86_64.whl (2.8 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

weed_loader_cpu-0.5.2-py3-none-macosx_15_0_x86_64.whl (2.1 MB view details)

Uploaded Python 3macOS 15.0+ x86-64

weed_loader_cpu-0.5.2-py3-none-macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded Python 3macOS 15.0+ ARM64

weed_loader_cpu-0.5.2-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.5.2.tar.gz.

File metadata

  • Download URL: weed_loader_cpu-0.5.2.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.5.2.tar.gz
Algorithm Hash digest
SHA256 2cae00148d4d6ffefc8ff24c345de0ba375a65de4529d563409df1bf6dddb3eb
MD5 fa62ebfc9f1568768422edbfd3b45206
BLAKE2b-256 ff894eb34e16f27c7150edbccd35d0d6a6f9cd347898631c9e9a77903baf8a50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for weed_loader_cpu-0.5.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3f89465243d3e8e04f939a25cc95f87678f747cc1f1970f96e6b4dea86da86fb
MD5 cfd763710bc85aad68742c8c9d0f6e1f
BLAKE2b-256 3751617a2b17a0d996ef383ba16308a79b5a0b0463c6e137bf78b4329327b580

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for weed_loader_cpu-0.5.2-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 14e5da6f11de6e287b463083d7386bfbf6931b47ba1ec04792f570e1af149650
MD5 a61726044929713c3f7fd2c647a7ac28
BLAKE2b-256 835557badf980d3eb22e33679ead1bea0b316e1c1629b76f1c4ce5f393b1b1e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for weed_loader_cpu-0.5.2-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 ef028494580644a57324ca9561e1ade054456b81322dea1f2f1e75151c8d5a86
MD5 3c04de275b98b86203ef410b0ec37aa9
BLAKE2b-256 7c6fbfb9eeb48d019cc4feae7fc1cc4c75349e2d6a7e4705014879c0db9c522b

See more details on using hashes here.

File details

Details for the file weed_loader_cpu-0.5.2-py3-none-macosx_15_0_x86_64.whl.

File metadata

File hashes

Hashes for weed_loader_cpu-0.5.2-py3-none-macosx_15_0_x86_64.whl
Algorithm Hash digest
SHA256 e4cd4a4f66acb02564663dbc837808af298257124feed849a8d989962a391948
MD5 658d05e406311060fe61187ea517765c
BLAKE2b-256 649989181a20034809ad01d649a1368ad2f0654de0487858c92d7b64d67d2de2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for weed_loader_cpu-0.5.2-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 138ad86da506a8256c5348bac853af259c9e1b7d2d76a91a83bb1a1b62de5a12
MD5 9cc612914f879b879d7faf3a11e676f0
BLAKE2b-256 3466c8a5adddf6a8e1466c23b9aeb2021f8204d5b7e27993823e2d218b8c7152

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for weed_loader_cpu-0.5.2-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 5f58064ac95e4c71200c023f1a8913392aaf5caca66598a83b3cf6a48c2fbae8
MD5 f2e37d6babfc5a7d7163965698d69b93
BLAKE2b-256 b8e1e37fdc48b8918e581af47e99640006c5b1a44f3671b0508f71f1a5bb2f50

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